aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/input.rs7
-rw-r--r--src/lib.rs4
-rw-r--r--src/main.rs12
3 files changed, 13 insertions, 10 deletions
diff --git a/src/input.rs b/src/input.rs
index d4a5ddd..23d0040 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -1 +1,6 @@
-pub struct Input {} \ No newline at end of file
+pub struct Input {}
+impl Input {
+ pub fn new() -> Input {
+ Input{}
+ }
+} \ No newline at end of file
diff --git a/src/lib.rs b/src/lib.rs
index 7cbe359..ce1d7ad 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,7 +1,7 @@
+pub mod input;
mod tetris;
-mod input;
-use input::Input;
+use crate::input::Input;
pub struct Game {
tickrate: u8, // Between
diff --git a/src/main.rs b/src/main.rs
index 1abfbd9..aba1e8f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,10 +1,8 @@
-mod lib;
-mod display;
-mod input;
+use tetris::Game;
+use tetris::input::Input;
fn main() {
- println!("Hello World!");
- let tetris = lib::Tetris::new();
-
- display::display(tetris.return_grid());
+ let input = Input::new();
+ let game = Game::new();
+ game.game_loop(&input)
} \ No newline at end of file