From: Simon Cross Date: Sat, 5 Mar 2016 19:05:32 +0000 (+0200) Subject: Merge branch 'master' of ctpug.org.za:koperkapel X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=15f8404d39a46ec6243f2e75a0c03ba4e6294800;p=koperkapel.git Merge branch 'master' of ctpug.org.za:koperkapel --- 15f8404d39a46ec6243f2e75a0c03ba4e6294800 diff --cc koperkapel/scenes/level.py index 735ed28,606a0db..e26d11d --- a/koperkapel/scenes/level.py +++ b/koperkapel/scenes/level.py @@@ -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