aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcurly <curlybryce@protonmail.com>2022-08-13 17:55:31 -0600
committercurly <curlybryce@protonmail.com>2022-08-13 17:55:31 -0600
commit008c2b23c78f8969c9741e537326c13b98c27b58 (patch)
treebfe5f362d3a45f57e5b234c00389962074856b0a /src
parent1d1ca2fdae780efdb9d27394f5d3720fe9282c91 (diff)
downloadtetris-008c2b23c78f8969c9741e537326c13b98c27b58.tar.gz
tetris-008c2b23c78f8969c9741e537326c13b98c27b58.tar.bz2
tetris-008c2b23c78f8969c9741e537326c13b98c27b58.zip
fixed my module mistakes
Diffstat (limited to 'src')
-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