Orientate bullets.
authorSimon Cross <hodgestar@gmail.com>
Sat, 5 Mar 2016 22:07:15 +0000 (00:07 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sat, 5 Mar 2016 22:07:15 +0000 (00:07 +0200)
koperkapel/scenes/level.py
koperkapel/weapons.py

index ca20f732a75f2d5d2f88a22e062e69d60f768ab3..9c96b8dfeafe44124a526f00c36f88df89598be3 100644 (file)
@@ -195,13 +195,14 @@ class GameLevelScene(BaseLevelScene):
             self._level.remove_enemy(enemy)
             self._enemies.remove(enemy)
 
-    def _fire_bullet(self, bullet, pos, dp):
+    def _fire_bullet(self, bullet, pos, dp, angle):
         if len(self._bullets) >= 10:
             return
         bullet.game_pos = pos
         bullet.game_dp = dp
         bullet.dt = 0
         bullet.level_layer = self._level_layer
+        bullet.angle = angle
         self._bullets.add(bullet)
 
     def _check_for_bullet_hits(self):
@@ -227,7 +228,8 @@ class GameLevelScene(BaseLevelScene):
         weapon.play_sound()
         if weapon.bullet_range > 0:
             self._fire_bullet(
-                weapon.assemble_bullet(), self._player_pos, self._angle_dp)
+                weapon.assemble_bullet(), self._player_pos, self._angle_dp,
+                self._angle)
         else:
             # melee
             pos, dp = self._player_pos, self._angle_dp
index 80d1e93c5353b9a51c926d0bfad244f675fc8092..4f7bd6c87142c36b5942f23157f9e7b2d04784de 100644 (file)
@@ -3,7 +3,7 @@
 from pygame.surface import Surface
 from pygame.draw import circle
 from pgzero.loaders import images, sounds
-from .actors.anim import AnimatedSurfActor
+from .actors.animsurf import AnimatedSurfActor
 from .util import safepath