improvements

This commit is contained in:
2025-08-01 20:07:40 -07:00
parent cfb4aa874b
commit 5cde8be9a7
9 changed files with 581 additions and 0 deletions

35
scripts/base_character.gd Normal file
View File

@@ -0,0 +1,35 @@
extends Node2D
# Base character class that can display dialogue
# This extends Node2D to be compatible with Godot's scene system
# Reference to the dialogue system
var dialogue_system: Node = null
# Signals
signal dialogue_started()
signal dialogue_completed()
func _ready():
# Find and setup dialogue system
dialogue_system = get_node_or_null("DialogueSystem")
if dialogue_system:
dialogue_system.connect("dialogue_started", self._on_dialogue_started)
dialogue_system.connect("dialogue_completed", self._on_dialogue_completed)
else:
print("Warning: No dialogue system found on character")
func trigger_dialogue(text: String, duration: float = 3.0) -> void:
"""Public method to trigger dialogue on this character"""
if dialogue_system:
dialogue_system.trigger_dialogue(text, duration)
else:
print("Warning: No dialogue system found on character")
func _on_dialogue_started():
"""Handle dialogue start signal"""
emit_signal("dialogue_started")
func _on_dialogue_completed():
"""Handle dialogue completion signal"""
emit_signal("dialogue_completed")