This commit is contained in:
2025-11-28 15:55:42 -06:00
parent 5573ad815f
commit 5805ac2260
9 changed files with 64 additions and 33 deletions

View File

@@ -2,28 +2,33 @@
class_name NPC extends CharacterBody3D
@export var _movement:NPCMovement
@export var _interact:NPCInteract
@export var walkSpeed:float = 48.0:
# NPC Movement Accessors
@export var walkSpeed:float:
set(value):
if _movement:
_movement.walkSpeed = value
get:
if _movement:
return _movement.walkSpeed
return 48.0
return 0
@export var runSpeed:float = 64.0:
@export var runSpeed:float:
set(value):
if _movement:
_movement.runSpeed = value
get:
if _movement:
return _movement.runSpeed
return 64.0
return 0
func onInteract(player:Player) -> void:
UI.TEXTBOX.setText("Hello, I'm an NPC!\nThis is the second line here, I am purposefully adding a tonne of words so that it is forced to go across multiple lines and you can see how the word wrapping works, not only using Godot's built in word wrapping but with my advanced visibile characters smart wrapping. Now I am doing a multiline thing\nLine 1\nLine 2\nLine 3\nLine 4\nLine 5\nLine 6\nLine 7\nLine 8\nLine 9\nLine 10");
pass
func _enter_tree() -> void:
pass
# NPC Interact Accessors
@export var interactType:NPCInteract.InteractType:
set(value):
if _interact:
_interact.interactType = value
get:
if _interact:
return _interact.interactType
return NPCInteract.InteractType.NONE