comparison pytouhou/game/enemymanager.py @ 90:630e9045e851

Minor refactoring
author Thibaut Girka <thib@sitedethib.com>
date Sun, 04 Sep 2011 10:12:15 +0200
parents 3804f07d3b0e
children d167280a82fc
comparison
equal deleted inserted replaced
89:1513f5626656 90:630e9045e851
178 bullet.get_objects_by_texture(objects_by_texture) 178 bullet.get_objects_by_texture(objects_by_texture)
179 179
180 if not self._sprite: 180 if not self._sprite:
181 return 181 return
182 182
183 self._sprite.update_vertices_uvs_colors()
184
183 key = self._sprite.anm.first_name, self._sprite.anm.secondary_name 185 key = self._sprite.anm.first_name, self._sprite.anm.secondary_name
184 key = (key, self._sprite.blendfunc) 186 key = (key, self._sprite.blendfunc)
185 if not key in objects_by_texture: 187 if not key in objects_by_texture:
186 objects_by_texture[key] = (0, [], [], []) 188 objects_by_texture[key] = (0, [], [], [])
187 vertices = tuple((x + self.x, y + self.y, z) for x, y, z in self._sprite._vertices) 189 vertices = tuple((x + self.x, y + self.y, z) for x, y, z in self._sprite._vertices)
242 244
243 if self._sprite: 245 if self._sprite:
244 if self._sprite._removed: 246 if self._sprite._removed:
245 self._sprite = None 247 self._sprite = None
246 else: 248 else:
247 self._sprite.update() 249 self._sprite.update(angle_base=self.angle,
248 if self._sprite._changed or self.automatic_orientation: 250 force_rotation=self.automatic_orientation)
249 angle_base = self.angle if self.automatic_orientation else 0.
250 self._sprite.update_vertices_uvs_colors(angle_base=angle_base)
251 251
252 252
253 if self.bullet_launch_interval != 0: 253 if self.bullet_launch_interval != 0:
254 self.bullet_launch_timer += 1 254 self.bullet_launch_timer += 1
255 if self.bullet_launch_timer == self.bullet_launch_interval: 255 if self.bullet_launch_timer == self.bullet_launch_interval: