From 4b672ebdb61669dbd2c14fe1220dec0fb1f90f0d Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Sun, 8 Sep 2024 18:44:03 +0200 Subject: trying out bevy 13 --- src/cell.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/cell.rs') 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 { -- cgit v1.2.3