78 releases (30 stable)

new 3.0.0-alpha.1 Apr 25, 2025
2.2.4 Apr 30, 2025
2.2.0 Mar 24, 2025
1.8.1 Feb 22, 2025
0.3.0 Nov 7, 2023

#4 in Magic Beans

Download history 148/week @ 2025-01-08 16/week @ 2025-01-15 224/week @ 2025-01-22 13/week @ 2025-01-29 51/week @ 2025-02-05 59/week @ 2025-02-12 257/week @ 2025-02-19 243/week @ 2025-02-26 373/week @ 2025-03-05 1071/week @ 2025-03-12 479/week @ 2025-03-19 42/week @ 2025-03-26 176/week @ 2025-04-02 183/week @ 2025-04-09 191/week @ 2025-04-16 135/week @ 2025-04-23

691 downloads per month
Used in mrdirector

MIT license

355KB
7K SLoC

Turbo Genesis SDK

docs.rs Crates.io License: MIT

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

🌟 Features

  • Canvas (canvas): 2D drawing primitives, layers, text
  • Audio (audio): load/play/loop audio assets
  • Input (input): keyboard, mouse, touch, gamepad
  • HTTP (http): fetch, post, JSON convenience
  • System (sys, os, bounds, tween): console logging, timing, tween animations, safe bounds checks

🚀 Getting Started

  1. Install Turbo

    curl -sSfL https://turbo.computer/install.sh | sh
    

    Make sure you also have the wasm target installed as well

    rustup target add wasm32-unknown-unknown
    

    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::prelude::*;
    
     turbo::go!({
         // Clear the background with a hex color:
         clear(0xff00ffff);
         // Draw text to the screen:
         text!("Hello, Turbo!");
         // 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.

Dependencies

~3–13MB
~159K SLoC