We’re going to make a simple space shooter game.
Vertically scroll, shoot lasers, avoid the enemy ships.
First, we are going to set up several game “states”
- Title Screen
- Game Mode
- Pause Mode
- Game Over
- Boss Fight Mode
- Victory Mode
Here is our outline of the game code…
- Draw Title Screen
- Start Title Loop
- Get Input (wait for Start)
- Play Music
- Draw Game Screen
- Start Game Loop
- Get Input
- Move your ship
- Spawn Ships
- Move enemy ships and bullets
- Play Music
- If Run out of Lives, Draw Game Over Screen
- -Play Game Over Music
- -Loop Back to Title
- If reach end, Start Boss Fight Mode
- If win, Start Victory Mode, Draw Victory Screen
- -and play Victory Music
First, create some graphics for the game.
Then, write some music.
I’m going to get the title screen working, with music, then I’ll get the Game Mode working.
I decided to use a Sprite Zero Hit to split screen the Scoreboard and the action, which will be vertically scrolling. Here’s a quick sketch I did in Photoshop…
I also decided to use Sprites for some of the text, like ‘Pause’ and ‘Game Over’. I thought that would be easiest.
Let’s get started, I’ll show you some code next time…I’m still trying to stick to the ‘make a game entirely in C’ concept, and this is just example code, so it won’t be too fancy.