From 008c2b23c78f8969c9741e537326c13b98c27b58 Mon Sep 17 00:00:00 2001 From: curly Date: Sat, 13 Aug 2022 17:55:31 -0600 Subject: fixed my module mistakes --- src/input.rs | 7 ++++++- src/lib.rs | 4 ++-- src/main.rs | 12 +++++------- 3 files changed, 13 insertions(+), 10 deletions(-) (limited to 'src') 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 -- cgit v1.2.3