Feat/2 weapons foundation #6

Merged
Dotts merged 30 commits from feat/2-weapons-foundation into main 2026-06-04 22:22:16 -07:00
Showing only changes of commit 8c928c2d92 - Show all commits
+28 -1
View File
@@ -461,12 +461,39 @@ func _build_hud() -> void:
var help := Label.new() var help := Label.new()
help.name = "HelpLabel" help.name = "HelpLabel"
help.text = "WASD Move | Shift Sprint | Space Jump | Double-tap Space Double Jump\nCtrl+Sprint Slide | LShift Dash (air) | Wall Run: run alongside walls | ESC toggle mouse"
var k_f = _get_key_name("move_forward")
var k_l = _get_key_name("move_left")
var k_b = _get_key_name("move_back")
var k_r = _get_key_name("move_right")
var k_j = _get_key_name("jump")
var k_c = _get_key_name("crouch")
var k_d = _get_key_name("dash")
var k_fire = _get_key_name("fire")
var help_text = "%s%s%s%s Move | %s Jump | %s (in air) Double Jump\n%s (moving fast) Slide | %s Dash | %s Fire | ESC Pause Menu" % [k_f, k_l, k_b, k_r, k_j, k_j, k_c, k_d, k_fire]
help.text = help_text
help.add_theme_font_size_override("font_size", 13) help.add_theme_font_size_override("font_size", 13)
help.add_theme_color_override("font_color", Color(0.8, 0.8, 0.8, 0.7)) help.add_theme_color_override("font_color", Color(0.8, 0.8, 0.8, 0.7))
help_panel.add_child(help) help_panel.add_child(help)
# ── Utility: Key Name ─────────────────────────────────────────────────────────
func _get_key_name(action: String) -> String:
if not InputMap.has_action(action):
return "?"
var events = InputMap.action_get_events(action)
for e in events:
if e is InputEventKey:
var code = e.physical_keycode if e.physical_keycode != 0 else e.keycode
return OS.get_keycode_string(code)
elif e is InputEventMouseButton:
if e.button_index == MOUSE_BUTTON_LEFT: return "LClick"
elif e.button_index == MOUSE_BUTTON_RIGHT: return "RClick"
elif e.button_index == MOUSE_BUTTON_MIDDLE: return "MClick"
return "?"
# ── HUD Update ──────────────────────────────────────────────────────────────── # ── HUD Update ────────────────────────────────────────────────────────────────
func _process(_delta: float) -> void: func _process(_delta: float) -> void: