{"id":20721491,"url":"https://github.com/cleancut/rusty_engine","last_synced_at":"2025-04-08T10:24:23.995Z","repository":{"id":37026365,"uuid":"247404772","full_name":"CleanCut/rusty_engine","owner":"CleanCut","description":"2D game engine for learning Rust","archived":false,"fork":false,"pushed_at":"2024-05-10T21:56:58.000Z","size":13150,"stargazers_count":383,"open_issues_count":6,"forks_count":48,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-01T08:44:12.104Z","etag":null,"topics":["2d","game-engine","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CleanCut.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"license/APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-15T05:03:03.000Z","updated_at":"2025-03-16T20:32:48.000Z","dependencies_parsed_at":"2023-12-02T23:23:34.816Z","dependency_job_id":"9e654192-d77f-4181-812f-a5c34607ec51","html_url":"https://github.com/CleanCut/rusty_engine","commit_stats":{"total_commits":325,"total_committers":9,"mean_commits":"36.111111111111114","dds":"0.040000000000000036","last_synced_commit":"ef3652e437acb36f2b64cfcd2c125543b0e1bb9c"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanCut%2Frusty_engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanCut%2Frusty_engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanCut%2Frusty_engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanCut%2Frusty_engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CleanCut","download_url":"https://codeload.github.com/CleanCut/rusty_engine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247821320,"owners_count":21001650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2d","game-engine","rust"],"created_at":"2024-11-17T03:28:04.154Z","updated_at":"2025-04-08T10:24:23.964Z","avatar_url":"https://github.com/CleanCut.png","language":"Rust","readme":"# Rusty Engine\n\nRusty 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.\n\n[Questions], [bug reports], and contributions are most welcome!\n\nhttps://user-images.githubusercontent.com/5838512/122880590-651bae00-d2f7-11eb-8e5c-4810b3777828.mp4\n\n## Documentation\n\n- [Tutorial](https://cleancut.github.io/rusty_engine/)\n- [API Reference](https://docs.rs/rusty_engine/latest/rusty_engine/)\n- [Code Examples](https://github.com/CleanCut/rusty_engine/tree/main/examples)\n- [Game Scenarios](https://github.com/CleanCut/rusty_engine/tree/main/scenarios)\n\n## Features\n\n- Asset pack included (sprites, music, sound effects, and fonts)\n- Sprites (2D images)\n  - Use sprites from the included asset pack, or bring your own\n  - Collision detection with custom colliders\n- Audio (music \u0026 sound effects)\n  - Looping music\n  - Multi-channel sound effects\n- Text\n  - 2 fonts included, or bring your own\n- Input handling (keyboard, mouse)\n- Timers\n- Custom game state\n- Window customization\n\n## Courses\n\nIf you like Rusty Engine, please sponsor me [on GitHub] or [on Patreon], or take one of my courses below!\n\nThe following courses use Rusty Engine in their curriculum:\n\n- [Ultimate Rust 2: Intermediate Concepts](https://www.udemy.com/course/ultimate-rust-2/?referralCode=8ED694EBE5637F954414) on Udemy (the sequel to [Ultimate Rust Crash Course](https://www.udemy.com/course/ultimate-rust-crash-course/?referralCode=AF30FAD8C6CCCC2C94F0))\n- [Rust in 3 Weeks](https://agileperception.com) conducted live on O'Reilly Online approximately once each quarter.\n\n## Linux Dependencies (Including WSL 2)\n\nIf you are using Linux or Windows Subsystem for Linux 2, please visit Bevy's [Installing Linux Dependencies](https://github.com/bevyengine/bevy/blob/main/docs/linux_dependencies.md) page and follow the instructions to install needed dependencies.\n\n## Quick Start\n\n### You MUST download the assets separately!!!\n\nHere are three different ways to download the assets (pick any of them--it should end up the same in the end):\n- Clone the `rusty_engine` repository and copy/move the `assets/` directory over to your own project\n- Download a [zip file](https://github.com/CleanCut/rusty_engine/archive/refs/heads/main.zip) or [tarball](https://github.com/CleanCut/rusty_engine/archive/refs/heads/main.tar.gz) of the `rusty_engine` repository, extract it, and copy/move the `assets/` directory over to your own project.\n- (My favorite!) On a posix compatible shell, run this command inside your project directory:\n```shell\ncurl -L https://github.com/CleanCut/rusty_engine/archive/refs/heads/main.tar.gz | tar -zxv --strip-components=1 rusty_engine-main/assets\n```\n\nAdd `rusty_engine` as a dependency\n\n```toml\n# In your [dependencies] section of Cargo.toml\nrusty_engine = \"6.0.0\"\n```\n\nWrite your game!\n\n```rust\n// in src/main.rs\n use rusty_engine::prelude::*;\n\n // Define a struct to hold custom data for your game (it can be a lot more complicated than this one!)\n #[derive(Resource)]\n struct GameState {\n     health: i32,\n }\n\n fn main() {\n     // Create a game\n     let mut game = Game::new();\n     // Set up your game. `Game` exposes all of the methods and fields of `Engine`.\n     let sprite = game.add_sprite(\"player\", SpritePreset::RacingCarBlue);\n     sprite.scale = 2.0;\n     game.audio_manager.play_music(MusicPreset::Classy8Bit, 0.1);\n     // Add one or more functions with logic for your game. When the game is run, the logic\n     // functions will run in the order they were added.\n     game.add_logic(game_logic);\n     // Run the game, with an initial state\n     let initial_game_state = GameState { health: 100 };\n     game.run(initial_game_state);\n }\n\n // Your game logic functions can be named anything, but the first parameter is always a\n // `\u0026mut Engine`, and the second parameter is a mutable reference to your custom game\n // state struct (`\u0026mut GameState` in this case).\n //\n // This function will be run once each frame.\n fn game_logic(engine: \u0026mut Engine, game_state: \u0026mut GameState) {\n     // The `Engine` contains all sorts of built-in goodies.\n     // Get access to the player sprite...\n     let player = engine.sprites.get_mut(\"player\").unwrap();\n     // Rotate the player...\n     player.rotation += std::f32::consts::PI * engine.delta_f32;\n     // Damage the player if it is out of bounds...\n     if player.translation.x \u003e 100.0 {\n         game_state.health -= 1;\n     }\n }\n```\n\nRun your game with `cargo run --release`!\n\n\u003cimg width=\"1348\" alt=\"example screenshot\" src=\"https://user-images.githubusercontent.com/5838512/146858022-1d91c7f4-8b21-4f85-a72a-c4b93edcabc6.png\"\u003e\n\n\nSee also the [tutorial](https://cleancut.github.io/rusty_engine/), [game scenarios](https://github.com/CleanCut/rusty_engine/tree/main/scenarios), [code examples](https://github.com/CleanCut/rusty_engine/tree/main/examples) and the [API documentation](https://docs.rs/rusty_engine/latest/rusty_engine/)\n\n## Student Showcase\n\nShow off the project you made with Rusty Engine! Learning Rust can be fun. 😄 Just [send me a link](https://agileperception.com/contact) and I'll add it to the list!\n\n- [Rusty Asteroids](https://github.com/etnt/rusty-asteroids) by [@etnt](https://github.com/etnt)\n- [Rusty Breakout](https://github.com/etnt/rusty-breakout) by [@etnt](https://github.com/etnt)\n\n## Contribution\n\nAll 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.\n\n## Asset Licenses\n\nAll 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](https://creativecommons.org/publicdomain/zero/1.0/)--meaning you may do whatever you wish with the asset.\n\nOne 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](./assets/audio/music) for more information.\n\n## Software License\n\nDistributed under the terms of both the MIT license and the Apache License (Version 2.0).\n\nSee [license/APACHE](license/APACHE) and [license/MIT](license/MIT).\n\n[CPAL]: https://github.com/RustAudio/cpal\n[Questions]: https://github.com/CleanCut/rusty_engine/discussions\n[Ultimate Rust Crash Course]: https://agileperception.com/ultimate_rust_crash_course\n[bug reports]: https://github.com/CleanCut/rusty_engine/issues/new\n[rendy]: https://github.com/amethyst/rendy\n[on GitHub]: https://github.com/sponsors/CleanCut\n[on Patreon]: https://patreon.com/nathanstocks\n[Bevy]: https://bevyengine.org/\n","funding_links":["https://github.com/sponsors/CleanCut","https://patreon.com/nathanstocks"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleancut%2Frusty_engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcleancut%2Frusty_engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleancut%2Frusty_engine/lists"}