diff --git a/README.md b/README.md index c230f96..da2bc3a 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,12 @@ Key features: - f: toggle 3rd person view - TAB: toggle augmented reality overlay (HUD, low-light amplifier) +Cheats: + +- v/b: Impossible acceleration forward/backward +- Shift+v/b: Same as v/b, but a thousand times faster +- c: Impossible instant stopping + # System Requirements - Screen, keyboard diff --git a/src/world.rs b/src/world.rs index f572beb..9a775bd 100644 --- a/src/world.rs +++ b/src/world.rs @@ -353,25 +353,15 @@ fn handle_cheats( mut q_life: Query<(&mut actor::LifeForm, ), With>, settings: ResMut, ) { - if !settings.dev_mode || q_player.is_empty() || q_life.is_empty() { + if q_player.is_empty() || q_life.is_empty() { return; } let (trans, mut pos, mut v) = q_player.get_single_mut().unwrap(); - let (mut lifeform, ) = q_life.get_single_mut().unwrap(); let boost = if key_input.pressed(KeyCode::ShiftLeft) { 1e6 } else { 1e3 }; - if key_input.just_pressed(settings.key_cheat_pizza) { - pos.0 = DVec3::new(-303370.0, 0.0, -500000.0); - } - if key_input.just_pressed(settings.key_cheat_farview1) { - pos.0 = DVec3::new(-1000.0e6, 1000.0e6, -500.0e6); - } - if key_input.just_pressed(settings.key_cheat_farview2) { - pos.0 = DVec3::new(1000.0e6, 1000.0e6, -500.0e6); - } if key_input.just_pressed(settings.key_cheat_stop) { v.0 = DVec3::ZERO; } @@ -381,6 +371,20 @@ fn handle_cheats( if key_input.pressed(settings.key_cheat_speed_backward) { v.0 += DVec3::from(trans.rotation * Vec3::new(0.0, 0.0, -boost)); } + if !settings.dev_mode { + return; + } + + let (mut lifeform, ) = q_life.get_single_mut().unwrap(); + if key_input.just_pressed(settings.key_cheat_pizza) { + pos.0 = DVec3::new(-303370.0, 0.0, -500000.0); + } + if key_input.just_pressed(settings.key_cheat_farview1) { + pos.0 = DVec3::new(-1000.0e6, 1000.0e6, -500.0e6); + } + if key_input.just_pressed(settings.key_cheat_farview2) { + pos.0 = DVec3::new(1000.0e6, 1000.0e6, -500.0e6); + } if key_input.pressed(settings.key_cheat_adrenaline_zero) { lifeform.adrenaline = 0.0; }