Table of Contents....3
Setting up Python and Pygame....5
Getting Started....5
Installing Pygame....7
Intro To Python....9
Intro To PyGame....28
Blinking Hello World....32
Responding to the Keyboard....38
Conclusion....42
Tic Tac Toe in PyGame....43
Intro....43
Main Loop....44
Processing Events....45
Drawing the Board....46
A better AI....54
Conclusion....58
Using Classes in Pygame....59
Introduction....59
Refactoring the Game Logic....64
Conclusion....72
Chapter 6 - Stone Eater....74
Introduction....74
The Game Design....75
Detecting Key Strokes....81
Space Invasion in PyGame....96
Introduction....96
How to play....97
The Main Loop....99
Game Sprites....101
Invader Sprite....105
Bullet Sprite....108
Bomb Sprite....109
Moving the Player....111
Firing the bullet....114
Checking for alien hits....116
Drawing the aliens....118
Adding in Scoring....129
Launching the UFO....133
Conclusion....141
Appendix....142
Source Code....142
Where to Find Images....142
Where to Find Sounds....142
Other Resources....143
Creating Video Games using PyGame is a comprehensive guide to building exciting 2D games using the powerful pygame library in Python. This book is designed to take you on a journey from the very basics of Python to advanced concepts required for game development.
The book starts with a step-by-step guide to setting up Python and pygame, followed by an overview of the Python programming concepts necessary to understand the games presented in the book. The book then takes you through the creation of three unique games, each one designed to teach you new and essential concepts of game development.
The first game you'll build is a simple 2D platformer game that will teach you the basics of pygame and game design. The second game is a dot eating game with a time limit introducing you to your first real-time 2d game. The third game is a space shooter, which will take you through advanced pygame features such as sprite animation, sound effects, game clock management and enemy automation.
Throughout the book, you'll learn how to use pygame to create game assets such as sprites, backgrounds, and sound effects. You'll also learn how to implement game logic and user input handling. By the end of the book, you'll have the skills and knowledge to create your own 2D games from scratch.
Whether you are an experienced programmer or a novice, Creating Video Games using PyGame is the perfect book to help you get started with game development in Python. With clear explanations, step-by-step instructions, and engaging examples, this book will guide you through every aspect of game development using pygame.
We value accuracy and the trust our readers place in our content. In our commitment to provide the best content, we have made several updates to Creating Video Games Using PyGame. Below is a brief overview of the changes:Fixed the Margins in the Paperback - The first edition margins were taking up too much space, this has been updated.