diff --git a/project/main.py b/project/main.py index 863b390..bd4d077 100644 --- a/project/main.py +++ b/project/main.py @@ -38,7 +38,7 @@ elif what_to_run == 'physics': screen = pygame.display.set_mode((600, 500)) pygame.display.set_caption("PM GAME") clock = pygame.time.Clock() - frame_rate = 60 + frame_rate = 59.52 spritesheet_manager = SpritesheetManager("data/sprites", "data/sprites/sprites.json") diff --git a/project/physics/PhysicsElementsHandler.py b/project/physics/PhysicsElementsHandler.py index da29ea3..793faf5 100644 --- a/project/physics/PhysicsElementsHandler.py +++ b/project/physics/PhysicsElementsHandler.py @@ -45,7 +45,6 @@ class PhysicsElementsHandler: def attempt_move(self, dt: float, sprite: DynamicSprite, colliders: list[StaticSprite], motion_steps: int) -> bool: total_motion = sprite.motion motion_step = ((total_motion[0] * dt) / motion_steps, (total_motion[1] * dt) / motion_steps) - print(motion_step) for i in range(motion_steps): sprite.reset_touches() diff --git a/project/sprite/DynamicSprite.py b/project/sprite/DynamicSprite.py index a3c7651..72740ad 100644 --- a/project/sprite/DynamicSprite.py +++ b/project/sprite/DynamicSprite.py @@ -39,12 +39,6 @@ class DynamicSprite(StaticSprite): def tick(self, dt: float): super().tick(dt) - # self.motion = ( - # self.motion[0] - self.deceleration_horizontal * dt, - # self.motion[1] + self.gravity * dt - # ) - # wrong implementation. Make deceleration_horizontal only until 0 is reached. multiply value with motion - deceleration_horizontal = 0 if abs(self.motion[0]) > 0: if self.touches_bounding[2]: