Getting started
rmp is the one command: it makes a game, builds it, runs it, tests
it and ships it. You install it once, and every game you make has its own copy.
What you need#
- Python 3.11
or newer, CMake 3.30 or newer and Ninja on your PATH, and a C++
compiler. A Linux distribution's own
cmakepackage can be older than 3.30, and an older CMake stops the first build before anything is compiled:cmake --versionsays which one you have. - git, to get the framework and to keep your game in.
- On a Linux desktop, the X11 development libraries.
On Linux, in one command#
Everything a build needs — the compiler, CMake, Ninja, Python, git and the X11 headers — for
each family of distributions. Any C++20 compiler does: [dev] compiler = "clang" uses
clang where it is installed and the system's compiler where it is not.
Debian and Ubuntu
sudo apt install build-essential cmake ninja-build python3 git \
libx11-dev libxrandr-dev libxi-dev libxcursor-dev libxinerama-dev libgl1-mesa-devUbuntu 24.04's cmake is 3.28; take a newer one from Kitware's
own apt repository, or pipx install cmake.
Fedora
sudo dnf install gcc-c++ cmake ninja-build python3 git \
libX11-devel libXrandr-devel libXi-devel libXcursor-devel libXinerama-devel mesa-libGL-develArch
sudo pacman -S --needed base-devel cmake ninja python git \
libx11 libxrandr libxi libxcursor libxinerama mesaAlpine,
3.21 or newer for a CMake of 3.30. Its Ninja is samurai, its compiler and
make come in build-base, and GLFW reads the kernel's input headers.
Alpine ships doas rather than sudo:
doas apk add build-base cmake samurai python3 git linux-headers \
libx11-dev libxrandr-dev libxi-dev libxcursor-dev libxinerama-dev mesa-devOr install nothing on the machine at all, and work inside the image CI builds in: In the build image, with Podman.
On a Linux console with no desktop, rmp builds for DRM/KMS instead, and needs the
DRM headers in their place; Linux from a
console says which, and how the game reaches the screen.
Install rmp#
One line, in a terminal. On Linux and macOS:
curl -fsSL https://omardev29.github.io/rmp-docs/install.sh | shOn Windows, in PowerShell:
irm https://omardev29.github.io/rmp-docs/install.ps1 | iexIt needs git and Python 3.11 or newer, and says how to get either if it is missing. It puts the
framework in your home folder and rmp on your PATH, as you and without
sudo, and at the end it lists anything a build still needs on this machine.
Install rmp has the line for the BSDs and for Linux
without curl, where everything goes, and how to update and remove it. Open a new
terminal, and check:
rmp helpMake a game#
rmp new my_game
cd my_game
rmp runrmp new makes a folder with the framework, the build and CI for every target, and
a small game in src/ to start from. rmp run builds it and opens the
window: a menu with a rabbit on it. The first build compiles raylib and the framework, so it takes
a while; after that only what changed is compiled again.
The folder is also a git repository, with every file already added. Commit it, so that what
the next pages change is yours to see in git diff:
git commit -m "New game"What is yours#
Most of the folder is the framework and the build, and you do not edit it. Your game is seven places:
| Path | What it is |
|---|---|
src/main.cpp | Where the game starts. It names the first scene, and that is all it does. |
src/scenes/ | The scenes, one per file: main_menu.h and main_menu.cpp are the menu you just saw. |
include/ | Your headers, when you want them apart from the code. This tutorial keeps each header beside its .cpp instead. |
resources/ | Pictures and sounds, loaded by name. rabbit.png is the one on the menu. |
tests/game/ | Tests of your game, run with no window by rmp test unit. It starts with one, of the menu. |
branding/icon.png | The app's icon: the Android and iOS icons, and the one inside the Windows .exe, are all made from this one picture. It is not in resources/ because the game never loads it. |
raylib_multiplatform.toml | The game's name, its window, its app ids and which platforms to build. |
src/rmp/ and include/rmp/ are the framework itself, inside your game.
Every other .cpp under src/, in any folder, is compiled without being
listed anywhere: adding a file to the game touches no build file.
The new game's raylib_multiplatform.toml has your game's name in it, and app ids
that start with com.example.. Set real ones before your first release:
rmp deploy refuses to tag a release while they are placeholders, because a Google Play
app id can never change once it is published.
The tutorial#
The pages that follow turn the game rmp new made into a real one, a step at a time:
Coin Rabbit, in which a rabbit gathers coins while bats close in on it. Each page shows
every source file it adds or changes, whole, and the keys it sets in
raylib_multiplatform.toml, and ends with a game that builds and runs.
- Your first scene: a menu of your own, and a second screen to go to.
- A player: an object that moves with the keyboard, a gamepad, the mouse or a finger.
- Coins and bats: something to collect, something to avoid, and a game over.
- A pause menu: a scene on top of the game.
- Art and sound: pictures and sounds, loaded by name.
- Saving a record: the best score, kept between sessions.
- Ship it: real app ids, the checks, and a release built for every platform.