28 lines
478 B
GDScript
28 lines
478 B
GDScript
class_name Player
|
|
extends CharacterBody3D
|
|
|
|
signal skill_used(slot: int)
|
|
signal dashed
|
|
signal jumped
|
|
signal name_changed(new_name: String)
|
|
signal direction_changed
|
|
|
|
var id: String
|
|
var controller: Controller
|
|
|
|
func use_skill(slot: int):
|
|
skill_used.emit(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)
|