29 lines
542 B
GDScript3
Raw Normal View History

2024-01-16 22:01:16 +00:00
class_name Player
2024-02-15 15:28:27 +00:00
extends Character
2024-02-07 22:04:19 +00:00
2024-02-16 13:45:49 +00:00
## Player ID
2024-02-12 23:22:27 +00:00
var id: String
2024-02-16 13:45:49 +00:00
## Components
2024-02-15 17:06:44 +00:00
var movement: MovementComponent
2024-02-16 13:45:49 +00:00
var state: StateComponent
2024-02-27 20:05:55 +00:00
var performance: PerformanceComponent
var animation: AnimationComponent
var physics: CharacterBody3D
2024-02-28 20:44:24 +00:00
var chat: ChatComponent
2024-02-15 17:06:44 +00:00
func _enter_tree():
2024-02-16 13:45:49 +00:00
movement = $Movement
state = $State
2024-02-27 20:05:55 +00:00
performance = $Performance
animation = $Animation
physics = $Physics
2024-02-28 20:44:24 +00:00
chat = $Chat
2024-02-16 13:45:49 +00:00
## Name
signal name_changed(new_name: String)
2024-02-07 22:04:19 +00:00
2024-02-12 23:22:27 +00:00
func set_player_name(new_name: String):
2024-01-25 23:29:05 +00:00
name = new_name
2024-02-27 22:21:44 +00:00
name_changed.emit(new_name)