At the end of this lesson, you will be able to:
make a game
reading and writing to files
Many students taking a computer science class do so because they enjoy using computers for entertainment purposes, such as gaming. So we will finish this course with learning about some resources to create games using the Python language.
You have already had some experience working with the pygame module in previous units; in this activity we will further that knowledge to help you create a fully working game
Work through the following online tutorial: The New Boston's Pygame Tutorial, by sentdex. In this tutorial he uses an incremental approach to game creation; which means that he builds up the functionality of his game little by little, always testing it to ensure that he has a running program at every stage.
Tutorial #1 is about setting up pygame, which is done already.
Tutorials 2-21 build the basic functionality for the snake game.
Tutorials 22-26 improve the collision detection part of the game.
Tutorials 27-36 improve the look and feel of the game.
Tutorials 37-39 add some finishing touches.
To assist you in the creation of your game, an important reference is the Pygame API. An API is an Application Programming Interface; which is a document that explains all of the variables, functions, and methods that you will need to make use of the code library.
Another resource that you will find helpful is the online textbook: Program Arcade Games with Pygame and Python. Chapters 5, 8, 10 and 11 will be most helpful to you in your game creation.
Work through the youtube tutorial shown above (I recommend completing at least up to #30)
Improve the snake game by adding extra functionality (keep track of the highest score, add some sound, create different levels of difficulty, move the apples around the screen and make them bounce off the edges, etc)
work on weekly assignment