How to move rectangle in pygame, such that it moves horizontally when pressing right or left on keyboard and it moves vertically when pressing up or down? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to move rectangle in pygame, such that it moves horizontally when pressing right or left on keyboard and it moves vertically when pressing up or down?

Pygame

27th May 2017, 11:14 PM
Hesham Emara
1 Answer
+ 2
Here is a tutorial form the official site of pygame: https://www.pygame.org/docs/tut/MoveIt.html
27th May 2017, 11:27 PM
Ulisses Cruz
Ulisses Cruz - avatar