2024-02-13 23:12:32 +01:00

30 lines
523 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):
skill_used.emit(skills[slot])
func dash():
dashed.emit()
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)