6️⃣

3.6 - Practice Problems

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.
 
⚖️
Copyright © 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.