mirror of
https://github.com/szymon-jozef/checkers.git
synced 2026-10-27 19:20:44 +01:00
feat: add yellow border to dames
This commit is contained in:
@@ -5,7 +5,7 @@ use std::{
|
|||||||
|
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use macroquad::{
|
use macroquad::{
|
||||||
color::{BLACK, Color, GREEN, RED, WHITE},
|
color::{BLACK, Color, GREEN, RED, WHITE, YELLOW},
|
||||||
input::{is_mouse_button_pressed, mouse_position},
|
input::{is_mouse_button_pressed, mouse_position},
|
||||||
math::{Rect, vec2},
|
math::{Rect, vec2},
|
||||||
shapes::{draw_circle, draw_circle_lines, draw_rectangle},
|
shapes::{draw_circle, draw_circle_lines, draw_rectangle},
|
||||||
@@ -159,8 +159,6 @@ impl Board {
|
|||||||
|
|
||||||
let clicked_field = self.get_clicked_field();
|
let clicked_field = self.get_clicked_field();
|
||||||
|
|
||||||
debug!("Current state: {:?}", self.state);
|
|
||||||
|
|
||||||
match self.state {
|
match self.state {
|
||||||
BoardState::View => {
|
BoardState::View => {
|
||||||
if self.is_my_turn {
|
if self.is_my_turn {
|
||||||
@@ -408,8 +406,15 @@ impl Board {
|
|||||||
let thickness = 0.5;
|
let thickness = 0.5;
|
||||||
|
|
||||||
draw_circle(center.x, center.y, r, color);
|
draw_circle(center.x, center.y, r, color);
|
||||||
|
match pawn.state {
|
||||||
|
crate::logic::board::pawn::PawnState::Man => {
|
||||||
draw_circle_lines(center.x, center.y, r, thickness, BLACK);
|
draw_circle_lines(center.x, center.y, r, thickness, BLACK);
|
||||||
}
|
}
|
||||||
|
crate::logic::board::pawn::PawnState::Dame => {
|
||||||
|
draw_circle_lines(center.x, center.y, r, thickness, YELLOW);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
use std::convert::identity;
|
|
||||||
|
|
||||||
use tokio::sync::mpsc::{self, Sender};
|
use tokio::sync::mpsc::{self, Sender};
|
||||||
|
|
||||||
use log::{debug, error, info};
|
use log::{debug, error, info};
|
||||||
|
|||||||
Reference in New Issue
Block a user