Buggy jump/shoot state transition added.

This commit is contained in:
Nitsud Yarg 2024-05-27 08:35:48 -07:00
parent 89208475fe
commit 8cb9bca02b
2 changed files with 6 additions and 4 deletions

View File

@ -492,6 +492,7 @@ script = ExtResource( 10 )
animation_name = "fire"
timeout_seconds = 1.0
animation_sequence = [ "fire" ]
jump_node = NodePath("../jump")
idle_node = NodePath("../idle")
fall_node = NodePath("../fall")
move_node = NodePath("../move")

View File

@ -1,9 +1,11 @@
extends State
export (NodePath) var jump_node
export (NodePath) var idle_node
export (NodePath) var fall_node
export (NodePath) var move_node
onready var jump_state: State = get_node(jump_node)
onready var idle_state: State = get_node(idle_node)
onready var fall_state: State = get_node(fall_node)
onready var move_state: State = get_node(move_node)
@ -20,10 +22,9 @@ func enter() -> void:
modifier_stack_ref.push_front($"../attack")
func process_input(_event: InputEvent) -> State:
# if move_component.get_movement_direction() != 0.0:
# return move_state
if move_component.wants_jump() and parent.is_on_floor():
return jump_state
# move_component.wants_jump()
move_component.get_movement_direction()
# if Input.is_action_just_pressed('dash'):
@ -70,4 +71,4 @@ func exit() -> void:
# var testmod :StateModifier = StateModifier.new()
# testmod.name
pass
return