diff options
author | Baitinq <you@example.com> | 2022-02-07 15:39:30 +0000 |
---|---|---|
committer | Baitinq <you@example.com> | 2022-02-07 15:39:30 +0000 |
commit | b616302038e6b1a32333c2a6c5339c20be548cf2 (patch) | |
tree | 4cbaa1f7c8979e765cee6656a5d5dcee904f1057 /simulation.py | |
parent | Initial Commit (diff) | |
download | OSLS-b616302038e6b1a32333c2a6c5339c20be548cf2.tar.gz OSLS-b616302038e6b1a32333c2a6c5339c20be548cf2.tar.bz2 OSLS-b616302038e6b1a32333c2a6c5339c20be548cf2.zip |
Add initial pygame gui
Diffstat (limited to 'simulation.py')
-rw-r--r-- | simulation.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/simulation.py b/simulation.py index a93a263..223f931 100644 --- a/simulation.py +++ b/simulation.py @@ -19,6 +19,7 @@ class Simulation(): self.rocket = rocket self.y = 0 self.speed_y = 0 + self.acceleration_y = 0 #simulation logic def tick(self, delta: int) -> None: @@ -58,9 +59,9 @@ class Simulation(): total_force = upwards_force - downwards_force print("Total force: " + str(total_force)) - acceleration = total_force / self.rocket.total_mass() #mayb we need momentum?? - print("Acceleration: " + str(acceleration)) - self.speed_y = self.speed_y + (acceleration * delta) #i think thir swrong + self.acceleration_y = total_force / self.rocket.total_mass() #mayb we need momentum?? + print("Acceleration: " + str(self.acceleration_y)) + self.speed_y = self.speed_y + (self.acceleration_y * delta) #i think thir swrong #update position based on velocity and delta self.y += self.speed_y * delta |