Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Getting started

In this chapter, we’ll set up a new project for our platformer and download the assets we need.

Creating the project

Start by cloning a fresh copy of the agb template:

git clone https://github.com/agbrs/template.git platform
cd platform

If you haven’t set up your development environment yet, follow the environment setup instructions first.

Setting up Cargo.toml

Our build script will need a few extra dependencies to parse Tiled levels at compile time. Run the following commands to add them:

cargo add --build quote proc-macro2 tiled

Downloading the assets

We need two graphics files for this game: a tileset for the level backgrounds and a sprite sheet for the player character.

Download these files and place them in a gfx/ directory in your project:

Project structure

Once you’ve done the above, your project should look like this:

platform/
├── Cargo.toml
├── gfx/
│   ├── tileset.png
│   └── sprites.aseprite
└── src/
    └── main.rs

Don’t worry about the build.rs or tiled/ directory yet — we’ll create those in the next chapters. If the template already contains a build.rs, that’s fine — we’ll replace its contents later.

Verify it builds

Before moving on, make sure the template still builds:

cargo build --release

You should see a successful build. The game won’t do anything interesting yet, but this confirms your toolchain is working.