comparison pytouhou/game/enemy.pyx @ 590:e15672733c93

Switch to Python 3.x instead of 2.7.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 30 Sep 2014 17:14:24 +0200
parents a0fa01cd9f70
children 3c2f96f1d715
comparison
equal deleted inserted replaced
589:0768122da817 590:e15672733c93
194 launch_angle -= angle * (bullets_per_shot - 1) / 2. 194 launch_angle -= angle * (bullets_per_shot - 1) / 2.
195 195
196 bullets = self._game.bullets 196 bullets = self._game.bullets
197 nb_bullets_max = self._game.nb_bullets_max 197 nb_bullets_max = self._game.nb_bullets_max
198 198
199 for shot_nb in xrange(number_of_shots): 199 for shot_nb in range(number_of_shots):
200 shot_speed = speed if shot_nb == 0 else speed + (speed2 - speed) * float(shot_nb) / float(number_of_shots) 200 shot_speed = speed if shot_nb == 0 else speed + (speed2 - speed) * float(shot_nb) / float(number_of_shots)
201 bullet_angle = launch_angle 201 bullet_angle = launch_angle
202 if type_ in (69, 70, 71, 74): 202 if type_ in (69, 70, 71, 74):
203 launch_angle += angle 203 launch_angle += angle
204 for bullet_nb in xrange(bullets_per_shot): 204 for bullet_nb in range(bullets_per_shot):
205 if nb_bullets_max is not None and len(bullets) == nb_bullets_max: 205 if nb_bullets_max is not None and len(bullets) == nb_bullets_max:
206 break 206 break
207 207
208 if type_ == 75: # 102h.exe@0x4138cf 208 if type_ == 75: # 102h.exe@0x4138cf
209 bullet_angle = self._game.prng.rand_double() * (launch_angle - angle) + angle 209 bullet_angle = self._game.prng.rand_double() * (launch_angle - angle) + angle
270 cdef void drop_particles(self, long number, long color): 270 cdef void drop_particles(self, long number, long color):
271 if color == 0: 271 if color == 0:
272 if self._game.stage in [1, 2, 7]: 272 if self._game.stage in [1, 2, 7]:
273 color = 3 273 color = 3
274 color += 9 274 color += 9
275 for i in xrange(number): 275 for i in range(number):
276 self._game.new_particle((self.x, self.y), color, 256) #TODO: find the real size. 276 self._game.new_particle((self.x, self.y), color, 256) #TODO: find the real size.
277 277
278 278
279 cpdef set_aux_anm(self, long number, long index): 279 cpdef set_aux_anm(self, long number, long index):
280 entry = 0 if index in self._anms[0].scripts else 1 280 entry = 0 if index in self._anms[0].scripts else 1