Hi, For continuous movement, you deal with the keyboard a different way. You don't check for a keyboard event, because the events only happens when you press the key down or let up on the key. Instead, every time through your loop, you query the state of the keyboard. It gives you back a Boolean list of all the keys that are currently down. Then you can index into that list to see if a key is down. Here are the changes to the previous program (commented out old code dealing with key downs, added new): # If user presses left, right, up, or down, change the appropriate coordinate ## elif event.key == pygame.K_LEFT: ## circleX = circleX - N_PIXELS_TO_MOVE ## elif event.key == pygame.K_RIGHT: ## circleX = circleX + N_PIXELS_TO_MOVE ## elif event.key == pygame.K_UP: ## circleY = circleY - N_PIXELS_TO_MOVE ## elif event.key == pygame.K_DOWN: ## circleY = circleY + N_PIXELS_TO_MOVE keyPressedList = pygame.key.get_pressed() if keyPressedList[pygame.K_LEFT]: circleX = circleX - N_PIXELS_TO_MOVE if keyPressedList[pygame.K_RIGHT]: circleX = circleX + N_PIXELS_TO_MOVE if keyPressedList[pygame.K_UP]: circleY = circleY - N_PIXELS_TO_MOVE if keyPressedList[pygame.K_DOWN]: circleY = circleY + N_PIXELS_TO_MOVE This approach allows you to hold down the down arrow and the right arrow keys (for example), and the circle will move diagonally. Irv
|