Mercurial > touhou
comparison pytouhou/game/player.py @ 173:35d850502d1f
Move effects where they should be.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 21 Oct 2011 09:37:23 -0700 |
parents | ea2ad94c33a0 |
children | 5dc243bcf312 |
comparison
equal
deleted
inserted
replaced
172:ea2ad94c33a0 | 173:35d850502d1f |
---|---|
12 ## GNU General Public License for more details. | 12 ## GNU General Public License for more details. |
13 ## | 13 ## |
14 | 14 |
15 | 15 |
16 from pytouhou.game.sprite import Sprite | 16 from pytouhou.game.sprite import Sprite |
17 from pytouhou.game.enemy import Effect | |
18 from pytouhou.vm.anmrunner import ANMRunner | 17 from pytouhou.vm.anmrunner import ANMRunner |
19 | 18 |
20 | 19 |
21 SQ2 = 2. ** 0.5 / 2. | 20 SQ2 = 2. ** 0.5 / 2. |
22 | 21 |
75 | 74 |
76 | 75 |
77 def collide(self): | 76 def collide(self): |
78 if not self.state.invulnerable_time and not self.death_time and self.state.touchable: # Border Between Life and Death | 77 if not self.state.invulnerable_time and not self.death_time and self.state.touchable: # Border Between Life and Death |
79 self.death_time = self._game.frame | 78 self.death_time = self._game.frame |
80 eff00 = self._game.resource_loader.get_anm_wrapper(('eff00.anm',)) | 79 self._game.new_effect((self.state.x, self.state.y), 2) |
81 self._game.effects.append(Effect((self.state.x, self.state.y), 2, eff00)) | |
82 | 80 |
83 | 81 |
84 def collect(self, item): | 82 def collect(self, item): |
85 #TODO | 83 #TODO |
86 self.state.score += item._item_type.score | 84 self.state.score += item._item_type.score |