X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=koperkapel%2Fscenes%2Flevel.py;h=66eccf0ed167e77b655b106eb329ba20cf91812d;hb=60f5cbeec5d348b843fca045a9af04432eaeafb2;hp=ca20f732a75f2d5d2f88a22e062e69d60f768ab3;hpb=8f2e7a53419fd646dad02ff5f099db5bb5c4d80e;p=koperkapel.git diff --git a/koperkapel/scenes/level.py b/koperkapel/scenes/level.py index ca20f73..66eccf0 100644 --- a/koperkapel/scenes/level.py +++ b/koperkapel/scenes/level.py @@ -98,7 +98,7 @@ class GameLevelScene(BaseLevelScene): self._friends = self.actors.add_layer("friendly roaches", level=9) self._items = self.actors.add_layer("items", level=9) self._generators = self.actors.add_layer("enemy generators", level=8) - self._enemies = self.actors.add_layer("enemies", level=7) + self._enemies = self.actors.add_layer("enemies", level=11) self._vehicle = Vehicle.current(world) self._mode = 'walk' self._angle = 0 # up @@ -363,8 +363,11 @@ class GameLevelScene(BaseLevelScene): def on_key_down(self, key, mod, unicode): x, y = self._player_pos if key in (keys.DOWN, keys.UP, keys.LEFT, keys.RIGHT): + firing = (keys.X in self._held_keys) self._held_keys.clear() self._held_keys.add(key) + if firing: + self._held_keys.add(keys.X) # We do this so pressing the key has an instant effect, and can # then be held self._last_key_down = self._key_rate + 0.01