All Projects → not-fl3 → Macroquad

not-fl3 / Macroquad

Licence: other
The cross-platform game engine in Rust.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Macroquad

Quicksilver
A simple framework for 2D games on desktop and web
Stars: ✭ 710 (+57.08%)
Mutual labels:  game-engine, wasm
Pmtech
Lightweight, multi-platform, data-oriented game engine.
Stars: ✭ 478 (+5.75%)
Mutual labels:  game-engine, wasm
Raylib
A simple and easy-to-use library to enjoy videogames programming
Stars: ✭ 8,169 (+1707.3%)
Mutual labels:  wasm, game-engine
Glas
WebGL in WebAssembly with AssemblyScript
Stars: ✭ 278 (-38.5%)
Mutual labels:  game-engine, wasm
Camaro
camaro is an utility to transform XML to JSON, using Node.js binding to native XML parser pugixml, one of the fastest XML parser around.
Stars: ✭ 438 (-3.1%)
Mutual labels:  wasm
Ruby2d
🎮 The Ruby 2D gem
Stars: ✭ 427 (-5.53%)
Mutual labels:  game-engine
Wasm Bindgen
Facilitating high-level interactions between Wasm modules and JavaScript
Stars: ✭ 4,695 (+938.72%)
Mutual labels:  wasm
Chocolatier
WIP ClojureScript game/engine using Pixi.js for rendering.
Stars: ✭ 418 (-7.52%)
Mutual labels:  game-engine
Fluence
Peer-to-peer computing protocol and licensing system
Stars: ✭ 453 (+0.22%)
Mutual labels:  wasm
Et
Unity3D Client And C# Server Framework
Stars: ✭ 5,138 (+1036.73%)
Mutual labels:  game-engine
Xash3d
DEPRECATED in favor of https://github.com/FWGS/xash3d-fwgs. Only bugfixes are accepted.
Stars: ✭ 434 (-3.98%)
Mutual labels:  game-engine
Rizz
Small C game development framework
Stars: ✭ 428 (-5.31%)
Mutual labels:  game-engine
Ebiten
A dead simple 2D game library for Go
Stars: ✭ 5,563 (+1130.75%)
Mutual labels:  game-engine
Jwebassembly
Java bytecode to WebAssembly compiler
Stars: ✭ 426 (-5.75%)
Mutual labels:  wasm
Flexengine
Cross-platform game engine with Vulkan backend
Stars: ✭ 452 (+0%)
Mutual labels:  game-engine
Urho
Code to integrate with the Urho3D engine
Stars: ✭ 423 (-6.42%)
Mutual labels:  game-engine
Oreon Engine
OpenGL/Vulkan Java 3D Engine
Stars: ✭ 431 (-4.65%)
Mutual labels:  game-engine
Haxepunk
Cross-platform desktop, mobile, and WebGL game engine, based on FlashPunk
Stars: ✭ 446 (-1.33%)
Mutual labels:  game-engine
Flame
A minimalist Flutter game engine
Stars: ✭ 5,543 (+1126.33%)
Mutual labels:  game-engine
Vortice.windows
.NET standard bindings for DirectX, WIC, Direct2D1, XInput, XAudio and X3DAudio
Stars: ✭ 427 (-5.53%)
Mutual labels:  game-engine

macroquad

Github Actions Docs Crates.io version Discord chat

macroquad is a simple and easy to use game library for Rust programming language, heavily inspired by raylib.

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

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
tips Adding the following snippet to your Cargo.toml ensures that all dependencies compile in release even in debug mode. In macroquad, this has the effect of making images load several times faster and your applications much more performant, while keeping compile times miraculously low.
[profile.dev.package.'*']
opt-level = 3

async/await

While macroquad attempts to use as few Rust-specific concepts as possible, .await in all examples looks a bit scary. Rust's async/await is used to solve just one problem - cross platform main loop organisation.

details

The problem: on WASM and android its not really easy to organize main loop like this:

fn main() {
    // do some initilization
    
    // start main loop
    loop {
        // handle input 

        // update logic

        // draw frame
    }
}

It is fixable on Android with threads, but on web there is not way to "pause" and "resume" WASM execution, so no WASM code should block ever. While that loop is blocking for the entire game execution! The C++ solution for that problem: https://kripken.github.io/blog/wasm/2019/07/16/asyncify.html

But in Rust we have async/await. Rust's futures is basically a continuations - future's stack may be store into a variable to later pause/resume execution of future's code.

async/await in macroquad is used without any external dependencies - no runtime, executor or even futures-rs are involved. It's just a way to preserve main's stack on WASM and keep the code cross platform without any WASM-specific main loop.

Platinum sponsors

Macroquad is supported by:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].