bovido/scripts/player_idle_state.gd
Mathilde Grapin 7038d29d87 First commit
Add simple player movement with a finite state machine.
Add enemy that can move to target point.
Add ground through a tilemap and wall that player and enemy cannot
cross.
2023-06-11 23:38:54 +02:00

14 lines
350 B
GDScript

class_name PlayerIdleState
extends PlayerState
func enter(_msg := {}):
player.velocity = Vector2.ZERO
player.animation_player.play("idle")
func update(_delta):
if get_input_direction() != Vector2.ZERO:
state_machine.transition_to("Walk")
func get_input_direction():
return Input.get_vector("move_left", "move_right", "move_up", "move_down")