moved physics into its own class in physics.py
All checks were successful
Build Simulation and Test / Run All Tests (push) Successful in 1m8s
All checks were successful
Build Simulation and Test / Run All Tests (push) Successful in 1m8s
This commit is contained in:
parent
7289543f6a
commit
dee0eaa9f9
@ -89,7 +89,7 @@ class Physics:
|
|||||||
velocity_y = self.velocity[1] + self.acceleration[1]
|
velocity_y = self.velocity[1] + self.acceleration[1]
|
||||||
self.velocity = (velocity_x, velocity_y)
|
self.velocity = (velocity_x, velocity_y)
|
||||||
|
|
||||||
# # clamp velocity
|
# clamp velocity
|
||||||
speed = math.sqrt(self.velocity[0] ** 2 + self.velocity[1] ** 2)
|
speed = math.sqrt(self.velocity[0] ** 2 + self.velocity[1] ** 2)
|
||||||
if speed > MAX_VELOCITY:
|
if speed > MAX_VELOCITY:
|
||||||
scale = MAX_VELOCITY / speed
|
scale = MAX_VELOCITY / speed
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user