Mercurial > touhou
comparison pytouhou/game/bullet.py @ 145:30338dc33a7b
Fix bullet orientation in some cases (Meiling's last spellcard)
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Mon, 03 Oct 2011 22:20:03 +0200 |
parents | c7f0fd9d2145 |
children | 3673d55a8448 |
comparison
equal
deleted
inserted
replaced
144:cadfc5e5ad7a | 145:30338dc33a7b |
---|---|
135 if self.flags & 16: | 135 if self.flags & 16: |
136 frame, count = self.attributes[0:2] | 136 frame, count = self.attributes[0:2] |
137 length, angle = self.attributes[4:6] | 137 length, angle = self.attributes[4:6] |
138 angle = self.angle if angle < -900.0 else angle #TODO: is that right? | 138 angle = self.angle if angle < -900.0 else angle #TODO: is that right? |
139 dx, dy = dx + cos(angle) * length, dy + sin(angle) * length | 139 dx, dy = dx + cos(angle) * length, dy + sin(angle) * length |
140 self.angle = sprite.angle = atan2(dy, dx) | |
141 if sprite.automatic_orientation: | |
142 sprite._changed = True | |
140 self.delta = dx, dy | 143 self.delta = dx, dy |
141 if self.frame == frame: #TODO: include last frame, or not? | 144 if self.frame == frame: #TODO: include last frame, or not? |
142 if count > 0: | 145 if count > 0: |
143 self.attributes[1] -= 1 | 146 self.attributes[1] -= 1 |
144 self.frame = 0 | 147 self.frame = 0 |