From 069b3e910b2d48a438ba76aef1b742cdae9465e7 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Fri, 21 Jan 2022 08:57:08 +0100 Subject: [PATCH] Fixed orbit bug --- src/app.rb | 6 +++--- src/lib/world.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app.rb b/src/app.rb index 9b5c7f7..af153c7 100755 --- a/src/app.rb +++ b/src/app.rb @@ -54,7 +54,7 @@ class Window < Gosu::Window ply.show_info = false ply.thrust = 0.0075 ply.pos = Vector[800, 450 + 500] - ply.vel = Vector[0.1, 0] + ply.vel = Vector[1, 0] @world.controller = ply cube2 = PhysCube.new("Beta", self, 8, 8) @@ -74,11 +74,11 @@ class Window < Gosu::Window sol.orbit(sol_orbiters) @world.planets << sol - @world.planets << planet + #@world.planets << planet @world.physobjs << ply @world.physobjs << cube2 - @world.physobjs << planet + #@world.physobjs << planet @world.freeze = false # self.mainmenu.show = false diff --git a/src/lib/world.rb b/src/lib/world.rb index 83126a6..2880f75 100644 --- a/src/lib/world.rb +++ b/src/lib/world.rb @@ -22,7 +22,7 @@ class World orbiters += @physobjs # append each element orbiters += @planets orbiters.delete(planet) # dont orbit yourself, it is bad for your health. - planet.orbit(planets) + planet.orbit(orbiters) end end end