changeable z index, with occlusion
This commit is contained in:
+21
-11
@@ -55,17 +55,27 @@ pub struct DoorTile {
|
||||
pub locked: bool,
|
||||
}
|
||||
|
||||
// pub fn camera_z_movement(
|
||||
// keyboard_input: Res<ButtonInput<KeyCode>>,
|
||||
// mut z_index: ResMut<game::ZIndex>,
|
||||
// ) {
|
||||
// if keyboard_input.pressed(KeyCode::ShiftLeft) {
|
||||
// z_index.0 -= 1.0;
|
||||
// }
|
||||
// if keyboard_input.pressed(KeyCode::ShiftRight) {
|
||||
// z_index.0 += 1.0;
|
||||
// }
|
||||
// }
|
||||
#[derive(Resource, Default)]
|
||||
pub struct CameraMoved(pub bool);
|
||||
|
||||
// Modify camera_z_movement
|
||||
pub fn camera_z_movement(
|
||||
keyboard_input: Res<ButtonInput<KeyCode>>,
|
||||
mut z_index: ResMut<game::ZIndex>,
|
||||
mut camera_moved: ResMut<CameraMoved>,
|
||||
) {
|
||||
camera_moved.0 = false;
|
||||
if keyboard_input.pressed(KeyCode::ShiftLeft) {
|
||||
z_index.0 -= 1.0;
|
||||
z_index.0 = z_index.0.clamp(-39.0, 5.0);
|
||||
camera_moved.0 = true;
|
||||
}
|
||||
if keyboard_input.pressed(KeyCode::ShiftRight) {
|
||||
z_index.0 += 1.0;
|
||||
z_index.0 = z_index.0.clamp(-39.0, 5.0);
|
||||
camera_moved.0 = true;
|
||||
}
|
||||
}
|
||||
|
||||
pub fn tile_sprite_occlusion(
|
||||
mut query: Query<(&mut Visibility, &Transform, &Tile), With<Tile>>,
|
||||
|
||||
Reference in New Issue
Block a user