# HG changeset patch # User Neil Muller # Date 1252144128 0 # Node ID 4a87bfa5cc638b034077140e39be1cb588add3b7 # Parent 9a6ac9c9ff466344a03d92f5fbc456239b7da25f Twiddle animation cycle diff -r 9a6ac9c9ff46 -r 4a87bfa5cc63 gamelib/animations.py --- a/gamelib/animations.py Sat Sep 05 09:46:29 2009 +0000 +++ b/gamelib/animations.py Sat Sep 05 09:48:48 2009 +0000 @@ -13,8 +13,9 @@ the sprites list. Ideally, animations should be quite short.""" - # In the current implementation, sequences longer than 3 frames + # In the current implementation, sequences longer than 4 frames # will cause issues as this will overrun the next move loop. + # (assuming all animations are triggered by the move loop, of course) def __init__(self, sequence, tile_pos): # Create the first frame diff -r 9a6ac9c9ff46 -r 4a87bfa5cc63 gamelib/engine.py --- a/gamelib/engine.py Sat Sep 05 09:46:29 2009 +0000 +++ b/gamelib/engine.py Sat Sep 05 09:48:48 2009 +0000 @@ -110,7 +110,7 @@ sound.play_sound("daybreak.ogg") # disable timer pygame.time.set_timer(MOVE_FOX_ID, 0) - pygame.time.set_timer(ANIM_ID, 50) + pygame.time.set_timer(ANIM_ID, SLOW_ANIM_SPEED) self.game.gameboard.advance_day() self.game.gameboard.clear_foxes() sound.background_music("daytime.ogg") @@ -181,6 +181,8 @@ # Timer aren't nessecairly ordered, so we make sure # we don't get a ANIM event until at least cycle after this pygame.time.set_timer(ANIM_ID, self.cycle_time) + # Ensure any outstanding animitions get cleaned up + self.game.gameboard.run_animations() self.cycle_count += 1 if self.cycle_count > constants.NIGHT_LENGTH: return pygame.event.post(START_DAY)