summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorTom Barrett <tom@tombarrett.xyz>2024-01-13 20:19:11 +0100
committerTom Barrett <tom@tombarrett.xyz>2024-01-13 20:19:11 +0100
commit15fe765d380abc70ed371a2af2806dbb2fa95199 (patch)
tree007f30f0a69a1af072e2811e54f4e4ce661452eb /src/main.rs
parenta0207d6b7a53fd942f9010287d27336692893da4 (diff)
didnt build
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs29
1 files changed, 16 insertions, 13 deletions
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::<AnimationTimer>();
} 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();
}