diff options
author | Tom Barrett <tom@tombarrett.xyz> | 2021-03-21 19:33:05 +0100 |
---|---|---|
committer | Tom Barrett <tom@tombarrett.xyz> | 2021-03-21 19:33:05 +0100 |
commit | 585d82473ccf566965ded0e50eea1669c3e1cdf3 (patch) | |
tree | f63ce7448ad95ae7ac4b2bed11550a315e9db0e6 /src/cell.rs | |
parent | 420d0f36adeed7fa254497b49ef91a7574628082 (diff) |
moving more to constants
Diffstat (limited to 'src/cell.rs')
-rw-r--r-- | src/cell.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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)); |