1. Setup and getting started Goal: for the user / reader to be able to set up their environment and understand some common errors in order that they can get started
· Installing Python
· Which IDE?
· Bugs and debugging
· Indentation
· Internal comments
2. Forest Bomber part 1 - A first level Goal: learn how to create a simple first level for a 2D game
· Variables
· Arithmetic operators (+ - * /)
· Lists / Arrays
· Displaying images
·
3. Forest Bomber part 2 - Is it a bird?
Goal: learn how to display and move a plane across the screen
· While True loop
· Decisions
4. Forest Bomber part 3 - Bombs away Goal: learn how to capture user input (keypress) to perform an action (drop bomb) as well as handle end of level / game events
· Keypresses
· Relational operators (==. , >=, <=, !=)
· Level up
· Game over
5. Forest Bomber part 4 - Wrapping it up
Goal: learn how to display scoreboard information
· Scoreboard
6. Snapper part 1 - In the woods Goal: learn how to set up a game level with randomly generated elements
· Boolean variables
· Storing data in a dictionary
· Random events
7. Snapper part 2 - Say cheese Goal: learn how to control the mouse, and how to modularise code
· Mouse events
· More decisions
· Functions
8. Alien Invasion part 1 - Defend planet earth Goal: learn how to control and move a player base (left/right) and fire a missile in the game Alien Invasion
· Understanding coordinates
· Firing missiles
· Controlling the base
· Logical operators (and)
9. Alien Invasion part 2 – Earth is under attack Goal: learn how to generate random enemy behaviours in the game Alien Invasion
· Strings
· UFO Dictionary
· Random choice
· Moving UFOs
· Collisions
· Parameter Passing
10. Golf part 1 - Out on the course Goal: Learn how to set up more complex and repeating levels in the game Golf
· Meaningful variable names
· Fixed loops
· Placing the flag
11. Golf part 2 - It's in the hole Goal: learn the logic required to test if a ball has found the hole in the game Golf, and what to do thereafter
· Logical operators (or)
· Nested if statements
· Moving the ball
· Using a list to store the strokes
12. Tic Tac Toe part 1 - The board Goal: learn how to create a Tic Tac Toe game board using a 2D array
· String concatenation
· Displaying text
· Drawing a grid
· 2D Lists / Arrays
· Nested loops
· Parameter passing part 2
13. Tic Tac Toe part 2 - The game Goal: learn how to go about handling game logic for Tic Tac Toe, including the computer player logic and testing to see if there has been a winning line
· Player turn
· Overall game logic
· Computer logic
· Conditional while loops
· Winning line logic
14. Jupiter Landing part 1 - The dawn of Jupiter Goal: learn how to generate a random planet surface from a list
· Game variables
· Looping through lists
· A random planet
15. Jupiter Landing part 2 - Rocket man Goal: learn how to apply velocity and gravity in the game Jupiter Landing
· Floating point variables
· Predefined functions: round, abs
· Lander start location
· Rocket thrust
· Rotating
· Gravity and velocity
· Planet collision
· Level up
16. What next…?
Goal: learn how to apply the learning from this book to develop games of your own
Mark Cunningham is the founder of Code Angel and has over 20 years experience of teaching coding in high schools. In teaching Computing Science to high school students, he has learned which coding concepts new coders find difficult to understand, learn, and master. He has also found that students learn better when writing programs that they can engage with rather than simple programs they find boring and pointless. Teaching is his passion and in particular teaching computer programming and developing computational skills. His work with Code Angel has allowed him to take his teaching beyond the classroom and offer a wealth of resources for developing new programmers.
Program in Python on a Raspberry Pi or PC by developing six computer games. Each game project is split into several chapters of the book. Rather than taking you through programming techniques as standalone concepts, this book explains concepts as they are used within a game.
You'll learn about variables; integer, real, Boolean and string data types; conditional if statements; fixed loops and conditional loops; modularity; arrays and lists; and predefined functions. You’ll also discover the PyGame library, which is popularly used in the development of 2D games.
Key programming concepts are revisited in subsequent projects in the book to consolidate prior learning. Beyond teaching you how to code, this book explains the programming logic behind each project—exemplifying the process of designing and writing a computer game.
All the projects in this book are supported by Code Angel (mycodeangel.com). Code Angel Code Angel largely serves students and new developers and the projects work by encouraging you to ‘Learn…then play’. Taking this approach, you'll be able to build fun 2D games and enjoy playing them by yourself or with friends. Developing games in this way keeps you engaged, gives a purpose as you work through each project, and offers a sense of achievement when each game is finished.