Start of animation player state mashine

This commit is contained in:
Paul Norberger
2020-04-19 10:19:32 +02:00
parent d71b728e94
commit 917aff815a
15 changed files with 88 additions and 63 deletions

View File

@@ -1,4 +1,4 @@
extends "res://Boss/SlimeBoss/States/Motion/MotionState.gd"
extends "res://Overlap/StateMachine/MotionState.gd"
func enter():
owner.get_node("AnimationPlayer").play("MoveDown") # TODO: Replace animation
@@ -9,4 +9,5 @@ func handle_input(event):
func update(delta):
var input_direction = get_input_direction()
if input_direction:
emit_signal("finished", "move")
# emit_signal("finished", "move")
pass

View File

@@ -1,7 +0,0 @@
extends "res://Overlap/StateMachine/State.gd"
func get_input_direction():
var input_direction = Vector2()
input_direction.x = int(Input.is_action_pressed("move_right")) - int(Input.is_action_pressed("move_left"))
input_direction.y = int(Input.is_action_pressed("move_down")) - int(Input.is_action_pressed("move_up"))
return input_direction