diff --git a/project/main.py b/project/main.py index 20a4d25..8e3f3d8 100644 --- a/project/main.py +++ b/project/main.py @@ -128,7 +128,7 @@ elif what_to_run == 'level': pygame.display.set_caption("PM GAME") clock = pygame.time.Clock() - frame_rate = 120 + frame_rate = 30 spritesheet_manager = SpritesheetManager("data/sprites", "data/sprites/sprites.json") sprite_manager = SpriteManager() diff --git a/project/physics/PhysicsElementsHandler.py b/project/physics/PhysicsElementsHandler.py index cab0b2f..2f38802 100644 --- a/project/physics/PhysicsElementsHandler.py +++ b/project/physics/PhysicsElementsHandler.py @@ -58,8 +58,8 @@ class PhysicsElementsHandler: skip_sprites = [] for sprite in sorted_dynamic_sprites: - if sprite.last_effective_motion[1] == 0 and sprite.last_effective_motion[0] == 0 \ - and random.randint(0, 100) > 50: + if sprite.last_effective_motion == (0, 0) and random.randint(0, 100) > 50\ + and not sprite.id == 'player': skip_sprites.append(sprite) continue sorted_dynamic_sprites = [sprite for sprite in sorted_dynamic_sprites if sprite not in skip_sprites] diff --git a/project/physics/sprites/PlayerSprite.py b/project/physics/sprites/PlayerSprite.py index dce21a7..652f9e9 100644 --- a/project/physics/sprites/PlayerSprite.py +++ b/project/physics/sprites/PlayerSprite.py @@ -20,6 +20,8 @@ class PlayerSprite(DynamicSprite): self.max_motion_horizontal_via_input = 5 + self.id = 'player' + def tick(self, tick_data: TickData): super().tick(tick_data)