32 lines
604 B
GDScript
32 lines
604 B
GDScript
class_name PlayerState extends State
|
|
|
|
const IDLE = "Idle"
|
|
const RUNNING = "Running"
|
|
const HITTING = "Hitting"
|
|
|
|
var player: Player
|
|
|
|
func _ready() -> void:
|
|
await owner.ready
|
|
player = owner as Player
|
|
assert(player != null, "The PlayerState state type must be used only in the player scene. It needs the owner to be a Player node.")
|
|
|
|
|
|
func enter(previous_state_path: String, data: Dictionary = {}) -> void:
|
|
pass
|
|
|
|
|
|
func exit() -> void:
|
|
pass
|
|
|
|
|
|
func handle_input(_event: InputEvent) -> void:
|
|
pass
|
|
|
|
|
|
func state_update(_delta: float) -> void:
|
|
pass
|
|
|
|
|
|
func state_physics_update(_delta: float) -> void:
|
|
pass
|