From 15fe765d380abc70ed371a2af2806dbb2fa95199 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Sat, 13 Jan 2024 20:19:11 +0100 Subject: didnt build --- src/main.rs | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 627fec0..b06e30c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -110,7 +110,6 @@ pub fn setup( commands .spawn(SpriteSheetBundle { texture_atlas: atlas_handle.clone(), - visibility: Visibility::Inherited, transform: Transform { translation: Vec3::new( ((i as f32) * constants::TILE_SIZE * constants::TILE_SCALE) - 330.0, @@ -135,10 +134,9 @@ fn animation( Option<&mut Cell>, &mut AnimationTimer, &mut TextureAtlasSprite, - &mut Visibility, )>, ) { - for (entity, cell, mut timer, mut sprite, mut visibility) in q.iter_mut() { + for (entity, cell, mut timer, mut sprite) in q.iter_mut() { timer.tick(time.delta()); if timer.finished() { let index = match sprite.index { @@ -160,7 +158,7 @@ fn animation( if let Some(index) = index { sprite.index = index; } else if let Some(mut cell) = cell { - cell.set_occupant(Occupant::None, &mut sprite, &mut visibility); + cell.set_occupant(Occupant::None, &mut sprite); commands.entity(entity).remove::(); } else { commands.entity(entity).despawn(); @@ -282,7 +280,10 @@ pub fn main() { .set(WindowPlugin { primary_window: Some(Window { title: "gems".to_string(), - resolution: WindowResolution::new(constants::WINDOW_WIDTH,constants::WINDOW_HEIGHT), + resolution: WindowResolution::new( + constants::WINDOW_WIDTH, + constants::WINDOW_HEIGHT, + ), resizable: false, ..default() }), @@ -290,13 +291,15 @@ pub fn main() { }), ) .add_startup_system(setup) - .add_system(cell::insert) - .add_system(cell::falling) - .add_system(cell::check) - .add_system(cell::start_explosion) - .add_system(mouse) - .add_system(cosmonaut_detect) - .add_system(animation) - .add_system(star_spawning) + .add_systems(( + cell::insert, + cell::falling, + cell::check, + cell::start_explosion, + mouse, + cosmonaut_detect, + animation, + star_spawning, + )) .run(); } -- cgit v1.2.3