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

Minor refactoring
author Thibaut Girka <thib@sitedethib.com>
date Sun, 04 Sep 2011 10:12:15 +0200
parents 1513f5626656
children ca571697ec83
comparison
equal deleted inserted replaced
89:1513f5626656 90:630e9045e851
92 return True 92 return True
93 93
94 94
95 def get_objects_by_texture(self, objects_by_texture): 95 def get_objects_by_texture(self, objects_by_texture):
96 sprite = self._sprite 96 sprite = self._sprite
97 sprite.update_vertices_uvs_colors()
97 key = sprite.anm.first_name, sprite.anm.secondary_name 98 key = sprite.anm.first_name, sprite.anm.secondary_name
98 key = (key, sprite.blendfunc) 99 key = (key, sprite.blendfunc)
99 if not key in objects_by_texture: 100 if not key in objects_by_texture:
100 objects_by_texture[key] = (0, [], [], []) 101 objects_by_texture[key] = (0, [], [], [])
101 vertices = ((x + self.x, y + self.y, z) for x, y, z in sprite._vertices) 102 vertices = ((x + self.x, y + self.y, z) for x, y, z in sprite._vertices)
112 self.anim_idx, self._sprite, self.sprite_idx_offset) 113 self.anim_idx, self._sprite, self.sprite_idx_offset)
113 114
114 if self._anmrunner and not self._anmrunner.run_frame(): 115 if self._anmrunner and not self._anmrunner.run_frame():
115 self._anmrunner = None 116 self._anmrunner = None
116 117
117 self._sprite.update() 118 self._sprite.update(angle_base=self.angle)
118 if self._sprite._changed: #TODO
119 angle = pi/2.-self.angle if self._sprite.automatic_orientation else 0.
120 self._sprite.update_vertices_uvs_colors(angle_base=angle)
121 119
122 #TODO: flags 120 #TODO: flags
123 x, y = self.x, self.y 121 x, y = self.x, self.y
124 122
125 if self.flags & 16: 123 if self.flags & 16: