diff --git a/src/levels/level_transition.rs b/src/levels/level_transition.rs index 3f3b2f7..f24519f 100644 --- a/src/levels/level_transition.rs +++ b/src/levels/level_transition.rs @@ -228,6 +228,8 @@ pub fn level_transition( for finish in finish_q.iter() { if let Some(next_level) = &finish.next_level { *level_selection = next_level.clone(); + // reset_level_event.send(ResetLevelEvent); + info!("Next level: {:?}", level_selection); } } for (entity, &background_color) in screen_q.iter_mut() { diff --git a/src/levels/panel.rs b/src/levels/panel.rs index 2239395..1704379 100644 --- a/src/levels/panel.rs +++ b/src/levels/panel.rs @@ -231,10 +231,18 @@ pub fn step_on_panel( for (panel_coord, mut panel, mut image, mut sprite) in panel_q.iter_mut() { for (player_coords, mut forbidden_movement) in player_q.iter_mut() { if panel_coord == player_coords { - notify.send(Notification { - text: "You stepped on a panel!".into(), - duration: Duration::from_secs(2), - }); + if let Some(laser) = panel.opens_laser { + notify.send(Notification { + text: format!("{} laser deactivated!", laser), + duration: Duration::from_secs_f32(1.2), + }); + } + if !panel.forbids_movement.is_empty() || !panel.multi_movement.is_empty() { + notify.send(Notification { + text: "You feel like something has changed...".to_owned(), + duration: Duration::from_secs(2), + }); + } panel.active = true; if let Some((atlas, new_sprite)) = sprite_for_panel(&panel, &sprites.plates, &aseprites, &texture_atlases) diff --git a/src/levels/tiles.rs b/src/levels/tiles.rs index 5e5db4e..5cca400 100644 --- a/src/levels/tiles.rs +++ b/src/levels/tiles.rs @@ -1,3 +1,5 @@ +use std::fmt::Display; + use bevy::prelude::{Bundle, Component}; use bevy_ecs_ldtk::{ prelude::{LayerInstance, LdtkIntCell}, @@ -43,6 +45,16 @@ pub enum LaserType { Blue, } +impl Display for LaserType { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + LaserType::Red => write!(f, "Red"), + LaserType::Green => write!(f, "Green"), + LaserType::Blue => write!(f, "Blue"), + } + } +} + #[derive(Bundle)] pub struct DoorBundle { pub door: Laser, diff --git a/src/ui/notifications.rs b/src/ui/notifications.rs index 70882e0..d007c7e 100644 --- a/src/ui/notifications.rs +++ b/src/ui/notifications.rs @@ -56,7 +56,7 @@ pub fn add_notifications_ui(child_builder: &mut ChildBuilder, text_style: &TextS align_items: AlignItems::Center, ..default() }, - background_color: BackgroundColor(Color::rgba(0.1, 0.1, 0.1, 0.5)), + background_color: BackgroundColor(Color::rgba(0.0, 0.0, 0.0, 0.5)), ..default() }) .with_children(|parent| {