Skip to content

Commit 38c3a86

Browse files
committed
Drawing flipped tiles
1 parent f9fce0b commit 38c3a86

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

examples/reversi/main.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,16 @@ fn play_game(turtle: &mut Turtle, mut board: Board, dim: &Dimensions) {
126126
let col = col as usize;
127127
erase_valid_moves(turtle, &board, dim);
128128

129-
board.play_piece((row, col));
129+
let current = board.current();
130+
let flipped = board.play_piece((row, col));
130131

131132
move_to_tile(turtle, (row, col), &dim);
132-
draw_piece(turtle, board.current(), &dim);
133+
draw_piece(turtle, current, &dim);
134+
135+
let background = turtle.background_color();
136+
draw_tile_circles(turtle, 0.9, background, dim, flipped.iter());
137+
draw_tile_circles(turtle, 0.8, current.color(), dim, flipped.iter());
138+
133139
draw_valid_moves(turtle, &board, dim);
134140

135141
println!("Current Player: {}", board.current().name());

0 commit comments

Comments
 (0)