Mercurial > touhou
comparison pytouhou/game/player.py @ 156:ebfd328e700c
Rename a few functions, move a few things around...
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Mon, 10 Oct 2011 18:34:36 +0200 |
parents | 86807b8a63bd |
children | 7769ce7be03c |
comparison
equal
deleted
inserted
replaced
155:ed86bec43b93 | 156:ebfd328e700c |
---|---|
67 self._sprite = Sprite() | 67 self._sprite = Sprite() |
68 self._anmrunner = ANMRunner(self.anm_wrapper, index, self._sprite) | 68 self._anmrunner = ANMRunner(self.anm_wrapper, index, self._sprite) |
69 self._anmrunner.run_frame() | 69 self._anmrunner.run_frame() |
70 | 70 |
71 | 71 |
72 def die(self): | 72 def collide(self): |
73 self.state.lives -= 1 | 73 self.state.lives -= 1 |
74 self.state.x = 192.0 | 74 self.state.x = 192.0 |
75 self.state.y = 384.0 | 75 self.state.y = 384.0 |
76 #TODO: animation | 76 #TODO: animation |
77 #TODO: set invulnerability. | 77 #TODO: set invulnerability. |
78 | |
79 | |
80 def collect(self, item): | |
81 #TODO | |
82 self.state.score += item._item_type.score | |
83 item._removed = True | |
78 | 84 |
79 | 85 |
80 def update(self, keystate): | 86 def update(self, keystate): |
81 try: | 87 try: |
82 dx, dy = {16: (0.0, -1.0), 32: (0.0, 1.0), 64: (-1.0, 0.0), 128: (1.0, 0.0), | 88 dx, dy = {16: (0.0, -1.0), 32: (0.0, 1.0), 64: (-1.0, 0.0), 128: (1.0, 0.0), |