Thanks to visit codestin.com
Credit goes to lib.rs

#2d-game-engine #2d-graphics #retro-game #graphics #retro

no-std musi_lili

musi_lili is a retro game engine for GB styled games written in Rust. Inspired by pico8.

3 releases (breaking)

0.3.0 May 13, 2025
0.2.0 Jan 22, 2025
0.1.0 Dec 22, 2024

#2097 in Game dev

Codestin Search App

180 downloads per month

LGPL-3.0-only and GPL-3.0-only…

395KB
7K SLoC

lili

Go to README.


lib.rs:

musi lili

musi lili is a retro game engine for GB styled games written in Rust. Inspired by pico8.

How to use this crate

Add musi_lili to your Cargo.toml file

[package]
name = "my_game"
version = "0.1.0"
edition = "2021"

[dependencies]
musi_lili = { version = "0.3" }

Create your game

Create a struct that defines your game and implements the musi_lili::Game trait. After that you can start your game by calling musi_lil::run with the type of your game.

use musi_lili::{Game, Lili};

struct MyGame;

impl Game for MyGame {
fn init(_lili: &Lili) -> Self {
Self
}

fn update(&mut self, _lili: &Lili) {
// the code to update your game
}

fn draw(&mut self, lili: &Lili) {
// draw your game
lili.clear(0);
lili.txt("toki", 5, 5, 3);
}
}

fn main() {
musi_lili::run::<MyGame>(musi_lili::load!("my-game"));
}

Cargo Features

  • std: use rust std (default).
  • gamepad: activate gamepad support (needs libudev to be installed).
  • slint-femtovg: use winit with femtovg renderer as slint backend (default).
  • slint-software: use winit with software renderer as slint backend.
  • experimental: enable this feature to try out experimental features that are not yet ready for production.

Used third party libraries

Library License Used for
Slint GNU GPlv3, Royalty-free or Paid Window, framebuffer and event handling
embedded-graphics Apache 2.0 or MIT Pixel art drawing
dirs-next Apache 2.0 or MIT Get user settings path
serde Apache 2.0 or MIT Serialize / Deserialize game data
serde-json Apache 2.0 or MIT Serialize / Deserialize game data
gilrs Apache 2.0 or MIT Support for game controllers
web-time Apache 2.0 or MIT Use Instant::now() on the web
web-sys Apache 2.0 or MIT Used for web save game management

Dependencies

~37–81MB
~1.5M SLoC