Crates.io | rtge |
lib.rs | rtge |
version | 0.3.0 |
source | src |
created_at | 2023-08-09 13:06:20.246037 |
updated_at | 2023-08-16 15:54:55.777927 |
description | Rust Terminal Game Engine made with ♥️ in 🦀 |
homepage | |
repository | https://github.com/jackcat13/RTGE |
max_upload_size | |
id | 940043 |
size | 55,140 |
The purpose of this project is to provide a library in order to do graphical rendering in a terminal with Rust language 🦀.
But why ? Because it's a fun achievement and it allows to developp fun games bazingly fast within terminals.
Add library to your cargo project :
cargo add rtge
fn main() {
let mut bob = Entity {
name: "bob".to_string(),
sprite: load_sprite("./manualTests/bob.json".to_string()),
position: Position { x: 100, y: 100 },
direction: Direction {
up: false,
down: false,
left: false,
right: false,
},
speed: 2,
};
let entities = vec![bob];
print_sprites(&entities);
}
The "sprite" definition can be found here : https://github.com/jackcat13/RTGE/blob/main/manualTests/bob.json
You need to first define an entity to represent the sprite to print. Then, the print_sprites
method is responsible to print the entities at the proper places.
Note : To use the other features, plase take a look at the documentation (in progress) and to examples.