diff --git a/app.rb b/app.rb index 6ba27ae..1c7d837 100755 --- a/app.rb +++ b/app.rb @@ -46,6 +46,22 @@ class Window < Gosu::Window end end +# def button_up?(id) +# super id +# +# if( @controller != nil ) then +# @controller.button_up?(id) +# end +# end +# +# def button_down?(id) +# super id +# +# if( @controller != nil ) then +# @controller.button_down?(id) +# end +# end + def update if( !@freeze ) then @physobjs.each do |obj| @@ -95,7 +111,7 @@ window.controller = cube cube2 = PhysCube.new("Beta", window, 8, 8) cube2.pos = Vector[800, 450 + 300] -cube2.vel = Vector[-2.5, 0] +cube2.vel = Vector[-1.24, 0] planet.orbit([cube, cube2]) diff --git a/physobj.rb b/physobj.rb index 6cb8b59..3035556 100644 --- a/physobj.rb +++ b/physobj.rb @@ -159,6 +159,12 @@ class Player < PhysCube end def button_up(id) + end + + def button_up?(id) + end + + def button_down(id) if( id == Gosu::KbSpace ) then @engine = !@engine end @@ -172,6 +178,10 @@ class Player < PhysCube end end - def button_down(id) + def button_down?(id) + end + + private def debug_string + return "\n#{self.name}\nVel: #{self.vel.magnitude.round(1)} #{self.vel.round(4)}\nAccel: #{self.accel.magnitude.round(4)} #{self.accel.round(4)}\nPos: #{self.pos.round(4)}\nAngle: #{self.angle.round(1)} deg\nEngine: #{self.engine}\nThrust: #{self.thrust}\n" end end