Mercurial > touhou
comparison pytouhou/game/bullet.py @ 120:4300a832f033
Small refactoring and massive performance improvement
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Thu, 08 Sep 2011 12:46:05 +0200 |
parents | 92772413b5a6 |
children | 174324a4da51 |
comparison
equal
deleted
inserted
replaced
119:fad7b44cebf2 | 120:4300a832f033 |
---|---|
114 def update(self): | 114 def update(self): |
115 if not self._sprite or self._sprite._removed: | 115 if not self._sprite or self._sprite._removed: |
116 self._launched = True | 116 self._launched = True |
117 self.set_anim() | 117 self.set_anim() |
118 | 118 |
119 self._anmrunner.run_frame() | 119 sprite = self._sprite |
120 self._sprite.update(angle_base=self.angle) | 120 |
121 if self._anmrunner is not None and not self._anmrunner.run_frame(): | |
122 self._anmrunner = None | |
123 if sprite.automatic_orientation and sprite.angle != self.angle: | |
124 sprite.angle = self.angle | |
125 sprite._changed = True | |
121 | 126 |
122 #TODO: flags | 127 #TODO: flags |
123 x, y = self.x, self.y | 128 x, y = self.x, self.y |
124 | 129 |
125 if self.flags & 16: | 130 if self.flags & 16: |