summaryrefslogtreecommitdiff
path: root/src/cell.rs
diff options
context:
space:
mode:
authorTom Barrett <tom@tombarrett.xyz>2024-09-08 18:44:03 +0200
committerTom Barrett <tom@tombarrett.xyz>2024-09-08 18:44:03 +0200
commit4b672ebdb61669dbd2c14fe1220dec0fb1f90f0d (patch)
tree9dd15a428f5bc97e19e8e2b730a6004ab1506c2a /src/cell.rs
parent0375faa9670737191d0c276f3b5daf83a6cfc8e8 (diff)
trying out bevy 13bevy_13
Diffstat (limited to 'src/cell.rs')
-rw-r--r--src/cell.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cell.rs b/src/cell.rs
index 6571cd5..d865c97 100644
--- a/src/cell.rs
+++ b/src/cell.rs
@@ -102,13 +102,13 @@ impl Cell {
}
}
- pub fn set_occupant(&mut self, occupant: Occupant, sprite: &mut TextureAtlasSprite) {
+ pub fn set_occupant(&mut self, occupant: Occupant, sprite: &mut TextureAtlas) {
self.occupant = occupant;
sprite.index = self.occupant.to_index();
}
}
-pub fn insert(mut q: Query<(&mut Cell, &mut TextureAtlasSprite)>) {
+pub fn insert(mut q: Query<(&mut Cell, &mut TextureAtlas)>) {
for (mut cell, mut sprite) in q.iter_mut() {
if cell.occupant == Occupant::None && cell.y == constants::GRID_SIZE - 1 {
cell.set_occupant(rand::random(), &mut sprite);
@@ -129,7 +129,7 @@ pub fn start_explosion(
}
}
-pub fn check(mut q: Query<(&mut Cell, &mut TextureAtlasSprite)>) {
+pub fn check(mut q: Query<(&mut Cell, &mut TextureAtlas)>) {
let mut cells = [[Cell::default(); constants::GRID_SIZE]; constants::GRID_SIZE];
for (cell, _) in q.iter_mut() {
cells[cell.x][cell.y] = *cell;
@@ -185,7 +185,7 @@ pub fn check(mut q: Query<(&mut Cell, &mut TextureAtlasSprite)>) {
}
}
-pub fn falling(mut q: Query<(&mut Cell, &mut TextureAtlasSprite)>) {
+pub fn falling(mut q: Query<(&mut Cell, &mut TextureAtlas)>) {
let mut have_gems = Vec::new();
for (cell, _sprite) in q.iter_mut() {
if cell.occupant != Occupant::None {