Mercurial > touhou
comparison pytouhou/game/enemy.py @ 108:2a03940deea3
Move everything graphical to pytouhou.opengl!
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Tue, 06 Sep 2011 00:26:13 +0200 |
parents | c7847bfed427 |
children | e93a7ed4f203 |
comparison
equal
deleted
inserted
replaced
107:5d9052b9a4e8 | 108:2a03940deea3 |
---|---|
182 max_y < -self.y)): | 182 max_y < -self.y)): |
183 return False | 183 return False |
184 return True | 184 return True |
185 | 185 |
186 | 186 |
187 def get_objects_by_texture(self, objects_by_texture): | |
188 if not self._sprite: | |
189 return | |
190 | |
191 sprite = self._sprite | |
192 sprite.update_vertices_uvs_colors() | |
193 | |
194 key = sprite.anm.first_name, sprite.anm.secondary_name | |
195 key = (key, sprite.blendfunc) | |
196 rec = objects_by_texture.setdefault(key, ([], [], [])) | |
197 vertices = ((x + self.x, y + self.y, z) for x, y, z in sprite._vertices) | |
198 rec[0].extend(vertices) | |
199 rec[1].extend(sprite._uvs) | |
200 rec[2].extend(sprite._colors) | |
201 | |
202 | |
203 def update(self): | 187 def update(self): |
204 x, y = self.x, self.y | 188 x, y = self.x, self.y |
205 if self.interpolator: | 189 if self.interpolator: |
206 self.interpolator.update(self._game_state.frame) | 190 self.interpolator.update(self._game_state.frame) |
207 x, y = self.interpolator.values | 191 x, y = self.interpolator.values |