From adeb207919a7c1eef98a7a79857db94c84bcf69a Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 1 Apr 2024 20:37:32 +0200 Subject: [PATCH] add 'b' key cheat to fly backwards quickly --- src/settings.rs | 2 ++ src/world.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/settings.rs b/src/settings.rs index ba4c077..fe426d7 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -47,6 +47,7 @@ pub struct Settings { pub key_reply10: KeyCode, pub key_cheat_stop: KeyCode, pub key_cheat_speed: KeyCode, + pub key_cheat_speed_backward: KeyCode, pub key_cheat_pizza: KeyCode, pub key_cheat_farview1: KeyCode, pub key_cheat_farview2: KeyCode, @@ -118,6 +119,7 @@ impl Default for Settings { key_reply10: KeyCode::Digit0, key_cheat_stop: KeyCode::KeyC, key_cheat_speed: KeyCode::KeyV, + key_cheat_speed_backward: KeyCode::KeyB, key_cheat_pizza: KeyCode::F1, key_cheat_farview1: KeyCode::F2, key_cheat_farview2: KeyCode::F3, diff --git a/src/world.rs b/src/world.rs index ccc38bf..b204f9e 100644 --- a/src/world.rs +++ b/src/world.rs @@ -255,6 +255,9 @@ fn handle_cheats( if key_input.pressed(settings.key_cheat_speed) { v.0 += DVec3::from(trans.rotation * Vec3::new(0.0, 0.0, 1000.0)); } + if key_input.pressed(settings.key_cheat_speed_backward) { + v.0 += DVec3::from(trans.rotation * Vec3::new(0.0, 0.0, -1000.0)); + } if key_input.pressed(settings.key_cheat_adrenaline_zero) { lifeform.adrenaline = 0.0; }