Quick Start
Installation
- MacOS / Linux
- Windows
- Install Rust.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Add the Rust WebAssembly compiler target
rustup target add wasm32-unknown-unknown
- Run the Turbo CLI install script
curl -sSfL https://turbo.computer/install.sh | sh
The installer will ask for your password for permission to move the turbo
command into /usr/local/bin
. If you prefer a manual download, follow these steps:
- Download the 64-bit release for your platform on the releases page.
- Decompress the archive and move
turbo
into your$PATH
. We recommend/usr/local/bin
.
- Verify your installation
turbo -h
If successful, it will output turbo
's help documentation 🎉
- Install Git for Windows.
We will use Git Bash to run the commands in subsequent steps.
- Install Rust
Download and run rustup-init.exe.
- Add the Rust WebAssembly compiler target
rustup target add wasm32-unknown-unknown
- Run the Turbo CLI install script
Run Git Bash as an administrator and enter the following command:
curl -sSfL https://turbo.computer/install.sh | sh
If you prefer a manual download, follow these steps:
- Download the 64-bit release for Windows MSVC.
- Unzip the file and move
turbo.exe
intoC:\Windows\System32
.
- Verify your installation
turbo -h
If successful, it will output turbo
's help documentation 🎉
Hello, World!
Now it is time to speedrun your first Turbo game. It should take less than 5 minutes.
1. Initialize
Begin by creating a new project called hello-world
:
turbo init hello-world
This initializes a rust crate in a hello-world
directory.
2. Run
Next, run your game with the following command:
turbo run -w hello-world
A game window should appear.
The -w
flag auto-refreshes your game window as you code. Just be sure to watch the console for compiler errors.
3. Update
Leave the turbo run
command running. Open the hello-world
project in your preferred editor.
Now, open hello-world/src/lib.rs
. You should see something like this:
// This is where your main game loop code goes
// The stuff in this block will run ~60x per sec
turbo::go! {
text!("Hello, world!!!");
}
Time for your first update. Modify the text and check out your game window:
// This is where your main game loop code goes
// The stuff in this block will run ~60x per sec
turbo::go! {
text!("Yuuurrr!");
}
If you want to keep playing around, the text!
macro has several optional parameters you can experiment with:
// This is where your main game loop code goes
// The stuff in this block will run ~60x per sec
turbo::go! {
text!(
"Let's gooo!", // Text to display
x = 32, // Starting x position of the text
y = 48, // Starting y position of the text
color = 0xff00ffff, // Text color
font = Font::L // Text font (other options: Font::S and Font::M)
);
}
Next Steps
Congratulations! 🎉
Here are a few ways to continue your game development journey:
- Join the Discord community →
- Get comfy with a tutorial that covers the basics →
- Browse through the Rust SDK reference →
- See our "How To" section to quickly learn new concepts →
- Explore the possibilities in our demo games repo →