#2d-game #game-engine #sdl2 #entity #gamedev #ecs #multi-platform

yanked roast-2d

Roast2D is a homebrew 2D game engine inspired by high_impact

6 releases

0.0.6 Sep 22, 2024
0.0.5 Aug 29, 2024

#44 in #multi-platform

Download history 87/week @ 2024-08-06 159/week @ 2024-08-13 288/week @ 2024-08-20 125/week @ 2024-08-27 8/week @ 2024-09-10 132/week @ 2024-09-17 30/week @ 2024-09-24 28/week @ 2024-10-01

423 downloads per month

MIT license

165KB
4.5K SLoC

Roast2D

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

  • Non ECS, just built-in entity with trait extension
  • Simple physics and collision detection
  • LDTK level editor integration
  • Multi-platform (via SDL2 and WebAssembly)

Examples

  • An mini ping-pong game 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 demo

Add roast-2d to Rust project:

cargo add roast-2d

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

~8–14MB
~318K SLoC