command list
This commit is contained in:
parent
c0ed51b2c9
commit
5ece5c450f
|
@ -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()
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue