changeset 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 cadfc5e5ad7a
children 96c30ffd9b87
files pytouhou/game/bullet.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pytouhou/game/bullet.py
+++ b/pytouhou/game/bullet.py
@@ -137,6 +137,9 @@ class Bullet(object):
             length, angle = self.attributes[4:6]
             angle = self.angle if angle < -900.0 else angle #TODO: is that right?
             dx, dy = dx + cos(angle) * length, dy + sin(angle) * length
+            self.angle = sprite.angle = atan2(dy, dx)
+            if sprite.automatic_orientation:
+                sprite._changed = True
             self.delta = dx, dy
             if self.frame == frame: #TODO: include last frame, or not?
                 if count > 0: