turbo-genesis-sdk

Crates.ioturbo-genesis-sdk
lib.rsturbo-genesis-sdk
version5.1.0
created_at2023-08-19 16:17:19.683429+00
updated_at2025-08-29 20:00:04.761786+00
descriptionTurbo Genesis SDK
homepage
repositoryhttps://github.com/super-turbo-society/turbo-genesis-sdk/tree/main/turbo-genesis-sdk
max_upload_size
id948775
size444,283
Josiah Savary (jozanza)

documentation

README

Turbo Genesis SDK

docs.rs Crates.io License: MIT

Turbo logo banner

A flexible Rust SDK for building WebAssembly–powered games on the Turbo, with first-class support for graphics, audio, input, and netcode.

🌟 Features

  • Canvas: 2D drawing primitives text, sprites (static and animated), etc + camera movement and zoom.
  • Audio: Load/play/loop audio assets.
  • Input: Handle keyboard, mouse, touch, and gamepad input.
  • System: Console logging, get monotonic and system time, save data to local storage.
  • Utility: Built-in libraries for easing transitions (tweening) and creating advanced GUI layouts.
  • Network: Connect to the Turbo OS gaming backend to easily create online multiplayer experiences.

🚀 Getting Started

  1. Install Turbo

    You can find full install instructions on the Turbo Docs

  2. Create your project

    turbo init my-turbo-app
    

    This will automatically add the SDK as a dependency in your project's Cargo.toml:

    [dependencies]
    turbo = { package = "turbo-genesis-sdk", version = "..." }
    

    The SDK version will vary based on the version of turbo installed. It is best to ensure your on the latest version of turbo and the SDK when starting a new project.

  3. Write your code

    Open src/lib.rs and drop in:

     use turbo::*;
    
    #[turbo::game]
    #[derive(BorshDeserialize, BorshSerialize)]
    struct MyGame {
       greeting: String,
    };
    impl MyGame {
       pub fn new() -> Self {
          Self {
             greeting: "Hello, Turbo!".to_string(),
          }
       }
       pub fn update(&mut self) {
         // Clear the background with a hex color:
         clear(0xff00ffff);
         // Draw text to the screen:
         text!(&self.greeting);
         // Draw a rotated square:
         rect!(w = 50, h = 50, color = 0xffffffff, rotation_deg = 45);
       }
    }
    
  4. Run with Turbo

    turbo run -w .
    

📖 Documentation

📜 License

This project is licensed under MIT. See LICENSE for details.

Commit count: 196

cargo fmt