Module: Chippunk::Helper

Includes:
Enumerable
Included in:
Builder, Object
Defined in:
lib/chippunk/helper.rb

Instance Method Summary collapse

Instance Method Details

#coords_to_verts(list_of_coords) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/chippunk/helper.rb', line 9

def coords_to_verts(list_of_coords)
  verts = []
  
  #puts list_of_coords
  
  #puts " + + + + + + +  +"
  
  list_of_coords.flatten.each_slice(2) do |coords|
    x,y = coords.values_at(0,1)
    verts.push(vec2(x,y))
  end
  #puts verts
  #exit
  verts
end