comparison pytouhou/game/bullet.py @ 127:81e05aed8db5

Fix bullets
author Thibaut Girka <thib@sitedethib.com>
date Sat, 10 Sep 2011 16:13:54 +0200
parents f06e96dbed4e
children c7f0fd9d2145
comparison
equal deleted inserted replaced
126:9d7129ee2c4f 127:81e05aed8db5
107 107
108 def update(self): 108 def update(self):
109 dx, dy = self.launch_delta 109 dx, dy = self.launch_delta
110 self.x += dx 110 self.x += dx
111 self.y += dy 111 self.y += dy
112
113 self.frame += 1
114 112
115 if not self._anmrunner.run_frame(): 113 if not self._anmrunner.run_frame():
116 self.launch() 114 self.launch()
117 115
118 116
154 self.delta = dx, dy 152 self.delta = dx, dy
155 sprite.angle = self.angle 153 sprite.angle = self.angle
156 if sprite.automatic_orientation: 154 if sprite.automatic_orientation:
157 sprite._changed = True 155 sprite._changed = True
158 if self.frame % frame == 0: 156 if self.frame % frame == 0:
159 if count > 0: 157 if count >= 0:
160 self.attributes[1] -= 1 158 self.attributes[1] -= 1
161 else: 159 else:
162 self.flags ^= 32 160 self.flags ^= 32
163 elif self.flags & 448: 161 elif self.flags & 448:
164 #TODO: check 162 #TODO: check
181 self.delta = dx, dy 179 self.delta = dx, dy
182 sprite.angle = self.angle 180 sprite.angle = self.angle
183 if sprite.automatic_orientation: 181 if sprite.automatic_orientation:
184 sprite._changed = True 182 sprite._changed = True
185 183
186 if count > 0: 184 if count >= 0:
187 self.speed_interpolator = Interpolator((self.speed,), self.frame, 185 self.speed_interpolator = Interpolator((self.speed,), self.frame,
188 (0.,), self.frame + frame - 1) 186 (0.,), self.frame + frame - 1)
189 else: 187 else:
190 self.flags &= ~448 188 self.flags &= ~448
191 189