import turtle screen = turtle.Screen() # this assures that the size of the screen will always be 400x400 ... screen.setup(1366, 768) # ... which is the same size as our image # now set the background to our space image screen.bgpic("space.gif") # Or, set the shape of a turtle screen.addshape("rocketship.gif") turtle.shape("rocketship.gif") move_speed = 10 turn_speed = 10 # these defs control the movement of our "turtle" def forward(): turtle.forward(move_speed) def backward(): turtle.backward(move_speed) def left(): turtle.left(turn_speed) def right(): turtle.right(turn_speed) turtle.penup() turtle.speed(0) turtle.home() # now associate the defs from above with certain keyboard events screen.onkeypress(forward, "k") screen.onkeypress(backward, "j") screen.onkeypress(left, "h") screen.onkeypress(right, "l") screen.listen() turtle.exitonclick()