Year 9 - Term 2 C
The focus this term is on learning to use Pygame to create a basic Windows based game.
The Pygame library is probably the most well-known python library when it comes to making games. It’s not the most advanced or high level library, but it’s comparatively simple and easy to learn. Pygame serves as a great entry point into the world of graphics and game development, especially for beginners.
The Pygame framework includes several modules with functions for drawing graphics, playing sounds, handling mouse input, and other things that you’ll need while developing games in Python.
How to set up PyCharm on the computer
PyCharm Edu - Student Walkthrough
Introduction to PyGame
What is Pygame?
Pygame is a “game library” - a set of tools to help programmers make games. Some of these things are:
Graphics and animation
Sound (including music)
Control (keyboard, mouse, gamepad, etc.)
Game Loop
At the heart of every game is a loop, which we call the “Game Loop”. This loop is constantly running, over and over again, doing all the things that are needed to make the game work. Each time the game goes through this loop is called a frame.
You will be using PyCharm for your PyGame project. Find and launch PyCharm on your Computer. Watch this Video
How to install Pygame in PyCharm
Open File > Settings > Project from the PyCharm menu.
Select your current project.
Click the Python Interpreter tab within your project tab.
Click the small + symbol to add a new library to the project.
Now type in the library to be installed, in your example PyGame, and click Install Package.
Wait for the installation to terminate and close all popup windows.
Now do This:
Check that you have your Term 2 PyGame ProveIT. Add your name to the front page. Work through the Presentation above and add definitions for the keywords in your ProveIT. Complete Slides 2 - 7.
Stop at slide 8 and type in the code and test it, update your ProveIt. The rest of the slides explain the code, read it carefully.
You have to type your code exactly as it is displayed. Capital, spaces, underscore and indentation must all be exactly as shown or your code will not run as expected or will give you an error.
Now try these tutorials
![](https://www.google.com/images/icons/product/drive-32.png)
A basic game - game instructions start at 0:40
![](https://www.google.com/images/icons/product/drive-32.png)
A car driving game
Now work your way through the video presentations below, there are also text documents to support you. Remember to update your ProveIt slides before the end of every lesson.
Kids can Code : PyGame Tutorial - Space Shooter (SHMUP!) - click here
![](https://www.google.com/images/icons/product/drive-32.png)
Create a Pong Game
Additional PyGame Resources