comparison pytouhou/game/bullet.pyx @ 314:0f88ae611d37

Fix Sakuya's daggers in stage 6.
author Thibaut Girka <thib@sitedethib.com>
date Wed, 14 Mar 2012 19:27:39 +0100
parents f3099ebf4f61
children 56523a16db1d
comparison
equal deleted inserted replaced
313:2ba2462afc70 314:0f88ae611d37
209 angle, speed = self.attributes[4:6] 209 angle, speed = self.attributes[4:6]
210 if self.frame % frame == 0: 210 if self.frame % frame == 0:
211 count = count - 1 211 count = count - 1
212 212
213 if self.frame != 0: 213 if self.frame != 0:
214 self.speed = speed 214 self.speed = self.speed if speed < -900 else speed
215 215
216 if self.flags & 64: 216 if self.flags & 64:
217 self.angle += angle 217 self.angle += angle
218 elif self.flags & 128: 218 elif self.flags & 128:
219 self.angle = atan2(self.target.y - self.y, 219 self.angle = atan2(self.target.y - self.y,
237 237
238 # Common updates 238 # Common updates
239 239
240 if self.speed_interpolator: 240 if self.speed_interpolator:
241 self.speed_interpolator.update(self.frame) 241 self.speed_interpolator.update(self.frame)
242 self.speed, = self.speed_interpolator.values 242 speed, = self.speed_interpolator.values
243 self.dx = cos(self.angle) * self.speed 243 self.dx = cos(self.angle) * speed
244 self.dy = sin(self.angle) * self.speed 244 self.dy = sin(self.angle) * speed
245 245
246 self.x += self.dx 246 self.x += self.dx
247 self.y += self.dy 247 self.y += self.dy
248 248
249 self.frame += 1 249 self.frame += 1