comparison pytouhou/game/bullet.pyx @ 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
80 self.dx, self.dy = self.dx * launch_mult, self.dy * launch_mult 80 self.dx, self.dy = self.dx * launch_mult, self.dy * launch_mult
81 self.sprite = Sprite() 81 self.sprite = Sprite()
82 self.anmrunner = ANMRunner(bullet_type.anm, 82 self.anmrunner = ANMRunner(bullet_type.anm,
83 index, self.sprite, 83 index, self.sprite,
84 bullet_type.launch_anim_offsets[sprite_idx_offset]) 84 bullet_type.launch_anim_offsets[sprite_idx_offset])
85 self.anmrunner.run_frame()
86 else: 85 else:
87 self.launch() 86 self.launch()
88 87
89 if self.player_bullet: 88 if self.player_bullet:
90 self.sprite.angle = angle - pi 89 self.sprite.angle = angle - pi
117 self.sprite.angle = self.angle - pi 116 self.sprite.angle = self.angle - pi
118 else: 117 else:
119 self.sprite.angle = self.angle 118 self.sprite.angle = self.angle
120 self.anmrunner = ANMRunner(bt.anm, bt.anim_index, 119 self.anmrunner = ANMRunner(bt.anm, bt.anim_index,
121 self.sprite, self.sprite_idx_offset) 120 self.sprite, self.sprite_idx_offset)
122 self.anmrunner.run_frame()
123 121
124 122
125 def launch(self): 123 def launch(self):
126 self.state = LAUNCHED 124 self.state = LAUNCHED
127 self.frame = 0 125 self.frame = 0
146 self.sprite.angle = self.angle - pi 144 self.sprite.angle = self.angle - pi
147 else: 145 else:
148 self.sprite.angle = self.angle 146 self.sprite.angle = self.angle
149 self.anmrunner = ANMRunner(bt.anm, bt.cancel_anim_index, 147 self.anmrunner = ANMRunner(bt.anm, bt.cancel_anim_index,
150 self.sprite, bt.launch_anim_offsets[self.sprite_idx_offset]) 148 self.sprite, bt.launch_anim_offsets[self.sprite_idx_offset])
151 self.anmrunner.run_frame()
152 self.dx, self.dy = self.dx / 2., self.dy / 2. 149 self.dx, self.dy = self.dx / 2., self.dy / 2.
153 150
154 self.state = CANCELLED 151 self.state = CANCELLED
155 152
156 153