Minor cleanup
This commit is contained in:
parent
d983fa57a2
commit
d96044afa2
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user