Your first game
In this tutorial you will make a spaceship game from scratch: you control the ship, shoot the enemies that fall, score points and lose lives. When the lives run out, the game over screen shows up.
What you will learn
Section titled “What you will learn”- Create a project and import images and sounds.
- Create objects, give each one a sprite and place them in a room.
- Write the behavior of an object in C++: move, shoot, collide.
- Create variables and actions in the editor and use them in the code.
- Create enemies from time to time and count points.
- Show text on screen and switch rooms.
The parts
Section titled “The parts”- Project and sprites: create the project and import the images.
- The ship: the ship appears and moves with the arrow keys or the gamepad.
- Shots: the space bar shoots.
- Enemies: enemies fall and explode when shot.
- Score and lives: scoreboard, lives and damage.
- Sound: sounds for shooting, explosion and damage.
- Game over: the Game Over screen and playing again.
Each part takes some 10 to 15 minutes and ends with the game running.
Before you start
Section titled “Before you start”- Install Brasa: see Installation.
- Have a code editor. We recommend VS Code with Microsoft’s C/C++ extension: Brasa already sets up the project so autocomplete works.
- Download the images and sounds of the game: primeiro-jogo-recursos.zip. Unzip it into any folder.
