Merge branch 'master' of ctpug.org.za:koperkapel
authorSimon Cross <hodgestar@gmail.com>
Sat, 5 Mar 2016 19:05:32 +0000 (21:05 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sat, 5 Mar 2016 19:05:32 +0000 (21:05 +0200)
1  2 
koperkapel/scenes/level.py

index 735ed28dadde623962fe417b45920b3b9aeba8d4,606a0db038b1dae954e1d51d57e6826c862ab24b..e26d11dbe5e1b8858be77d3d8ef8b2f2186afdba
@@@ -211,23 -230,18 +230,25 @@@ class GameLevelScene(BaseLevelScene)
                  self._mode = 'walk'
          elif self._level.is_keypad(x, y):
              self._level.press_keypad(x, y, self._roaches)
 -        elif self._level.is_on_friend(x, y):
 -            friend = self._level.remove_friend(x, y)
 +        elif self._level.friend_at(x, y):
 +            friend = self._level.friend_at(x, y)
 +            self._level.remove_friend(friend)
              self._friends.remove(friend)
              self._add_roach()
 +        elif self._level.item_at(x, y):
 +            item = self._level.item_at(x, y)
 +            self._level.remove_item(item)
 +            self._items.remove(item)
          elif self._level.is_exit(x, y):
              next_level = self._level.get_exit_level()
 -            return [WorldEvent('set', {'level.name': next_level}), ChangeSceneEvent(GameLevelScene())]
 +            return [
 +                WorldEvent('set', {'level.name': next_level}),
 +                ChangeSceneEvent(GameLevelScene())]
  
-     def _fire_key(self):
-         print('Boom')
+     def _fire_key(self, dt):
+         if self._last_key_down > self._key_rate:
+             self._last_key_down = 0
+             print('Boom')
  
      def _vehicle_management_key(self):
          from .roach_management import RoachesScene