Made more enemies, easier to kill, more slashy. You get passive health regen, health orbs. Little key bindings tooltip.

This commit is contained in:
2026-06-30 22:57:11 +01:00
parent 7fa2efabaf
commit 97ebbb1618
17 changed files with 404 additions and 6 deletions
+12
View File
@@ -8,6 +8,7 @@ var unit_frame: Control = null
var target_frame: Control = null
var character_sheet: Control = null
var tab_hint: Control = null
var keybind_hint: Control = null
var escape_menu: Control = null
# Player reference
@@ -77,6 +78,7 @@ func _create_ui_components():
_create_unit_frame()
_create_character_sheet()
_create_tab_hint()
_create_keybind_hint()
_create_escape_menu()
## Create action bar at bottom of screen
@@ -125,6 +127,16 @@ func _create_tab_hint():
else:
push_error("[HUD] Failed to load tab_hint.tscn")
## Create keybind hint (always visible, top-right corner)
func _create_keybind_hint():
var keybind_hint_scene = load("res://level/ui/scenes/keybind_hint.tscn")
if keybind_hint_scene:
keybind_hint = keybind_hint_scene.instantiate()
add_child(keybind_hint)
print("[HUD] Keybind hint created")
else:
push_error("[HUD] Failed to load keybind_hint.tscn")
## Create escape menu (toggle with Escape)
func _create_escape_menu():
var escape_menu_scene = load("res://level/ui/scenes/escape_menu.tscn")
+75
View File
@@ -0,0 +1,75 @@
extends PanelContainer
## Always-on compact panel listing the current controls.
## Reads bindings straight from the InputMap so it stays accurate if keys are rebound.
# Each row is a friendly label plus the input action(s) that feed it.
# Grouped actions (like movement) show their keys joined together.
const ROWS := [
{ "label": "Move", "actions": ["move_forward", "move_left", "move_backward", "move_right"] },
{ "label": "Jump", "actions": ["jump"] },
{ "label": "Sprint", "actions": ["shift"] },
{ "label": "Dash", "actions": ["dash"] },
{ "label": "Attack", "actions": ["attack"] },
{ "label": "Block", "actions": ["block"] },
{ "label": "Pick Up / Drop", "actions": ["pickup"] },
{ "label": "Character Sheet", "actions": ["toggle_character_sheet"] },
{ "label": "Chat", "actions": ["toggle_chat"] },
{ "label": "Menu", "actions": ["quit"] },
]
func _ready() -> void:
_build()
func _build() -> void:
var content: VBoxContainer = $Margin/Content
var title := Label.new()
title.text = "CONTROLS"
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
title.add_theme_font_size_override("font_size", 16)
title.add_theme_color_override("font_color", Color(1, 0.8, 0, 1))
title.add_theme_color_override("font_outline_color", Color.BLACK)
title.add_theme_constant_override("outline_size", 2)
content.add_child(title)
var grid := GridContainer.new()
grid.columns = 2
grid.add_theme_constant_override("h_separation", 12)
grid.add_theme_constant_override("v_separation", 3)
content.add_child(grid)
for row in ROWS:
var keys: Array[String] = []
for action in row["actions"]:
var k := _key_text(action)
if k != "":
keys.append(k)
if keys.is_empty():
continue
grid.add_child(_make_label(" ".join(keys), Color(1, 0.82, 0.2, 1)))
grid.add_child(_make_label(row["label"], Color.WHITE))
func _make_label(text: String, color: Color) -> Label:
var l := Label.new()
l.text = text
l.add_theme_font_size_override("font_size", 13)
l.add_theme_color_override("font_color", color)
l.add_theme_color_override("font_outline_color", Color.BLACK)
l.add_theme_constant_override("outline_size", 1)
return l
## Returns a human-readable name for the first event bound to an action.
func _key_text(action: String) -> String:
if not InputMap.has_action(action):
return ""
for ev in InputMap.action_get_events(action):
if ev is InputEventKey:
var code: int = ev.physical_keycode if ev.physical_keycode != 0 else ev.keycode
return OS.get_keycode_string(code)
elif ev is InputEventMouseButton:
match ev.button_index:
MOUSE_BUTTON_LEFT: return "LMB"
MOUSE_BUTTON_RIGHT: return "RMB"
MOUSE_BUTTON_MIDDLE: return "MMB"
_: return "Mouse %d" % ev.button_index
return ""
+1
View File
@@ -0,0 +1 @@
uid://dh85b10pfih5e