comparison pytouhou/game/enemy.py @ 184:54eb6b254b7b

When touched, drop the items at the right place, and add precisions about particles.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 26 Oct 2011 02:38:50 -0700
parents b6d7ce644f34
children dbe6b7b2d3fc
comparison
equal deleted inserted replaced
183:b6d7ce644f34 184:54eb6b254b7b
167 167
168 168
169 def on_attack(self, bullet): 169 def on_attack(self, bullet):
170 if self.damageable: 170 if self.damageable:
171 self.life -= bullet._bullet_type.damage 171 self.life -= bullet._bullet_type.damage
172 self._game.new_particle((self.x, self.y), 1, 3., 192) #TODO: find the real size and range.
172 173
173 174
174 def on_collide(self): 175 def on_collide(self):
175 self.life -= 80 # found experimentally 176 self.life -= 80 # found experimentally
176 177
178 def die_anim(self): 179 def die_anim(self):
179 self._game.new_death((self.x, self.y), self.death_anim) 180 self._game.new_death((self.x, self.y), self.death_anim)
180 #TODO: 8 white particles are used only in stage 3 to 6, 181 #TODO: 8 white particles are used only in stage 3 to 6,
181 # in other stages they are 2 red and 6 blue. 182 # in other stages they are 2 red and 6 blue.
182 for i in range(8): 183 for i in range(8):
183 self._game.new_particle((self.x, self.y), 0, 3., 192) 184 self._game.new_particle((self.x, self.y), 0, 3., 192) #TODO: find the real size and range.
184 185
185 186
186 def set_pos(self, x, y, z): 187 def set_pos(self, x, y, z):
187 self.x, self.y = x, y 188 self.x, self.y = x, y
188 self.interpolator = Interpolator((x, y)) 189 self.interpolator = Interpolator((x, y))