Mercurial > touhou
comparison pytouhou/game/player.py @ 181:184196480f59
Don’t use the useless eff00.anm and implement particles (grazing, death, and more).
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 23 Oct 2011 14:50:44 -0700 |
parents | 80a4c7ed43b3 |
children | 54eb6b254b7b |
comparison
equal
deleted
inserted
replaced
180:5a1533677a9a | 181:184196480f59 |
---|---|
75 | 75 |
76 | 76 |
77 def collide(self): | 77 def collide(self): |
78 if not self.state.invulnerable_time and not self.death_time and self.state.touchable: # Border Between Life and Death | 78 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 | 79 self.death_time = self._game.frame |
80 self._game.new_effect((self.state.x, self.state.y), 2) | 80 self._game.new_death((self.state.x, self.state.y), 2) |
81 | 81 |
82 | 82 |
83 def collect(self, item): | 83 def collect(self, item): |
84 #TODO | 84 #TODO |
85 self.state.score += item._item_type.score | 85 self.state.score += item._item_type.score |
129 self.state.touchable = False | 129 self.state.touchable = False |
130 self._game.drop_bonus(self.state.x, self.state.y, 2, end_pos=None) #TODO: find the formula | 130 self._game.drop_bonus(self.state.x, self.state.y, 2, end_pos=None) #TODO: find the formula |
131 for i in range(5): | 131 for i in range(5): |
132 self._game.drop_bonus(self.state.x, self.state.y, 0, end_pos=None) #TODO: find the formula | 132 self._game.drop_bonus(self.state.x, self.state.y, 0, end_pos=None) #TODO: find the formula |
133 self.state.lives -= 1 | 133 self.state.lives -= 1 |
134 for i in range(16): | |
135 self._game.new_particle((self.state.x, self.state.y), 0, 4., 256) | |
134 | 136 |
135 elif time == 7: | 137 elif time == 7: |
136 self._sprite.mirrored = False | 138 self._sprite.mirrored = False |
137 self._sprite.fade(24, 128, lambda x: x) | 139 self._sprite.fade(24, 128, lambda x: x) |
138 self._sprite.blendfunc = 1 | 140 self._sprite.blendfunc = 1 |