diff --git a/assets/button.wav b/src/bin/assets/button.wav similarity index 100% rename from assets/button.wav rename to src/bin/assets/button.wav diff --git a/assets/caskaydia.ttf b/src/bin/assets/caskaydia.ttf similarity index 100% rename from assets/caskaydia.ttf rename to src/bin/assets/caskaydia.ttf diff --git a/assets/click.wav b/src/bin/assets/click.wav similarity index 100% rename from assets/click.wav rename to src/bin/assets/click.wav diff --git a/assets/loss.wav b/src/bin/assets/loss.wav similarity index 100% rename from assets/loss.wav rename to src/bin/assets/loss.wav diff --git a/assets/mode.wav b/src/bin/assets/mode.wav similarity index 100% rename from assets/mode.wav rename to src/bin/assets/mode.wav diff --git a/assets/pieces.png b/src/bin/assets/pieces.png similarity index 100% rename from assets/pieces.png rename to src/bin/assets/pieces.png diff --git a/assets/win.wav b/src/bin/assets/win.wav similarity index 100% rename from assets/win.wav rename to src/bin/assets/win.wav diff --git a/src/bin/sol_chess/game.rs b/src/bin/sol_chess/game.rs new file mode 100644 index 0000000..d56338a --- /dev/null +++ b/src/bin/sol_chess/game.rs @@ -0,0 +1,94 @@ +use std::{ + collections::HashMap, + fmt::{self, Display, Formatter}, + sync::Arc, +}; + +mod button; +mod color; +pub mod constants; +mod draw; +mod logic; +mod shadow; +pub mod sound; +mod texture; + +use button::Button; +use macroquad::prelude::*; +use sol_chess::board::{Board, BoardState}; +use sound::Sounds; + +pub struct Game { + // The generated puzzle. We keep a copy of this to reset the game. + original_board: Board, + + // What is shown to the user + board: Board, + + // Constants througout the game + texture_res: Texture2D, + sounds: Sounds, + font: Arc, + num_squares: usize, + heading_text: String, + + // Update below on handle input + state: GameState, + debug: bool, + game_mode: GameMode, + + // Update below on window resize + // Used for drawing the state + square_width: f32, + window_height: f32, + window_width: f32, + board_rect: Rect, + squares: Vec, + heading_rect: Rect, + heading_font_size: f32, + gp_btns: HashMap, + mode_btns: HashMap, + rules: bool, + rules_btn: Option