more elements displayed so it doesn't look SUPER ugly
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -42,7 +42,7 @@ fn main() {
|
|||||||
let _square_center = square_widf / 2;
|
let _square_center = square_widf / 2;
|
||||||
//7,9 are the values to center the circle
|
//7,9 are the values to center the circle
|
||||||
let mut state: GameState = GameState::MainMenu(MenuState::default());
|
let mut state: GameState = GameState::MainMenu(MenuState::default());
|
||||||
let mut strategy = Strategy::MiniMax;
|
let mut strategy = Strategy::AlphaBeta;
|
||||||
let mut difficulty = 3;
|
let mut difficulty = 3;
|
||||||
|
|
||||||
rl.set_target_fps(60);
|
rl.set_target_fps(60);
|
||||||
@@ -54,6 +54,7 @@ fn main() {
|
|||||||
strategy = mstate.strategy.clone();
|
strategy = mstate.strategy.clone();
|
||||||
difficulty = mstate.difficulty.clone();
|
difficulty = mstate.difficulty.clone();
|
||||||
state = GameState::Play(PlayState::default());
|
state = GameState::Play(PlayState::default());
|
||||||
|
dbg!(&strategy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GameState::Play(ref mut state) => {
|
GameState::Play(ref mut state) => {
|
||||||
@@ -80,6 +81,14 @@ fn main() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
d.draw_texture(&board_texture, BOARDSTART.0, BOARDSTART.1, Color::VIOLET);
|
||||||
|
let scores = state.board.getscore();
|
||||||
|
let scores_display = format!(
|
||||||
|
"Player Score: {} \n CPU Score: {}\n Difficulty: {}\n Strategy: {},
|
||||||
|
\n Last move: {}",
|
||||||
|
scores.0, scores.1, difficulty, strategy, state.board.last_move
|
||||||
|
);
|
||||||
|
d.draw_text(&scores_display, 500, 200, 15, Color::BLACK);
|
||||||
|
|
||||||
for circle in state.clone().circles {
|
for circle in state.clone().circles {
|
||||||
let (x, y, disk) = circle;
|
let (x, y, disk) = circle;
|
||||||
@@ -91,7 +100,6 @@ fn main() {
|
|||||||
d.draw_texture(&circle_texture, x, y, color);
|
d.draw_texture(&circle_texture, x, y, color);
|
||||||
}
|
}
|
||||||
d.clear_background(Color::WHITE);
|
d.clear_background(Color::WHITE);
|
||||||
d.draw_texture(&board_texture, BOARDSTART.0, BOARDSTART.1, Color::VIOLET);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user