Skip to content

Commit dfa1065

Browse files
committed
cleaning up warnings
1 parent 05cba6b commit dfa1065

5 files changed

Lines changed: 9 additions & 39 deletions

File tree

src/game/audio/soundtrack.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ fn play_soundtrack(
2222

2323
let soundtrack_key = match trigger.event() {
2424
PlaySoundtrack::Key(key) => *key,
25-
PlaySoundtrack::Disable => return,
2625
};
2726
commands.spawn((
2827
AudioSourceBundle {
@@ -43,7 +42,6 @@ fn play_soundtrack(
4342
#[derive(Event)]
4443
pub enum PlaySoundtrack {
4544
Key(SoundtrackKey),
46-
Disable,
4745
}
4846

4947
/// Marker component for the soundtrack entity so we can find it later.

src/game/spawn/clock.rs

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -47,32 +47,22 @@ pub(super) fn plugin(app: &mut App) {
4747
clocks: vec![
4848
ClockData {
4949
time_left: 0.0,
50-
hour_start_rotation: 0.0,
51-
minute_start_rotation: 1.0,
5250
audio: SfxKey::Ticking2,
5351
},
5452
ClockData {
5553
time_left: 0.0,
56-
hour_start_rotation: 2.0,
57-
minute_start_rotation: 3.0,
5854
audio: SfxKey::Ticking3,
5955
},
6056
ClockData {
6157
time_left: 0.0,
62-
hour_start_rotation: 4.0,
63-
minute_start_rotation: 5.0,
6458
audio: SfxKey::Ticking4,
6559
},
6660
ClockData {
6761
time_left: 0.0,
68-
hour_start_rotation: 6.0,
69-
minute_start_rotation: 7.0,
7062
audio: SfxKey::Ticking5,
7163
},
7264
ClockData {
7365
time_left: 0.0,
74-
hour_start_rotation: 8.0,
75-
minute_start_rotation: 9.0,
7666
audio: SfxKey::Ticking6,
7767
},
7868
],
@@ -133,8 +123,6 @@ pub struct Clocks {
133123

134124
pub struct ClockData {
135125
pub time_left: f32,
136-
pub hour_start_rotation: f32,
137-
pub minute_start_rotation: f32,
138126
pub audio: SfxKey,
139127
}
140128

@@ -478,17 +466,6 @@ fn spawn_interact_clock(
478466
let translation = positions.clock_spawn;
479467
let clock_data = &clock_data.clocks[clock_count];
480468

481-
let mut hour_transform = Transform {
482-
translation: Vec3::new(0.0, 0.0, 300.0),
483-
..default()
484-
};
485-
// hour_transform.rotate_z(clock_data.hour_start_rotation);
486-
487-
let mut minute_transform = Transform {
488-
translation: Vec3::new(0.0, 0.0, 400.0),
489-
..default()
490-
};
491-
// minute_transform.rotate_z(clock_data.minute_start_rotation);
492469
commands
493470
.spawn((
494471
Name::new("Clock"),
@@ -517,7 +494,10 @@ fn spawn_interact_clock(
517494
parent.spawn((
518495
SpriteBundle {
519496
texture: image_handles[&ImageKey::ClockHour].clone_weak(),
520-
transform: hour_transform,
497+
transform: Transform {
498+
translation: Vec3::new(0.0, 0.0, 300.0),
499+
..default()
500+
},
521501
sprite: Sprite {
522502
custom_size: Some(Vec2::new(90.0, 90.0)),
523503
..default()
@@ -530,7 +510,10 @@ fn spawn_interact_clock(
530510
parent.spawn((
531511
SpriteBundle {
532512
texture: image_handles[&ImageKey::ClockMinute].clone_weak(),
533-
transform: minute_transform,
513+
transform: Transform {
514+
translation: Vec3::new(0.0, 0.0, 400.0),
515+
..default()
516+
},
534517
sprite: Sprite {
535518
custom_size: Some(Vec2::new(90.0, 90.0)),
536519
..default()

src/game/spawn/player.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use bevy::prelude::*;
33
use crate::{
44
game::{
55
assets::{HandleMap, ImageKey, SfxKey},
6-
audio::sfx::{PlayLoopingSfx, PlaySfx, StopLoopingSfx},
6+
audio::sfx::{PlayLoopingSfx, StopLoopingSfx},
77
movement::MovementController,
88
},
99
screen::Screen,

src/screen/credits.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use crate::{
1010

1111
pub(super) fn plugin(app: &mut App) {
1212
app.add_systems(OnEnter(Screen::Credits), enter_credits);
13-
app.add_systems(OnExit(Screen::Credits), exit_credits);
1413

1514
app.add_systems(
1615
Update,
@@ -44,10 +43,6 @@ fn enter_credits(mut commands: Commands) {
4443
commands.trigger(PlaySoundtrack::Key(SoundtrackKey::Credits));
4544
}
4645

47-
fn exit_credits(mut commands: Commands) {
48-
// commands.trigger(PlaySoundtrack::Disable);
49-
}
50-
5146
fn handle_credits_action(
5247
mut commands: Commands,
5348
mut next_screen: ResMut<NextState<Screen>>,

src/screen/playing.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use crate::game::{
99

1010
pub(super) fn plugin(app: &mut App) {
1111
app.add_systems(OnEnter(Screen::Playing), enter_playing);
12-
app.add_systems(OnExit(Screen::Playing), exit_playing);
1312

1413
app.add_systems(
1514
Update,
@@ -23,11 +22,6 @@ fn enter_playing(mut commands: Commands) {
2322
commands.trigger(PlaySoundtrack::Key(SoundtrackKey::Gameplay));
2423
}
2524

26-
fn exit_playing(mut commands: Commands) {
27-
// We could use [`StateScoped`] on the sound playing entites instead.
28-
// commands.trigger(PlaySoundtrack::Disable);
29-
}
30-
3125
fn return_to_title_screen(mut next_screen: ResMut<NextState<Screen>>, mut commands: Commands) {
3226
commands.trigger(PlaySoundtrack::Key(SoundtrackKey::Menu));
3327
next_screen.set(Screen::Title);

0 commit comments

Comments
 (0)