rusty_engine 1.1.3

Learn Rust with a simple, cross-platform, 2D game engine.
Documentation

If you like Rusty Engine, please sponsor me on GitHub or on Patreon, or take one of my courses. 💖

Rusty Engine

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

Features

  • Sprites (2D images)
    • Includes 2 built-in asset packs
  • Audio (music & sound effects)
    • Includes 2 built-in asset packs
  • Collision detection
  • Text
    • Includes 2 built-in fonts
  • Input handling (keyboard, mouse)
  • Timers

Courses

I teach courses which use this game engine:

  • Ultimate Rust 2: Intermediate Concepts on Udemy, etc. Coming soon!
  • Rust in 3 Weeks conducted live on O'Reilly Online.

Linux Dependencies (Including WSL 2)

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.

Quick Start

You MUST download the assets separately!!!

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:
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

# In your [dependencies] section of Cargo.toml
rusty_engine = "1.1.3"

Write your game!

// In main.rs
use rusty_engine::prelude::*;

fn main() {
    let mut game = Game::new();
    // Use `game` to initialize starting state.
    let race_car: &mut Actor = game.add_actor("race car", ActorPreset::RacingCarYellow);
    race_car.translation = Vec2::new(-100.0, -100.0);
    race_car.rotation = NORTH_EAST;
    race_car.scale = 2.0;
    // Then do `game.run()` to start the game.
    game.run(game_logic);
}

// This function is called once per frame
fn game_logic(game_state: &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

Contribution

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.

Asset Licenses

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.

Software License

Distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See license/APACHE and license/MIT.