running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False elif event.type == pygame.KEYDOWN: if event.key == pygame.K_LEFT: player.speed_x = -5 elif event.key == pygame.K_RIGHT: player.speed_x = 5 elif event.key == pygame.K_a: player.shoot(RED) elif event.key == pygame.K_s: player.shoot(GREEN) elif event.key == pygame.K_d: player.shoot(BLUE) elif event.key == pygame.K_f: player.shoot(YELLOW)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)