Compare commits

..

No commits in common. "160e881ba74a6b734000c75c614a830c82346491" and "d03308136e8ebc6bb8953c93977d8e5e21fb7a06" have entirely different histories.

2 changed files with 3 additions and 28 deletions

View file

@ -23,10 +23,6 @@ impl PassThroughFilter {
PassThroughFilter::Rotating(filter_angle) => {
let mut hsla = color.as_hsla_f32();
hsla[0] = (hsla[0] + filter_angle) % 360.;
// floating rem is not modulo!
if hsla[0] < 0. {
hsla[0] += 360.;
}
Color::hsla(hsla[0], hsla[1], hsla[2], hsla[3])
}
}

View file

@ -25,7 +25,6 @@ pub struct GamePlugin;
impl Plugin for GamePlugin {
fn build(&self, app: &mut App) {
app.add_event::<LevelStartupEvent>()
.add_event::<ChangeCharacterEvent>()
.init_resource::<CharacterMeshes>()
.insert_resource(CurrentLevel(None))
.init_resource::<CharacterList>()
@ -42,8 +41,7 @@ impl Plugin for GamePlugin {
.with_system(player_movement_system)
.with_system(level_keyboard_system)
.with_system(camera_system)
.with_system(character_particle_effect_system)
.with_system(kill_character_system),
.with_system(character_particle_effect_system),
)
.add_system_set(
SystemSet::on_update(AppState::Win)
@ -67,8 +65,6 @@ impl Plugin for GamePlugin {
pub struct LevelStartupEvent;
pub struct ChangeCharacterEvent;
// Resources
pub struct CurrentLevel(pub Option<LevelId>);
@ -439,14 +435,14 @@ fn collision_event_system(
fn change_character_system(
mut commands: Commands,
keyboard_input: Res<Input<KeyCode>>,
characters: Query<(Entity, &CharacterColor, Option<&Player>)>,
character_list: Res<CharacterList>,
audio_assets: Res<audio_system::AudioAssets>,
audio: Res<Audio>,
change_character_event: EventReader<ChangeCharacterEvent>,
) {
if !keyboard_input.just_pressed(KeyCode::Tab) && change_character_event.is_empty() {
if !keyboard_input.just_pressed(KeyCode::Tab) {
return;
}
@ -627,20 +623,3 @@ fn level_keyboard_system(
}
}
}
fn kill_character_system(
mut commands: Commands,
character_query: Query<(Entity, &Transform, Option<&Player>), With<CharacterColor>>,
mut character_list: ResMut<CharacterList>,
mut change_character_event: EventWriter<ChangeCharacterEvent>,
) {
for (entity, transform, player) in character_query.iter() {
if transform.translation.y < -512. {
commands.entity(entity).despawn_recursive();
character_list.0.remove(&entity);
if player.is_some() {
change_character_event.send(ChangeCharacterEvent);
}
}
}
}