import pygame import gamebox width = 800 height = 600 camera = gamebox.Camera(width, height) ship = gamebox.from_image(400, 560, "http://www.cs.virginia.edu/~up3f/cs1111/images/spaceship.jpg") def tick(keys): ''' This is where the game goes :param keys: recognizes what the user does with :return: doesn't return anything, it is actively running ''' camera.clear("black") if pygame.K_RIGHT in keys: ship.x += 5 if pygame.K_LEFT in keys: ship.x -= 5 if pygame.K_UP in keys: ship.y -= 5 if pygame.K_DOWN in keys: ship.y += 5 # wrap if ship.x > width: ship.x = 0 if ship.x < 0: ship.x = width if ship.y > height: ship.y = 0 if ship.y < 0: ship.y = height camera.draw(ship) camera.display() # make that screen appear ticks_per_second = 60 gamebox.timer_loop(ticks_per_second, tick)