The Course Game
Make a 2D Side-Scroller Game With PyGame
Christopher Bailey 01:48
00:00 To kick off this section, we'll talk about the design of the tutorial game you're going to build. Before you start writing any code, it seems to work best to have a good idea of what sort of design you want in place. As this is a tutorial, you'll start with the design to some of the basic gameplay.
00:18 The primary goal for the game is to avoid the incoming obstacles. The player is going to start on the left side of the screen, and then obstacles are going to enter randomly on the right and move left in a straight line. As far as controls go, the player can move left, right, up, and down to avoid the obstacles.
00:36 You'll need to set it up so that the player cannot move off the screen. And the game is either going to end when the player's hit by an obstacle or when the user closes the window.
00:46 What can be just as useful as having goals for your game is having not goals for your game. Some advice that was given to the author of the original article by one of their colleagues was "You don't know what you do until you know what you don't do." And that's really true in this case. You can think of it as project management scope creep.
01:05 I remember working at this bank and trying to build a simple reporting system, and everybody kept throwing new and crazy cool features at me before I could even show them a prototype of how it worked.
01:16 You're going to create a simple tutorial game, so what's it not going to do? Well, there's going to be no multiple lives, no scorekeeping, no player attack capabilities, no advancing levels, and no boss characters. That helps you focus on the fundamentals of getting the game started, but any of these are excellent potential ways for you to explore growing your PyGame skills. And with that, it's time to start writing some code by importing and initializing PyGame.
Make a 2D Side-Scroller Game With PyGame (Overview) 04:35
Background and Setup 02:41
Basic PyGame Program 04:48
PyGame Concepts 03:06
The Course Game 01:48
Importing and Initializing 02:13
Setting up the Display 01:48
Setting up the Game Loop 04:32
Drawing on the Screen 02:50
Using .blit() and .flip() 03:51
Creating Sprites 08:46
User Input 07:12
Staying on the Screen 02:57
Creating Enemies 07:15
Sprite Groups 03:03
Custom Events 05:17
Collision Detection 02:39
Sprite Images 04:41
Adding Background Images 08:22
Game Speed 05:03
Adding Music 06:28
Adding Sound Effects 09:04
A Note on Sources 02:13
Make a 2D Side-Scroller Game With PyGame (Summary) 03:13