A framework for making games with rust
This framework is made out of three parts:
- sdl_helper - for hiding the implementation details of sdl2 in rust, and some helper functions for game development
- tiled - (in lib dir) for loading Tiled maps
- geometry - (in lib dir) for rectangle and vector maths
See the example folder (run with cargo run --example (name-of-example.rs)
.
Features
- window creation and keyboard/mouse input
- loading and drawing textures and fonts to the screen
- loading and drawing Tiled maps
- 2D camera for scaling and moving drawn textures and fonts
- loading and playing music and sound effect
Setup
- Clone this repository
- Install Rust if you haven't already
- Install SDL2, SDL2image, SDL2mixer, SDL2_ttf
- go to the root directory of this project and run
$ cargo run --example main
Installing SDL2 on debian-based systems
Run the following command
$ sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev
Installing SDL2 on other systems
Follow the instructions for your system given in the repo for rust-sdl2, but remember you also need to get sdl2mixer, sdl2ttf and sdl2_image libraries.
Dependancies
- rust-sdl2 for windowing, rendering, input, resource loading
- quick_xml for loading tiled maps
Projects using this framework
TODO
- Better resolution controls