Set up the complete Godot 4.6 client foundation as a pure renderer (D-020): - project.godot with 2D rendering, autoloads, input actions - Main scene: Game > World (TileMapLayer, Entities, FogOverlay) + Camera2D + UILayer - Autoloads: SimBridge (connection state machine + test mode), GameState, InputMapper - Rendering stubs: WorldRenderer, EntityRenderer, FogRenderer - UI stubs: HUD (health/perception/time), Minimap, MonologueDisplay - Input mapping: WASD/arrows, E (interact), Tab (perception), Esc (menu), Space (pause) - gdUnit4 smoke tests: scene loads, autoloads registered (2/2 passing) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
25 lines
836 B
GDScript
25 lines
836 B
GDScript
extends Control
|
|
|
|
# HUD — displays player health, perception mode, time, etc.
|
|
|
|
@onready var health_label: Label = $MarginContainer/VBoxContainer/HealthLabel
|
|
@onready var perception_label: Label = $MarginContainer/VBoxContainer/PerceptionLabel
|
|
@onready var time_label: Label = $MarginContainer/VBoxContainer/TimeLabel
|
|
|
|
func _ready() -> void:
|
|
print("HUD: Initialized")
|
|
|
|
# Update HUD from snapshot data
|
|
func update_from_hud_data(data: Dictionary) -> void:
|
|
# Update perception mode display
|
|
if data.has("perception_mode"):
|
|
perception_label.text = "Mode: " + data.perception_mode.capitalize()
|
|
|
|
# Update time display (per D-031)
|
|
if data.has("time"):
|
|
time_label.text = "Time: " + data.time
|
|
|
|
# Update player health (from player data, not hud_data)
|
|
func update_health(health: int) -> void:
|
|
health_label.text = "Health: " + str(health)
|