Mercurial > rinkhals
comparison gamelib/animal.py @ 380:1586eccdefe4
Ripped out legacy animation infrastructure in favour of layered sprites.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sun, 25 Oct 2009 10:56:01 +0000 |
parents | 71f5897ac5ef |
children | 463802281182 |
comparison
equal
deleted
inserted
replaced
379:a8a7ada27fa2 | 380:1586eccdefe4 |
---|---|
43 def die(self, gameboard): | 43 def die(self, gameboard): |
44 """Play death animation, noises, whatever.""" | 44 """Play death animation, noises, whatever.""" |
45 if hasattr(self, 'DEATH_SOUND'): | 45 if hasattr(self, 'DEATH_SOUND'): |
46 sound.play_sound(self.DEATH_SOUND) | 46 sound.play_sound(self.DEATH_SOUND) |
47 if hasattr(self, 'DEATH_ANIMATION'): | 47 if hasattr(self, 'DEATH_ANIMATION'): |
48 gameboard.animations.append(self.DEATH_ANIMATION(self.pos)) | 48 self.DEATH_ANIMATION(gameboard.tv, self.pos.to_tuple()) |
49 self._game_death(gameboard) | 49 self._game_death(gameboard) |
50 | 50 |
51 def _game_death(self, gameboard): | 51 def _game_death(self, gameboard): |
52 # Call appropriate gameboard cleanup here. | 52 # Call appropriate gameboard cleanup here. |
53 pass | 53 pass |
472 | 472 |
473 def _dig(self, gameboard, dig_pos): | 473 def _dig(self, gameboard, dig_pos): |
474 """Setup dig parameters, to be overridden if needed""" | 474 """Setup dig parameters, to be overridden if needed""" |
475 self.tick = 0 # Costs us nothing to go through a fence. | 475 self.tick = 0 # Costs us nothing to go through a fence. |
476 self.dig_pos = dig_pos | 476 self.dig_pos = dig_pos |
477 gameboard.animations.append(self.DIG_ANIMATION(dig_pos)) | 477 self.DIG_ANIMATION(gameboard.tv, dig_pos.to_tuple()) |
478 self._make_hole(gameboard) | 478 self._make_hole(gameboard) |
479 | 479 |
480 class GreedyFox(Fox): | 480 class GreedyFox(Fox): |
481 """Greedy foxes eat more chickens""" | 481 """Greedy foxes eat more chickens""" |
482 | 482 |