From 585d82473ccf566965ded0e50eea1669c3e1cdf3 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Sun, 21 Mar 2021 19:33:05 +0100 Subject: moving more to constants --- src/cell.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/cell.rs') diff --git a/src/cell.rs b/src/cell.rs index d5d19e2..fc5d77d 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -69,7 +69,7 @@ impl Cell { pub fn insert(mut cell_query: Query<(&mut Cell, &mut TextureAtlasSprite)>) { for (mut cell, mut sprite) in cell_query.iter_mut() { - if cell.occupant == Occupant::None && cell.y == constants::ROWS - 1 { + if cell.occupant == Occupant::None && cell.y == constants::GRID_SIZE - 1 { cell.occupant = rand::random(); sprite.index = cell.occupant.to_index(); } @@ -88,7 +88,7 @@ pub fn start_explosion( } pub fn check(mut cell_query: Query<(&mut Cell, &mut TextureAtlasSprite)>) { - let mut cells = [[Cell::default(); constants::COLUMNS]; constants::ROWS]; + let mut cells = [[Cell::default(); constants::GRID_SIZE]; constants::GRID_SIZE]; for (cell, _) in cell_query.iter_mut() { cells[cell.x][cell.y] = *cell; } @@ -98,7 +98,7 @@ pub fn check(mut cell_query: Query<(&mut Cell, &mut TextureAtlasSprite)>) { for (i, _) in cells.iter().enumerate() { let mut c = Vec::new(); - for j in 0..constants::ROWS { + for j in 0..constants::GRID_SIZE { if cells[i][j].occupant == last && last != Occupant::None { c.push((i, j)); c.push((i, j - 1)); -- cgit v1.2.3