Skip to content

Commit

Permalink
Stop wings from flapping
Browse files Browse the repository at this point in the history
  • Loading branch information
sourabhv committed Jun 18, 2023
1 parent 4960be1 commit 948b608
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/entities/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def set_mode(self, mode: PlayerMode) -> None:
elif mode == PlayerMode.SHM:
self.reset_vals_shm()
elif mode == PlayerMode.CRASH:
self.stop_wings()
self.config.sounds.hit.play()
if self.crash_entity == "pipe":
self.config.sounds.die.play()
Expand Down Expand Up @@ -130,6 +131,9 @@ def draw_player(self) -> None:
rotated_rect = rotated_image.get_rect(center=self.rect.center)
self.config.screen.blit(rotated_image, rotated_rect)

def stop_wings(self) -> None:
self.img_gen = cycle([self.img_idx])

def flap(self) -> None:
if self.y > self.min_y:
self.vel_y = self.flap_acc
Expand Down

0 comments on commit 948b608

Please sign in to comment.