From: Simon Cross Date: Sat, 5 Mar 2016 22:07:15 +0000 (+0200) Subject: Orientate bullets. X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=6dd254908eb2a256c9d49b936a22caa4f1fcb140;p=koperkapel.git Orientate bullets. --- diff --git a/koperkapel/scenes/level.py b/koperkapel/scenes/level.py index ca20f73..9c96b8d 100644 --- a/koperkapel/scenes/level.py +++ b/koperkapel/scenes/level.py @@ -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 diff --git a/koperkapel/weapons.py b/koperkapel/weapons.py index 80d1e93..4f7bd6c 100644 --- a/koperkapel/weapons.py +++ b/koperkapel/weapons.py @@ -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