If you like Rusty Engine, please sponsor me [on GitHub] or [on Patreon], or take one of my courses. 💖
Rusty Engine is a simple, 2D game engine for those who are learning Rust. Create simple game prototypes using straightforward Rust code without any advanced game engine concepts! It works on macOS, Linux, and Windows. Rusty Engine is a simplification wrapper over [Bevy], which I encourage you to use directly for more serious game engine needs.
[Questions], [bug reports], and contributions are most welcome!
https://user-images.githubusercontent.com/5838512/122880590-651bae00-d2f7-11eb-8e5c-4810b3777828.mp4
I teach courses which use this game engine:
Ultimate Rust 2: Intermediate Concepts
on Udemy, etc. Coming soon!If you are using Linux or Windows Subsystem for Linux 2, please visit Bevy's Installing Linux Dependencies page and follow the instructions to install needed dependencies.
Here are three different ways to download the assets (it should end up the same in the end):
- Clone the rusty_engine
repository and copy/move the assets/
directory over to your own project
- Download a zip file or tarball of the rusty_engine
repository, extract it, and copy/move the assets/
directory over to your own project.
- On a posix compatible shell, run this command inside your project directory:
shell
curl -L https://github.com/CleanCut/rusty_engine/archive/refs/heads/main.tar.gz | tar -zxv --strip-components=1 rusty_engine-main/assets
Add rusty_engine
as a dependency
```toml
rusty_engine = "2.0.0" ```
Write your game!
```rust // In main.rs use rusty_engine::prelude::*;
fn main() {
let mut game = Game::new();
// Use game
to initialize starting state.
let racecar: &mut Actor = game.addactor("race car", ActorPreset::RacingCarYellow);
racecar.translation = Vec2::new(-100.0, -100.0);
racecar.rotation = NORTHEAST;
racecar.scale = 2.0;
// Then do game.run()
to start the game.
game.run(game_logic);
}
// This function is called once per frame fn gamelogic(gamestate: &mut GameState) { // Your game logic goes here }
```
Run your game with cargo run --release
!
See also the game scenarios, code examples and the API documentation
All software contributions are assumed to be dual-licensed under MIT/Apache-2. All asset contributions must be under licenses compatible with the software license, and explain their license(s) in a README.md
file in the same directory as the source files.
All assets included with this game engine have the appropriate license described and linked to in a README.md
file in the same directory as the source files. In most cases, the license is CC0 1.0 Universal--meaning you may do whatever you wish with the asset.
One notable exception is some of the music files, which are under a different license and include specific attribution requirements that must be met in order to be used legally when distributed. Please see this README.md
file for more information.
Distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See license/APACHE and license/MIT.