| Crates.io | lotus_engine |
| lib.rs | lotus_engine |
| version | 0.2.2 |
| created_at | 2025-03-17 16:32:57.1975+00 |
| updated_at | 2025-09-10 03:01:16.936569+00 |
| description | Lotus is a game engine with the main focus of being easy-to-use and straight forward on developing 2D games. |
| homepage | |
| repository | https://github.com/zenialexandre/lotus |
| max_upload_size | |
| id | 1595680 |
| size | 1,948,747 |
Lotus is a game engine with the main focus of being easy-to-use and straight forward on developing 2D games.
It's based on the Entity-Component-System paradigm, providing windowing, rendering, physics, input handling, and more.
Heavily inspired by awesome open-source projects like Bevy, Comfy and LÖVE.
First full game made with Lotus: CyberLancer: Neon Rush.
With the power of macros, the engine basic template could be very abstracted and easy to look up to.
The your_game! macro only needs three parameters to make a game real.
-> The window configuration
-> The setup function
-> The update function
Make sure your textures, fonts, sounds and all that nice stuff are inside of the assets folder located in the root of your project!
The engine will use the CARGO_MANIFEST_DIR to search for your assets and make sure that all is loaded correctly.
Your folder tree should look similar to this:
my_awesome_2d_application/
├── assets/
│ ├── textures/
│ ├── fonts/
│ ├── sounds/
│ └── ...
├── src/
│ ├── main.rs
└── Cargo.toml
You should use your relative paths like this:
use lotus_engine::*;
your_game!(
WindowConfiguration::default(),
setup,
update
);
fn setup(_context: &mut Context) {
// As you can see, you DON'T need to use 'assets/' in your relative path.
let sprite: Sprite = Sprite::new("textures/lotus_pink_256x256.png".to_string());
}
fn update(_context: &mut Context) {}
Lotus uses a custom Entity-Component-System (ECS) archictecture.
You can see the documentation about it here.
As a brief overview:
The classic hello world:
use lotus_engine::*;
your_game!(
WindowConfiguration::default(),
setup,
update
);
fn setup(_context: &mut Context) {}
fn update(_context: &mut Context) {
eprintln!("Hello World!");
}
Refer to the tutorial.
And here are some more complex initial examples to demonstrate the engine's potential:
examples/pong.rsexamples/breakout.rsexamples/simple_shapes.rsexamples/simple_sprite.rsexamples/physics_simulation.rsexamples/gravity_simulation.rsLotus is a normal Rust dependency, therefore an empty Lotus project is very easy to set up. You should use the latest stable version of rustc or above.
rustc --version
cargo init --bin
[dependencies]
lotus_engine = "0.1.x"
cargo add lotus_engine
cargo run
Its very simple to export your brand new Lotus project for distribution.
cargo build --release
Then you can go to target/release/ to get your executable archive.
-> It should be the executable that only has your project name.
-> Something like nice-project-name.exe.
As of a commmon step on releasing indie games, you should send your executable archive along side your assets folder.
So your file tree should look like this:
nice-project-release/
├── assets
├── nice-project-name.exe