- download python
- download vscode or any IDE
- pip3 install pygame
- download python extension for VSCODE (optional & only if you are using VSCODE)
- Create a file (DO NOT NAME IT pygame)
- Import pygame
- Initialize the pygame
- Set up the window size
- Set up a window caption, if you want
- add pygame.quit() at the bottom
- Above the pygame.quit() create a variable called running.
- Initialize the variable to True.
- Below this variable, create a while loop (use this variable as a condition).
- create a for loop that will execute whenever an event is called (events can be any action. Ex. clicking, moving the mouse).
- Create a if statement inside of the for loop that will check if you want to close the window.
Run the file using
python ./main.py