#game-engine #2d-game #ecs #sdl2 #integration #gamedev #archetypes

roast2d

Roast2D is a homebrew 2D game engine inspired by high_impact

4 releases

0.0.10 Oct 27, 2024
0.0.9 Oct 10, 2024
0.0.8 Sep 29, 2024
0.0.7 Sep 23, 2024

#787 in Game dev

Download history 141/week @ 2024-09-18 209/week @ 2024-09-25 50/week @ 2024-10-02 162/week @ 2024-10-09 6/week @ 2024-10-16 101/week @ 2024-10-23 21/week @ 2024-10-30 1/week @ 2024-11-06

132 downloads per month

MIT license

250KB
5K SLoC

Roast2D

Crates.io Docs CI

Roast2D is a rapid development 2D game engine written in Rust. Inspired by high_impact.

I wrote an article explaining why Roast2D was made

Features

  • Poor man's ECS, no archetype, just a little bit ECS to improve the composition ability
  • Simple physics and collision
  • LDTK editor integration
  • Multi-platform (via SDL2 and WebAssembly)

Examples

  • A copy of the classic breakout shows the basic usage
  • A 2D platformer prototype balloon game shows how to integrate with LDTK, kira (audio) and support web platform.

Usage

Run example:

cargo run --example breakout

Add roast2d to Rust project:

cargo add roast2d

Roast2D supports multiple backends:

SDL2

SDL2 is the default backend when you build for Linux / Mac / Windows.

Make sure the SDL2 library is installed on your machine before developing. This document can help to install SDL2.

WebAssembly

WebAssembly backend is implement with web canvas interface, you must make sure the game can build with wasm32-unknown-unknown target. Ensure you have wasm-pack installed, and use wasm-pack build to build project.

To render the game, ensure you provide a <canvas> element with the id #roast-2d-canvas.

License

The source code is licensed under MIT.

Dependencies

~9–15MB
~330K SLoC