1
0

Minor cleanup

This commit is contained in:
Mark 2025-02-28 22:26:37 -08:00
parent ab5f2b200c
commit 5022c840de
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
2 changed files with 2 additions and 4 deletions

View File

@ -36,8 +36,6 @@ impl TetrisBoard {
if let Some(falling) = falling {
for (x, y) in falling.tiles() {
let x = x as usize;
let y = y as usize;
let cell = TetrisCell::Blue;
let dx = (x + 1) * TetrisBoard::CELL_SIZE;
let dy = (y + 1) * TetrisBoard::CELL_SIZE;

View File

@ -22,7 +22,7 @@ impl TetrisBoard {
pub fn place_tetromino(&mut self, tetromino: FallingTetromino) {
for (x, y) in tetromino.tiles() {
let cell = self.get_cell_mut(x as usize, y as usize);
let cell = self.get_cell_mut(x, y);
if let Some(cell) = cell {
*cell = TetrisCell::Blue;
}
@ -31,7 +31,7 @@ impl TetrisBoard {
pub fn tetromino_free_below(&self, tetromino: &FallingTetromino) -> bool {
for (x, y) in tetromino.tiles() {
let cell = self.get_cell(x as usize, y as usize + 1);
let cell = self.get_cell(x, y + 1);
if cell != Some(&TetrisCell::Empty) {
return false;
}