summaryrefslogtreecommitdiffstats
path: root/src/main.rs
blob: 9b49ea6d6f8c550ccecbff5c9792a4130bf376c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use std::io::{stdin, stdout};

use rustic_adventure::{physics::Position, structure::Building, Game};

fn main() {
    let stdin = stdin();
    let stdout = stdout();

    let mut game = Game::default();

    let building = Building::builder()
        .width(50)
        .height(50)
        .position((10, 10))
        .build();

    game.structures.push(building);
    game.player.set_position((5, 5)).unwrap();

    if let Err(err) = game.run_loop(stdin, stdout) {
        eprintln!("{}", err)
    }
}