Dec-09-2017, 01:19 AM
You can use multiple keys. One for you and one for others.
# moving ship get_key = lambda key: Game.keys_press.get(key, False) if get_key('a') or get_key('Left'): Game.canvas.move(Game.ship, -Game.ship_speed, 0) if get_key('d') or get_key('Right'): Game.canvas.move(Game.ship, Game.ship_speed, 0) if get_key('w') or get_key('Up'): Game.canvas.move(Game.ship, 0, -Game.ship_speed) if get_key('s') or get_key('Down'): Game.canvas.move(Game.ship, 0, Game.ship_speed) if Game.keys_press.get('space', False): if pauser_elaspe(Game.shoot_pauser, Game.ticks): shoot()If you don't know lambda does. It makes a quick simple function.
get_key = lambda key: Game.keys_press.get(key, False)equal to
def get_key(key): return Game.keys_press.get(key, False)
99 percent of computer problems exists between chair and keyboard.