comparison pytouhou/game/laser.py @ 433:1222341ea22c

Always run the first frame of an ANMRunner.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 11 Aug 2013 14:23:50 +0200
parents c9433188ffdb
children b9d2db93972f
comparison
equal deleted inserted replaced
432:d4874ebaa06e 433:1222341ea22c
98 lt = self._laser_type 98 lt = self._laser_type
99 self.sprite = Sprite() 99 self.sprite = Sprite()
100 self.sprite.angle = self.angle 100 self.sprite.angle = self.angle
101 self.anmrunner = ANMRunner(lt.anm, lt.anim_index, 101 self.anmrunner = ANMRunner(lt.anm, lt.anim_index,
102 self.sprite, self.sprite_idx_offset) 102 self.sprite, self.sprite_idx_offset)
103 self.anmrunner.run_frame()
104 103
105 104
106 def _check_collision(self, point, border_size): 105 def _check_collision(self, point, border_size):
107 x, y = point[0] - self.base_pos[0], point[1] - self.base_pos[1] 106 x, y = point[0] - self.base_pos[0], point[1] - self.base_pos[1]
108 dx, dy = cos(self.angle), sin(self.angle) 107 dx, dy = cos(self.angle), sin(self.angle)
236 lt = self._laser_type 235 lt = self._laser_type
237 self.sprite = Sprite() 236 self.sprite = Sprite()
238 self.anmrunner = ANMRunner(lt.anm, lt.anim_index, 237 self.anmrunner = ANMRunner(lt.anm, lt.anim_index,
239 self.sprite, self.sprite_idx_offset) 238 self.sprite, self.sprite_idx_offset)
240 #self.sprite.blendfunc = 1 #XXX 239 #self.sprite.blendfunc = 1 #XXX
241 self.anmrunner.run_frame()
242 240
243 241
244 def cancel(self): 242 def cancel(self):
245 self.anmrunner.interrupt(1) 243 self.anmrunner.interrupt(1)
246 244