All Projects → CleanCut → rusty_engine

CleanCut / rusty_engine

Licence: other
2D game engine for learning Rust

Programming Languages

rust
11053 projects
shell
77523 projects

Projects that are alternatives of or similar to rusty engine

Unity Aseprite Importer
An aseprite-file importer for unity written in C#, built upon the experimental AssetImporter API
Stars: ✭ 177 (-37.46%)
Mutual labels:  2d
Pixieditor
PixiEditor is a lightweight pixel art editor made with .NET 5
Stars: ✭ 210 (-25.8%)
Mutual labels:  2d
Physicsexamples2d
Examples of various Unity 2D Physics components and features.
Stars: ✭ 250 (-11.66%)
Mutual labels:  2d
Visvis
Visvis - the object oriented approach to visualization
Stars: ✭ 180 (-36.4%)
Mutual labels:  2d
Pencil.js
✏️ Nice modular interactive 2D drawing library
Stars: ✭ 204 (-27.92%)
Mutual labels:  2d
Graphics32
Graphics32 is a graphics library for Delphi and Lazarus. Optimized for 32-bit pixel formats, it provides fast operations with pixels and graphic primitives. In most cases Graphics32 considerably outperforms the standard TBitmap/TCanvas methods.
Stars: ✭ 238 (-15.9%)
Mutual labels:  2d
Black
World's fastest HTML5 2D game engine   🛸
Stars: ✭ 174 (-38.52%)
Mutual labels:  2d
footile
A 2D vector graphics library written in Rust
Stars: ✭ 32 (-88.69%)
Mutual labels:  2d
Picasso
Picasso is a high quality 2D vector graphic rendering library. It support path , matrix , gradient , pattern , image and truetype font.
Stars: ✭ 205 (-27.56%)
Mutual labels:  2d
Mathnet Spatial
Math.NET Spatial
Stars: ✭ 246 (-13.07%)
Mutual labels:  2d
Godot 3 2d Crt Shader
A 2D shader for Godot 3 simulating a CRT
Stars: ✭ 183 (-35.34%)
Mutual labels:  2d
Webgl Plot
A high-Performance real-time 2D plotting library based on native WebGL
Stars: ✭ 200 (-29.33%)
Mutual labels:  2d
Delaunator Cpp
A really fast C++ library for Delaunay triangulation of 2D points
Stars: ✭ 244 (-13.78%)
Mutual labels:  2d
3d Bat
3D Bounding Box Annotation Tool (3D-BAT) Point cloud and Image Labeling
Stars: ✭ 179 (-36.75%)
Mutual labels:  2d
Gg
Go Graphics - 2D rendering in Go with a simple API.
Stars: ✭ 3,162 (+1017.31%)
Mutual labels:  2d
Creature ue4
Unreal Engine 4 Runtimes for Creature, the 2D Skeletal + Mesh Animation Tool
Stars: ✭ 174 (-38.52%)
Mutual labels:  2d
Rustarok
Multiplayer, fast-paced Moba style game
Stars: ✭ 223 (-21.2%)
Mutual labels:  2d
BlazorCanvas
Simple 2D gamedev examples using Blazor and .NET 5
Stars: ✭ 99 (-65.02%)
Mutual labels:  2d
glider
Generative music using conway's game of life
Stars: ✭ 38 (-86.57%)
Mutual labels:  2d
Strife
a simple 2d game framework
Stars: ✭ 246 (-13.07%)
Mutual labels:  2d

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 needing to learning difficult 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!

Documentation

Features

  • Asset pack included (sprites, music, sound effects, and fonts)
  • Sprites (2D images)
    • Use sprites from the included asset pack, or bring your own
    • Collision detection with custom colliders
  • Audio (music & sound effects)
    • Looping music
    • Multi-channel sound effects
  • Text
    • 2 fonts included, or bring your own
  • Input handling (keyboard, mouse)
  • Timers
  • Custom game state
  • Window customization

Courses

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

The following courses use Rusty Engine in their curriculum:

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 (pick any of them--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.
  • (My favorite!) 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 = "5.2.1"

Write your game!

// in src/main.rs
 use rusty_engine::prelude::*;

 // Define a struct to hold custom data for your game (it can be a lot more complicated than this one!)
 struct GameState {
     health: i32,
 }

 fn main() {
     // Create a game
     let mut game = Game::new();
     // Set up your game. `Game` exposes all of the methods and fields of `Engine`.
     let sprite = game.add_sprite("player", SpritePreset::RacingCarBlue);
     sprite.scale = 2.0;
     game.audio_manager.play_music(MusicPreset::Classy8Bit, 1.0);
     // Add one or more functions with logic for your game. When the game is run, the logic
     // functions will run in the order they were added.
     game.add_logic(game_logic);
     // Run the game, with an initial state
     let initial_game_state = GameState { health: 100 };
     game.run(initial_game_state);
 }

 // Your game logic functions can be named anything, but the first parameter is always a
 // `&mut Engine`, and the second parameter is a mutable reference to your custom game
 // state struct (`&mut GameState` in this case).
 //
 // This function will be run once each frame.
 fn game_logic(engine: &mut Engine, game_state: &mut GameState) {
     // The `Engine` contains all sorts of built-in goodies.
     // Get access to the player sprite...
     let player = engine.sprites.get_mut("player").unwrap();
     // Rotate the player...
     player.rotation += std::f32::consts::PI * engine.delta_f32;
     // Damage the player if it is out of bounds...
     if player.translation.x > 100.0 {
         game_state.health -= 1;
     }
 }

Run your game with cargo run --release!

example screenshot

See also the tutorial, game scenarios, code examples and the API documentation

Student Showcase

Show off the project you made with Rusty Engine! Learning Rust can be fun. 😄 Just send me a link and I'll add it to the list!

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].