From ef6ce5118cb6a3338086ceb7b337de69ce82189a Mon Sep 17 00:00:00 2001 From: Nick Dyer Date: Sat, 5 Jun 2021 22:10:47 -0400 Subject: [PATCH] fixed mistake in stage calulation, age now ticks with time --- pocket_friends/game_files/game.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pocket_friends/game_files/game.py b/pocket_friends/game_files/game.py index d1ff181..427e131 100644 --- a/pocket_friends/game_files/game.py +++ b/pocket_friends/game_files/game.py @@ -92,7 +92,7 @@ class PlaygroundFriend(pygame.sprite.Sprite): self.direction = 0 # Draw the correct bloop depending on the stage - if self.evolution_stage != 0: + if self.evolution_stage == 0: image_directory = script_dir + '/resources/images/bloops/{0}/egg_images'.format(self.bloop) elif self.evolution_stage == 1: image_directory = script_dir + '/resources/images/bloops/{0}/baby_images'.format(self.bloop) @@ -120,7 +120,7 @@ class PlaygroundFriend(pygame.sprite.Sprite): self.animation_frames = game_fps / animation_fps self.current_frame = 0 - def update_frame_dependent(self): + def update(self): """ Takes the images loaded and animates it, spacing it out equally for the framerate. """ @@ -135,7 +135,7 @@ class PlaygroundFriend(pygame.sprite.Sprite): self.image = self.images[self.index] # Move the sprite so long as it is not in the egg stage - if self.evolution_stage == 0: + if self.evolution_stage != 0: if self.rect.x < margins: self.direction = 1 elif self.rect.x > game_res - margins - self.rect.width: @@ -146,11 +146,7 @@ class PlaygroundFriend(pygame.sprite.Sprite): else: self.rect.x += movement_amount - def update(self): - """ - Updates the sprite object. - """ - self.update_frame_dependent() + self.age += 1 class SelectionEgg(pygame.sprite.Sprite):