diff --git a/src/game.rs b/src/game.rs index 0daf88a..129d023 100644 --- a/src/game.rs +++ b/src/game.rs @@ -1 +1,500 @@ +use std::fmt::{self, Display, Formatter}; + +use button::{Button, ButtonAction}; +use macroquad::prelude::*; +use sol_chess::{ + board::{Board, BoardState}, + generator, +}; +use texture::PieceTexture; + +pub mod button; pub mod texture; + +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, + num_squares: usize, + heading_font_size: f32, + heading_text: String, + + // Update below on handle input + state: GameState, + debug: bool, + + // Update below on window resize + // Used for drawing the state + square_width: f32, + window_height: f32, + window_width: f32, + squares: Vec, + heading_rect: Rect, + btns: Vec