def userInputToPlayer(player): keys = pygame.key.get_pressed() if keys[pygame.K_UP]: player.moveForward() if keys[pygame.K_DOWN]: pass #Do nothing if keys[pygame.K_LEFT]: player.rotateLeft() if keys[pygame.K_RIGHT]: player.rotateRight() if keys[pygame.K_a]: pass if keys[pygame.K_d]: pass
def userInputToPlayer(player): keys = pygame.key.get_pressed() if keys[pygame.K_UP]: player.moveForward() if keys[pygame.K_DOWN]: player.moveBackward() if keys[pygame.K_LEFT]: player.rotateLeft() if keys[pygame.K_RIGHT]: player.rotateRight() if keys[pygame.K_a]: player.accelerate() if keys[pygame.K_d]: player.brake()
def userInputToPlayer(player): keys = pygame.key.get_pressed() if keys[pygame.K_UP]: player.moveForward() if keys[pygame.K_DOWN]: player.moveBackward() if keys[pygame.K_LEFT]: player.rotateLeft() if keys[pygame.K_RIGHT]: player.rotateRight() if keys[pygame.K_a]: player.speed += 0.05 if keys[pygame.K_d]: player.speed -= 0.05