import pygame

pygame.init()
screen = pygame.display.set_mode((800, 600))

player = pygame.image.load("ship.png")

x = 0
y = 480

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:
                x = x - 5
            if event.key == pygame.K_RIGHT:
                x = x + 5

    screen.fill("white")
    screen.blit(player, (x, y))
    pygame.display.flip()
