comparison pytouhou/game/bullet.py @ 107:5d9052b9a4e8

(almost) implement Cirno's freezing spellcard
author Thibaut Girka <thib@sitedethib.com>
date Mon, 05 Sep 2011 23:04:43 +0200
parents c7847bfed427
children 2a03940deea3
comparison
equal deleted inserted replaced
106:c7847bfed427 107:5d9052b9a4e8
108 rec[0].extend(vertices) 108 rec[0].extend(vertices)
109 rec[1].extend(sprite._uvs) 109 rec[1].extend(sprite._uvs)
110 rec[2].extend(sprite._colors) 110 rec[2].extend(sprite._colors)
111 111
112 112
113 def set_anim(self, anim_idx=None, sprite_idx_offset=None):
114 if anim_idx is not None:
115 self.anim_idx = anim_idx
116
117 if sprite_idx_offset is not None:
118 self.sprite_idx_offset = sprite_idx_offset
119
120 self._sprite = Sprite()
121 anm_wrapper = self._game_state.resource_loader.get_anm_wrapper(('etama3.anm',)) #TODO
122 self._anmrunner = ANMRunner(anm_wrapper, self.anim_idx,
123 self._sprite, self.sprite_idx_offset)
124
125
113 def update(self): 126 def update(self):
114 if not self._sprite or self._sprite._removed: 127 if not self._sprite or self._sprite._removed:
115 self._launched = True 128 self._launched = True
116 self._sprite = Sprite() 129 self.set_anim()
117 anm_wrapper = self._game_state.resource_loader.get_anm_wrapper(('etama3.anm',)) #TODO
118 self._anmrunner = ANMRunner(anm_wrapper, self.anim_idx,
119 self._sprite, self.sprite_idx_offset)
120 130
121 self._anmrunner.run_frame() 131 self._anmrunner.run_frame()
122 self._sprite.update(angle_base=self.angle) 132 self._sprite.update(angle_base=self.angle)
123 133
124 #TODO: flags 134 #TODO: flags