Apply clippy fixes
This commit is contained in:
@@ -217,7 +217,7 @@ fn input_ship_shoot(
|
||||
physics::Velocity(bullet_vel),
|
||||
Mesh2d(game_assets.bullet().0),
|
||||
MeshMaterial2d(game_assets.bullet().1),
|
||||
ship_pos.clone(), // clone ship transform
|
||||
*ship_pos, // clone ship transform
|
||||
Lifetime(Timer::from_seconds(BULLET_LIFETIME, TimerMode::Once)),
|
||||
AudioPlayer::new(game_assets.laser_sound()),
|
||||
PlaybackSettings::ONCE, // `Lifetime` already despawns the entity, so this doesn't need to
|
||||
|
||||
@@ -238,7 +238,7 @@ pub fn ship_impact_listener(
|
||||
Sparkler::at_interval(0.15),
|
||||
Mesh2d(game_assets.thruster_mesh()), // borrow the thruster mesh for now
|
||||
MeshMaterial2d(game_assets.thruster_mat_active()), // ... and the active thruster material
|
||||
player.0.clone(), // clone the player transform
|
||||
*player.0, // clone the player transform
|
||||
Velocity(vel),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -114,11 +114,9 @@ pub fn collision_listener(
|
||||
dbg!("Writing ShipDestroy event");
|
||||
ship_writer.write(messages::ShipDestroy);
|
||||
} // else, we don't care
|
||||
} else if *two == *player {
|
||||
if rocks.contains(*one) {
|
||||
dbg!("Writing ShipDestroy event");
|
||||
ship_writer.write(messages::ShipDestroy);
|
||||
}
|
||||
} else if *two == *player && rocks.contains(*one) {
|
||||
dbg!("Writing ShipDestroy event");
|
||||
ship_writer.write(messages::ShipDestroy);
|
||||
}
|
||||
|
||||
// Option 2: Bullet & Asteroid
|
||||
@@ -128,12 +126,10 @@ pub fn collision_listener(
|
||||
asteroid_writer.write(messages::AsteroidDestroy(*two));
|
||||
bullet_writer.write(messages::BulletDestroy(*one));
|
||||
}
|
||||
} else if rocks.contains(*one) {
|
||||
if bullets.contains(*two) {
|
||||
dbg!("Writing AsteroidDestroy & BulletDestroy events");
|
||||
asteroid_writer.write(messages::AsteroidDestroy(*one));
|
||||
bullet_writer.write(messages::BulletDestroy(*two));
|
||||
}
|
||||
} else if rocks.contains(*one) && bullets.contains(*two) {
|
||||
dbg!("Writing AsteroidDestroy & BulletDestroy events");
|
||||
asteroid_writer.write(messages::AsteroidDestroy(*one));
|
||||
bullet_writer.write(messages::BulletDestroy(*two));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ use crate::{
|
||||
};
|
||||
|
||||
use bevy::{
|
||||
color::palettes::css::{BLACK, DARK_GRAY, GREEN, LIGHT_BLUE, RED, WHITE},
|
||||
color::palettes::css::{BLACK, DARK_GRAY, GREEN, RED, WHITE},
|
||||
prelude::*,
|
||||
};
|
||||
|
||||
@@ -263,6 +263,7 @@ fn animate_get_ready_widget(
|
||||
/// on the HUD, this system would quit the game. The same will happen for
|
||||
/// returning to the title screen. This should be useful for making a pause
|
||||
/// menu, too.
|
||||
#[allow(clippy::type_complexity)]
|
||||
fn operate_buttons(
|
||||
mut interactions: Query<
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user