aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorIago Garrido <iago086@gmail.com>2019-11-12 14:55:19 +0100
committerIago Garrido <iago086@gmail.com>2019-11-12 14:55:19 +0100
commit76fc41b3c803ad4db3c19a76d408ab301438aa1e (patch)
tree99df93ff7678775a4cb179fbd6a0b52a15ede426 /src/main.rs
parentd84906ec92e45ed2cf2611c2f646d72ef5f1bb64 (diff)
parent8fa3fa881bc3b954e136295fe6cc7022737ae9db (diff)
Merge branch 'master' of https://github.com/Etenil/roguerust
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/main.rs b/src/main.rs
index 8662438..12e92c9 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -4,33 +4,36 @@ extern crate pancurses;
#[macro_use]
extern crate text_io;
-mod character;
-mod computer;
mod state;
+mod entities;
mod world;
+mod tiling;
-use character::Player;
-use character::Character;
+use entities::Player;
use pancurses::{
initscr,
endwin,
- Input
+ Input,
+ noecho
};
use state::State;
use world::Dungeon;
fn main() {
+ let window = initscr();
+
let mut state = State::new(
- Character::new(
+ Player::new(
"Kshar".to_string(),
- "Warror".to_string(),
+ "Warrior".to_string(),
30,
10,
10,
20,
+ (0, 0)
),
- Dungeon::new(80, 24, 5),
+ Dungeon::new(window.get_max_x() as usize, window.get_max_y() as usize, 5),
);
state.init();
@@ -38,10 +41,11 @@ fn main() {
// Dump the whole dungeon structure in terminal for debugging
state.debug();
- let window = initscr();
-
state.render_level(&window);
+ window.keypad(true);
+ noecho();
+
loop {
// update actors
// update character
@@ -61,6 +65,4 @@ fn main() {
}
}
endwin();
-
- println!("You quit with {} gold pieces", state.character.get_gold())
}