command list

This commit is contained in:
Frank DeMarco 2012-11-30 11:48:16 +09:00
parent c0ed51b2c9
commit 5ece5c450f
3 changed files with 4 additions and 3 deletions

View File

@ -19,6 +19,7 @@ class Game(GameChild, Animation):
def __init__(self, config_rel_path=None, type_declarations=None):
self.init_gamechild()
self.print_debug(pygame.version.ver)
self.config_rel_path = config_rel_path
self.type_declarations = type_declarations
self.set_configuration()

View File

@ -74,8 +74,10 @@ class GameChild:
def is_command(self, evt, cmd):
name = self.get_configuration().get("event", "command-event-name")
if not isinstance(cmd, list):
cmd = [cmd]
return evt.type == self.get_custom_event_id() and evt.name == name and \
evt.command == cmd
evt.command in cmd
def post_command(self, command):
name = self.get_configuration().get("event", "command-event-name")

View File

@ -91,8 +91,6 @@ class Input(GameChild):
return joystick.is_direction_pressed(Joystick.down)
elif command == "left":
return joystick.is_direction_pressed(Joystick.left)
else:
return False
def is_key_pressed(self, command):
poll = keyboard.get_pressed()