Mercurial > touhou
comparison pytouhou/game/bullet.pyx @ 328:56523a16db1d
Fix some replay synchronization issues and update the TODO.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Thu, 21 Jun 2012 19:59:41 +0200 |
parents | 0f88ae611d37 |
children | 2350147cf043 |
comparison
equal
deleted
inserted
replaced
327:13201d90bb22 | 328:56523a16db1d |
---|---|
124 def launch(Bullet self): | 124 def launch(Bullet self): |
125 self._state = LAUNCHED | 125 self._state = LAUNCHED |
126 self.frame = 0 | 126 self.frame = 0 |
127 self.set_anim() | 127 self.set_anim() |
128 self.dx, self.dy = cos(self.angle) * self.speed, sin(self.angle) * self.speed | 128 self.dx, self.dy = cos(self.angle) * self.speed, sin(self.angle) * self.speed |
129 | |
129 if self.flags & 1: | 130 if self.flags & 1: |
130 self.speed_interpolator = Interpolator((self.speed + 5.,), 0, | 131 self.speed_interpolator = Interpolator((self.speed + 5.,), 0, |
131 (self.speed,), 16) | 132 (self.speed,), 16) |
132 | 133 |
133 | 134 |
134 def collide(Bullet self): | 135 def collide(Bullet self): |
135 self.cancel() | 136 self.cancel() |
137 self._game.new_particle((self.x, self.y), 1, 3., 256) #TODO: find the real size. | |
136 | 138 |
137 | 139 |
138 def cancel(Bullet self): | 140 def cancel(Bullet self): |
139 # Cancel animation | 141 # Cancel animation |
140 bt = self._bullet_type | 142 bt = self._bullet_type |