#macroquad #attempt #pc #ui #platform #android #game

mquad

macroquad but with personal additions

2 releases

0.1.1 Oct 31, 2021
0.1.0 Oct 31, 2021

#14 in #pc

MIT/Apache

380KB
10K SLoC

macroquad is a simple and easy to use game library for Rust programming language.

macroquad attempts to avoid any rust-specific programming concepts like lifetimes/borrowing, making it very friendly for rust beginners.

Supported platforms

  • PC: Windows/Linux/MacOS
  • HTML5
  • Android
  • IOS

Features

  • Same code for all supported platforms, no platform dependent defines required
  • Efficient 2D rendering with automatic geometry batching
  • Minimal amount of dependencies: build after cargo clean takes only 16s on x230(~6years old laptop)
  • Immediate mode UI library included
  • Single command deploy for both WASM and Android build instructions

Example

use macroquad::prelude::*;

#[macroquad::main("BasicShapes")]
async fn main() {
    loop {
        clear_background(RED);

        draw_line(40.0, 40.0, 100.0, 200.0, 15.0, BLUE);
        draw_rectangle(screen_width() / 2.0 - 60.0, 100.0, 120.0, 60.0, GREEN);
        draw_circle(screen_width() - 30.0, screen_height() - 30.0, 15.0, YELLOW);
        draw_text("HELLO", 20.0, 20.0, 20.0, DARKGRAY);

        next_frame().await
    }
}

Dependencies

~9–15MB
~256K SLoC