Skip to content
/ RTGE Public

Rust Terminal Game Engine made with ♥️ in 🦀

Notifications You must be signed in to change notification settings

jackcat13/RTGE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RTGE : Rust Terminal Game Engine

Code coverage : codecov TODO : create tools to test such "graphical" code to increase code coverage.

What is it ?

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.

Getting started

Add library to your cargo project :

cargo add rtge

Please find the create repository here.

Print a "sprite" in terminal

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 and to examples.

About

Rust Terminal Game Engine made with ♥️ in 🦀

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages