comparison pytouhou/game/effect.pyx @ 509:292fea5c584e

Some more type optimisations.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Mon, 25 Nov 2013 19:12:56 +0100
parents 78e1c3864e73
children e35bef07290d
comparison
equal deleted inserted replaced
508:1bc014f9d572 509:292fea5c584e
41 Effect.__init__(self, pos, index, anm) 41 Effect.__init__(self, pos, index, anm)
42 42
43 self.frame = 0 43 self.frame = 0
44 self.duration = duration 44 self.duration = duration
45 45
46 random_pos = (self.x + amp * <double>game.prng.rand_double() - amp / 2, 46 random_pos = (self.x + amp * game.prng.rand_double() - amp / 2,
47 self.y + amp * <double>game.prng.rand_double() - amp / 2) 47 self.y + amp * game.prng.rand_double() - amp / 2)
48 48
49 if not reverse: 49 if not reverse:
50 self.pos_interpolator = Interpolator((self.x, self.y), 0, 50 self.pos_interpolator = Interpolator((self.x, self.y), 0,
51 random_pos, duration, formula=(lambda x: 2. * x - x ** 2)) 51 random_pos, duration, formula=(lambda x: 2. * x - x ** 2))
52 else: 52 else: