add basic player state
This commit is contained in:
parent
254f1af0b7
commit
66039b70d9
2 changed files with 33 additions and 0 deletions
32
classes/state/player_state.gd
Normal file
32
classes/state/player_state.gd
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
class_name PlayerState extends State
|
||||
|
||||
const IDLE = "Idle"
|
||||
const WALKING = "Walking"
|
||||
|
||||
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
|
||||
1
classes/state/player_state.gd.uid
Normal file
1
classes/state/player_state.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bebe1y51hwns8
|
||||
Loading…
Add table
Reference in a new issue