changeset 109:e93a7ed4f203

Implement bullet_launch_offset thing
author Thibaut Girka <thib@sitedethib.com>
date Tue, 06 Sep 2011 13:54:40 +0200
parents 2a03940deea3
children 3ac41b966fed
files pytouhou/game/enemy.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pytouhou/game/enemy.py
+++ b/pytouhou/game/enemy.py
@@ -88,6 +88,9 @@ class Enemy(object):
         (type_, anim, sprite_idx_offset, bullets_per_shot, number_of_shots,
          speed, speed2, launch_angle, angle, flags) = self.bullet_attributes
 
+        ox, oy = self.bullet_launch_offset
+        launch_pos = self.x + ox, self.y + oy
+
         if speed2 < 0.3:
             speed2 = 0.3
 
@@ -113,8 +116,7 @@ class Enemy(object):
                 if type_ == 75: # 102.h@0x4138cf
                     bullet_angle = self._game_state.prng.rand_double() * (launch_angle - angle) + angle
                     shot_speed = self._game_state.prng.rand_double() * (speed - speed2) + speed2
-                bullets.append(Bullet((self.x, self.y),
-                                      anim, sprite_idx_offset,
+                bullets.append(Bullet(launch_pos, anim, sprite_idx_offset,
                                       bullet_angle, shot_speed,
                                       self.extended_bullet_attributes,
                                       flags, player, self._game_state))