This takes what was started in the official tutorial and finishes it out. It is far from perfect, but was my attempt at finishing it out. It's missing the animations for the ball that was included in sprites.aseprite, pretty sure there is not way to beat the AI since it just tracks the ball, and a bit of faulty collision logic. Used this as a fun project to learn simple game dev and to finally build something that can run on GBA emulators and hardware!
You will need the following installed in order to build and run this project:
- A recent version of
rustup
. See the rust website for instructions for your operating system
You will also want to install an emulator. The best support in agb is with mgba, with
println!
support via agb::println!
but any emulator should work. You'll get the best experience if
mgba-qt
is in your PATH
.
If you want to run your game on real hardware, you will also need to install agb-gbafix
which you can do after installing
rust with the following: cargo install agb-gbafix
. This is not required if you are only running your game in an emulator.
Once you have the prerequisites installed, you should be able to build using
cargo build
or in release mode (recommended for the final version to ship to players)
cargo build --release
The resulting file will be in target/thumbv4t-none-eabi/debug/agbrs_pong
or target/thumbv4t-none-eabi/release/agbrs_pong
depending on
whether you did a release or debug build.
If you have mgba-qt
in your path, you will be able to run your game with
cargo run
or in release mode
cargo run --release
You can find the documentation for agb here.
You may also want to change the package name and version in Cargo.toml
before you start.
To make a game run on real hardware, you will need to convert the built file into a file suitable for running on the real thing.
First build the binary in release mode using the instructions above, then do the following:
agb-gbafix target/thumbv4t-none-eabi/release/agbrs_pong -o agbrs_pong.gba