From b3a3664578f22a980773bb61ab48b277895ac9dc Mon Sep 17 00:00:00 2001 From: Xevion Date: Tue, 25 Jul 2023 02:30:49 -0500 Subject: [PATCH] feat: game loop --- build.sh | 0 src/board.rs | 0 src/constants.rs | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/game.rs | 11 +++++++++++ 4 files changed, 55 insertions(+) mode change 100644 => 100755 build.sh create mode 100644 src/board.rs create mode 100644 src/constants.rs create mode 100644 src/game.rs diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 diff --git a/src/board.rs b/src/board.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/constants.rs b/src/constants.rs new file mode 100644 index 0000000..eadca61 --- /dev/null +++ b/src/constants.rs @@ -0,0 +1,44 @@ +pub const BOARD_WIDTH: u32 = 28; +pub const BOARD_HEIGHT: u32 = 36; +pub const BLOCK_SIZE_24: u32 = 24; +pub const BLOCK_SIZE_32: u32 = 32; + +pub const WINDOW_WIDTH: u32 = BLOCK_SIZE_24 * BOARD_WIDTH; +pub const WINDOW_HEIGHT: u32 = BLOCK_SIZE_24 * BOARD_HEIGHT; + +pub const RAW_BOARD: &str = r###" + + +############################ +#............##............# +#.####.#####.##.#####.####.# +#o####.#####.##.#####.####o# +#.####.#####.##.#####.####.# +#..........................# +#.####.##.########.##.####.# +#.####.##.########.##.####.# +#......##....##....##......# +######.##### ## #####.###### + #.##### ## #####.# + #.## 1 ##.# + #.## ###==### ##.# +######.## # # ##.###### + . #2 3 4 # . +######.## # # ##.###### + #.## ######## ##.# + #.## ##.# + #.## ######## ##.# +######.## ######## ##.###### +#............##............# +#.####.#####.##.#####.####.# +#.####.#####.##.#####.####.# +#o..##.......0 .......##..o# +###.##.##.########.##.##.### +###.##.##.########.##.##.### +#......##....##....##......# +#.##########.##.##########.# +#.##########.##.##########.# +#..........................# +############################ + + "###; \ No newline at end of file diff --git a/src/game.rs b/src/game.rs new file mode 100644 index 0000000..35178d9 --- /dev/null +++ b/src/game.rs @@ -0,0 +1,11 @@ +pub struct Game {} + +impl Game { + pub fn new() -> Game { + Game {} + } + + pub fn tick() {} + + pub fn draw() {} +} \ No newline at end of file