<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/gamebox/actors/logo.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -57,3 +57,4 @@
 * reorganized code
 * changed :parts to :shapes in the physical behavior
 * merged in jacius' new event system
+* new physics playground example</diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -11,6 +11,7 @@ lib/gamebox.rb
 lib/gamebox/actor.rb
 lib/gamebox/actor_factory.rb
 lib/gamebox/actor_view.rb
+lib/gamebox/actors/logo.rb
 lib/gamebox/actors/score.rb
 lib/gamebox/actors/svg_actor.rb
 lib/gamebox/ai/line_of_site.rb
@@ -49,7 +50,6 @@ lib/gamebox/lib/platform.rb
 lib/gamebox/lib/publisher_ext.rb
 lib/gamebox/lib/sorted_list.rb
 lib/gamebox/lib/surface_ext.rb
-lib/gamebox/logo.rb
 lib/gamebox/mode.rb
 lib/gamebox/mode_manager.rb
 lib/gamebox/physical_director.rb</diff>
      <filename>Manifest.txt</filename>
    </modified>
    <modified>
      <diff>@@ -23,7 +23,7 @@ class Coin &lt; Actor
   
   def die(ttl=0)
     @ttl = ttl
-    body.apply_impulse(vec2(0,-400), ZeroVec2)
+    body.apply_impulse(vec2(0,-400), ZERO_VEC_2)
   end
   
   def dying?;@ttl;end</diff>
      <filename>examples/nario/src/coin.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ class Goomba &lt; Actor
         :shape =&gt; :poly,
         :mass =&gt; 200,
         :friction =&gt; 0.8,
-        :moment =&gt; Float::Infinity,
+        :moment =&gt; Float::INFINITY,
         :verts =&gt; [[-17,-16],[-17,14],[17,14],[17,-16]]},
     :layered =&gt; {:layer =&gt; 2, :parallax =&gt; 1}
 
@@ -51,11 +51,11 @@ class Goomba &lt; Actor
   end
 
   def move_right(time)
-    goomba_body.apply_impulse(@right_vec*time, ZeroVec2) if physical.body.v.length &lt; @max_speed
+    goomba_body.apply_impulse(@right_vec*time, ZERO_VEC_2) if physical.body.v.length &lt; @max_speed
   end
 
   def move_left(time)
-    goomba_body.apply_impulse(@left_vec*time, ZeroVec2) if physical.body.v.length &lt; @max_speed
+    goomba_body.apply_impulse(@left_vec*time, ZERO_VEC_2) if physical.body.v.length &lt; @max_speed
   end
   
   def debug</diff>
      <filename>examples/nario/src/goomba.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,12 +8,19 @@ class Nario &lt; Actor
           :nario_feet =&gt; {:verts =&gt; [[-13,20],[-13,21],[13,21],[13,20]],:shape=&gt;:poly, :offset =&gt; vec2(0,6)},
           :nario_hat =&gt; {:verts =&gt; [[-8,20],[-8,21],[8,21],[8,20]],:shape=&gt;:poly, :offset =&gt; vec2(0,-46)}
           ],
-        :bodies =&gt; [
-          
+        :bodies =&gt; [ # TODO make physical read multiple bodies
+          :shape =&gt; :poly,
+          :shapes =&gt; [
+            :nario_feet =&gt; {:verts =&gt; [[-13,20],[-13,21],[13,21],[13,20]],:shape=&gt;:poly, :offset =&gt; vec2(0,6)},
+            :nario_hat =&gt; {:verts =&gt; [[-8,20],[-8,21],[8,21],[8,20]],:shape=&gt;:poly, :offset =&gt; vec2(0,-46)}
+            ],
+          :mass =&gt; 150,
+          :friction =&gt; 0.4,
+          :moment =&gt; Float::INFINITY,
+          :verts =&gt; [[-15,-20],[-15,20],[15,20],[15,-20]]},
         ],
         :mass =&gt; 150,
         :friction =&gt; 0.4,
-        :moment =&gt; Float::Infinity,
         :verts =&gt; [[-15,-20],[-15,20],[15,20],[15,-20]]},
     :layered =&gt; {:layer =&gt; 2, :parallax =&gt; 1},
     :animated =&gt; {:frame_update_time=&gt;120}
@@ -97,19 +104,19 @@ class Nario &lt; Actor
     @jump_timer -= time
     @jump_timer = 0 if @jump_timer &lt; 0
 
-    nario_body.apply_impulse(vec2(0,-@jump_speed)*time, ZeroVec2) if physical.body.v.length &lt; @max_speed
+    nario_body.apply_impulse(vec2(0,-@jump_speed)*time, ZERO_VEC_2) if physical.body.v.length &lt; @max_speed
   end
 
   def move_right(time)
     @facing_dir = :right
     force = grounded? ? @right_vec*2 : @right_vec
-    nario_body.apply_impulse(force*time, ZeroVec2) if physical.body.v.length &lt; @max_speed
+    nario_body.apply_impulse(force*time, ZERO_VEC_2) if physical.body.v.length &lt; @max_speed
   end
 
   def move_left(time)
     @facing_dir = :left
     force = grounded? ? @left_vec*2 : @left_vec
-    nario_body.apply_impulse(force*time, ZeroVec2) if physical.body.v.length &lt; @max_speed
+    nario_body.apply_impulse(force*time, ZERO_VEC_2) if physical.body.v.length &lt; @max_speed
   end
   
   def debug</diff>
      <filename>examples/nario/src/nario.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,5 +2,5 @@ require 'actor'
 
 class NarioBackground &lt; Actor
   has_behaviors :graphical,
-    {:layered =&gt; {:layer =&gt; 0, :parallax =&gt; Float::Infinity}}
+    {:layered =&gt; {:layer =&gt; 0, :parallax =&gt; Float::INFINITY}}
 end</diff>
      <filename>examples/nario/src/nario_background.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@ class BoxShooter &lt; Actor
 
   def shoot_box
     box = spawn :box, :x =&gt; @x, :y =&gt; @y
-    box.body.apply_impulse vec2(500, -700), ZeroVec2
+    box.body.apply_impulse vec2(500, -700), ZERO_VEC_2
     box.shape.e = 1.0
     box.shape.u = 0.0
   end</diff>
      <filename>examples/playground/src/box_shooter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -40,20 +40,6 @@ class Clicky &lt; Actor
     @last_mouse_x = @x
     @last_mouse_y = @y
 
-    i.reg MouseDownEvent do |evt|
-      mouse_x = evt.pos[0]
-      mouse_y = evt.pos[1]
-      bounds = self.shape.bb
-
-      if mouse_x &gt;= bounds.l &amp;&amp; mouse_x &lt;= bounds.r &amp;&amp;
-        mouse_y &gt;= bounds.b &amp;&amp; mouse_y &lt;= bounds.t
-        @offset_x = mouse_x - self.x
-        @offset_y = mouse_y - self.y
-#        puts &quot;mouse [#{mouse_x},#{mouse_y}] : clicky [#{@x},#{@y}]&quot;
-        @following_mouse = true
-      end
-    end
-
     i.reg MouseMotionEvent do |evt|
       @velocity = vec2((evt.pos[0]-@last_mouse_x) * 1.2, (evt.pos[1]-@last_mouse_y) * 1.2)
       @last_mouse_x = evt.pos[0]
@@ -65,6 +51,12 @@ class Clicky &lt; Actor
     end
   end
 
+  def clicked(mouse_x,mouse_y)
+      @offset_x = mouse_x - self.x
+      @offset_y = mouse_y - self.y
+      @following_mouse = true
+  end
+
   def update(delta)
     if @following_mouse
       self.warp vec2(@last_mouse_x-@offset_x, @last_mouse_y-@offset_y)</diff>
      <filename>examples/playground/src/clicky.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,24 +3,24 @@ require 'actor'
 class LeftWall &lt; Actor
   has_behaviors :physical =&gt; {:shape =&gt; :poly, 
     :fixed =&gt; true,
-    :mass =&gt; Float::Infinity,
-    :moment =&gt; Float::Infinity,
+    :mass =&gt; Float::INFINITY,
+    :moment =&gt; Float::INFINITY,
     :verts =&gt; [[0,0],[0,800],[1,800],[1,0]]}
 end
 
 class TopWall &lt; Actor
   has_behaviors :physical =&gt; {:shape =&gt; :poly, 
     :fixed =&gt; true,
-    :mass =&gt; Float::Infinity,
-    :moment =&gt; Float::Infinity,
+    :mass =&gt; Float::INFINITY,
+    :moment =&gt; Float::INFINITY,
     :verts =&gt; [[0,0],[0,1],[1024,1],[1024,0]]}
 end
 
 class BottomWall &lt; Actor
   has_behaviors :physical =&gt; {:shape =&gt; :poly, 
     :fixed =&gt; true,
-    :mass =&gt; Float::Infinity,
-    :moment =&gt; Float::Infinity,
+    :mass =&gt; Float::INFINITY,
+    :moment =&gt; Float::INFINITY,
     :x =&gt; 0,
     :y =&gt; 799,
     :verts =&gt; [[0,0],[0,1],[1024,1],[1024,0]]}
@@ -29,8 +29,8 @@ end
 class RightWall &lt; Actor
   has_behaviors :physical =&gt; {:shape =&gt; :poly, 
     :fixed =&gt; true,
-    :mass =&gt; Float::Infinity,
-    :moment =&gt; Float::Infinity,
+    :mass =&gt; Float::INFINITY,
+    :moment =&gt; Float::INFINITY,
     :x =&gt; 1023,
     :y =&gt; 0,
     :verts =&gt; [[0,0],[0,800],[1,800],[1,0]]}</diff>
      <filename>examples/playground/src/walls.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,7 @@ class Bullet &lt; Actor
     if @power &lt;= 0
       remove_self
     end
-    physical.body.apply_impulse(@dir*time*@speed, ZeroVec2) if physical.body.v.length &lt; 400
+    physical.body.apply_impulse(@dir*time*@speed, ZERO_VEC_2) if physical.body.v.length &lt; 400
     super time
   end
 </diff>
      <filename>examples/roids/src/bullet.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,7 +16,7 @@ class Rock &lt; Actor
     physical.body.w += time*@turn_speed
     move_vec = @dir*time*@speed
 #    if (move_vec + physical.body.v).length &lt; 400
-      physical.body.apply_impulse(move_vec, ZeroVec2) 
+      physical.body.apply_impulse(move_vec, ZERO_VEC_2) 
 #    end
     super time
   end</diff>
      <filename>examples/roids/src/rock.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@ class RockBit &lt; Actor
     @ttl -= time
     remove_self if @ttl &lt; 0
     physical.body.w += time*@turn_speed
-    physical.body.apply_impulse(@dir*time*@speed, ZeroVec2) if physical.body.v.length &lt; 400
+    physical.body.apply_impulse(@dir*time*@speed, ZERO_VEC_2) if physical.body.v.length &lt; 400
   end
 
 end</diff>
      <filename>examples/roids/src/rock_bit.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@ class Ship &lt; Actor
 
   can_fire :shoot
 
-  has_behaviors :animated, :updatable, :physical =&gt; {:shape =&gt; :circle, 
+  has_behavior :animated, :updatable, :physical =&gt; {:shape =&gt; :circle, 
     :mass =&gt; 100,
     :friction =&gt; 1.7,
     :radius =&gt; 10}
@@ -81,7 +81,7 @@ class Ship &lt; Actor
   def enforce_limits(time)
     physical.body.w -= 30 if physical.body.w &gt; 2.5
     if physical.body.v.length &gt; @max_speed
-      physical.body.apply_impulse(-physical.body.v*time, ZeroVec2) 
+      physical.body.apply_impulse(-physical.body.v*time, ZERO_VEC_2) 
     end
   end
 
@@ -110,7 +110,7 @@ class Ship &lt; Actor
 #    p move_vec
 #    p physical.body.v
 #    if (move_vec + physical.body.v).length &lt; @max_speed
-      physical.body.apply_impulse(move_vec, ZeroVec2) 
+      physical.body.apply_impulse(move_vec, ZERO_VEC_2) 
 
 #    end
   end</diff>
      <filename>examples/roids/src/ship.rb</filename>
    </modified>
    <modified>
      <diff>@@ -141,5 +141,8 @@ class Actor
       end
       @behaviors
     end
+    define_method( :has_behavior ) do |*args|
+      has_behaviors *args
+    end
   end
 end</diff>
      <filename>lib/gamebox/actor.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@ class SvgActor &lt; Actor
   
   def build_from_vertices(vertices)
     
-    moment_of_inertia,mass = Float::Infinity,Float::Infinity
+    moment_of_inertia,mass = Float::INFINITY,Float::INFINITY
     terrain_body = CP::Body.new(mass,moment_of_inertia)
     elasticity = 0
     friction = 0.7
@@ -45,4 +45,4 @@ class SvgActorView &lt; ActorView
       target.draw_line_s [p1.x+x_off,p1.y+y_off], [p2.x+x_off,p2.y+y_off], [25,255,25,255], 6
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/gamebox/actors/svg_actor.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,7 @@ require 'publisher'
 #      ],
 #    :mass =&gt; 200,
 #    :friction =&gt; 0.4,
-#    :moment =&gt; Float::Infinity,
+#    :moment =&gt; Float::INFINITY,
 #    :verts =&gt; [[-15,-20],[-15,20],[15,20],[15,-20]]}
 class Physical &lt; Behavior
   attr_accessor :shapes, :body, :opts, :parts, :segments_groups
@@ -25,7 +25,7 @@ class Physical &lt; Behavior
   def setup
     # TODO add defaults?
     @mass = @opts[:mass]
-    @mass ||= Float::Infinity
+    @mass ||= Float::INFINITY
     @parts = {}
     @shapes = []
     @segments_groups = []
@@ -36,16 +36,16 @@ class Physical &lt; Behavior
     when :circle
       @radius = @opts[:radius]
 
-      moment_of_inertia ||= @opts[:fixed] ? Float::Infinity : moment_for_circle(@mass, @radius, 0, ZeroVec2)
+      moment_of_inertia ||= @opts[:fixed] ? Float::INFINITY : moment_for_circle(@mass, @radius, 0, ZERO_VEC_2)
       @body = Body.new(@mass, moment_of_inertia)
-      @shape = Shape::Circle.new(@body, @radius, ZeroVec2)
+      @shape = Shape::Circle.new(@body, @radius, ZERO_VEC_2)
 
     when :poly
       shape_array = @opts[:verts].collect{|v| vec2(v[0],v[1])}
 
-      moment_of_inertia ||= @opts[:fixed] ? Float::Infinity : moment_for_poly(@mass, shape_array, ZeroVec2)
+      moment_of_inertia ||= @opts[:fixed] ? Float::INFINITY : moment_for_poly(@mass, shape_array, ZERO_VEC_2)
       @body = Body.new(@mass, moment_of_inertia)
-      @shape = Shape::Poly.new(@body, shape_array, ZeroVec2)
+      @shape = Shape::Poly.new(@body, shape_array, ZERO_VEC_2)
       verts = @opts[:verts].dup
       verts &lt;&lt; @opts[:verts][0]
       @segments_groups &lt;&lt; verts</diff>
      <filename>lib/gamebox/behaviors/physical.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,3 @@
 class Float
-    Infinity = 1.0/0.0
+    INFINITY = 1.0/0.0
 end</diff>
      <filename>lib/gamebox/lib/numbers_ext.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ require 'chipmunk'
 
 require 'numbers_ext'
 include CP
-ZeroVec2 = vec2(0,0)
+ZERO_VEC_2 = vec2(0,0)
 
 class Space
   alias :add_collision_func_old :add_collision_func</diff>
      <filename>lib/gamebox/physics.rb</filename>
    </modified>
    <modified>
      <diff>@@ -42,7 +42,7 @@ class SvgDocument
       if transform and transform =~ /translate\(\s*(.+?)\s*,\s*(.+?\)\s*)/
         vec2($1.to_f, ty = $2.to_f)
       else
-        ZeroVec2
+        ZERO_VEC_2
       end
     end
   end</diff>
      <filename>lib/gamebox/svg_document.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,13 +23,13 @@ class Viewport
   end
 
   def x_offset(layer=1)
-    return 0 if layer == Float::Infinity
+    return 0 if layer == Float::INFINITY
     return @x_offset if layer == 1
     @x_offset / layer
   end
 
   def y_offset(layer=1)
-    return 0 if layer == Float::Infinity
+    return 0 if layer == Float::INFINITY
     return @y_offset if layer == 1
     @y_offset / layer
   end</diff>
      <filename>lib/gamebox/viewport.rb</filename>
    </modified>
    <modified>
      <diff>@@ -47,12 +47,12 @@ describe 'A new viewport' do
     @viewport.y_offset(2).should equal(-150)
   end
 
-  it 'should return a zero offset on Infinity' do
+  it 'should return a zero offset on INFINITY' do
     @viewport.x_offset = -200
     @viewport.y_offset = -300
     
-    @viewport.x_offset(Float::Infinity).should equal(0)
-    @viewport.y_offset(Float::Infinity).should equal(0)
+    @viewport.x_offset(Float::INFINITY).should equal(0)
+    @viewport.y_offset(Float::INFINITY).should equal(0)
   end
   
   it 'shouldn\'t update anything unless following a target' do</diff>
      <filename>test/test_viewport.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/gamebox/logo.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>980c3a79c0bb5a017b7d5b663f0a561997ae61f8</id>
    </parent>
  </parents>
  <author>
    <name>Shawn Anderson</name>
    <email>shawn42@gmail.com</email>
  </author>
  <url>http://github.com/shawn42/gamebox/commit/be667b0c224b020dd63bcc6583c1f1dbafae0542</url>
  <id>be667b0c224b020dd63bcc6583c1f1dbafae0542</id>
  <committed-date>2009-08-11T04:39:00-07:00</committed-date>
  <authored-date>2009-08-11T04:39:00-07:00</authored-date>
  <message>renamed Infinity to INFINITY; ZeroVec2 to ZERO_VEC_2; added has_behavior alias</message>
  <tree>eab59c3085aaee464292881472520dcb9fcfdd31</tree>
  <committer>
    <name>Shawn Anderson</name>
    <email>shawn42@gmail.com</email>
  </committer>
</commit>
