Mercurial > touhou
diff pytouhou/game/player.py @ 152:86807b8a63bd
Add collisions with enemies and items.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 09 Oct 2011 15:32:43 -0700 |
parents | c7f0fd9d2145 |
children | ebfd328e700c |
line wrap: on
line diff
--- a/pytouhou/game/player.py +++ b/pytouhou/game/player.py @@ -69,6 +69,14 @@ class Player(object): self._anmrunner.run_frame() + def die(self): + self.state.lives -= 1 + self.state.x = 192.0 + self.state.y = 384.0 + #TODO: animation + #TODO: set invulnerability. + + def update(self, keystate): try: dx, dy = {16: (0.0, -1.0), 32: (0.0, 1.0), 64: (-1.0, 0.0), 128: (1.0, 0.0),