Task 2.1: Create Game Screen
Before we make our game we need to set up the screen to display it!
-
Create some variables that will hold the width and the height. 800 pixels wide and 600 pixels tall
E.g. A screen that is 100 pixels wide and 200 pixels could have these variables:
WIDTH = 100 HEIGHT = 200
-
Create a window of that size and assign it to screen like so:
pygame.display.set_mode((WIDTH, HEIGHT))
📝 Note
Running your game will cause your program to crash. You must complete Task 1.2 before you can see a screen when you run your pygame.
🚩 Checkpoint
- Two variables for width and height
- A screen object created using Pygame and your variables