30 lines
566 B
GDScript

class_name Player
extends CharacterBody3D
signal skill_used(skill: Skill)
signal dashed
signal jumped
signal name_changed(new_name: String)
signal direction_changed
@export var skills: Array[Skill]
var id: String
var controller: Controller
func use_skill(slot: int):
if get_node("State").current == StateComponent.State.Skill:
return
skill_used.emit(skills[slot])
func jump():
jumped.emit()
func set_direction(direction: Vector3):
direction_changed.emit(direction)
func set_player_name(new_name: String):
name = new_name
name_changed.emit(new_name)