aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
new file mode 100644
index 0000000..7cbe359
--- /dev/null
+++ b/src/lib.rs
@@ -0,0 +1,29 @@
+mod tetris;
+mod input;
+
+use input::Input;
+
+pub struct Game {
+ tickrate: u8, // Between
+ maxfps: u8, // Between 1 and 240
+}
+impl Game {
+ pub fn new() -> Game {
+ Game{
+ tickrate: 20,
+ maxfps: 30,
+ }
+ }
+
+ // The actual game loop
+ pub fn game_loop(&self, input: &Input) {}
+}
+
+#[cfg(test)]
+mod tests {
+ #[test]
+ fn it_works() {
+ let result = 2 + 2;
+ assert_eq!(result, 4);
+ }
+}