Practice
Quit Pygame
Create a pygame window (you don’t need to put anything on it). Close the pygame window when either the quit event occurs or the escape key is pressed.
Move Rectangle
Draw an object on the screen (a rectangle would suffice). Move the object up when either the W or up arrow key is pressed; right when either the D or right arrow is pressed; etc.
Previous Section
3.5 - ExampleNext Section
3.7 - ConclusionCopyright © 2021 Code 4 Tomorrow. All rights reserved.
The code in this course is licensed under the MIT License.
If you would like to use content from any of our courses, you must obtain our explicit written permission and provide credit. Please contact classes@code4tomorrow.org for inquiries.