Buggy jump/shoot state transition added.
This commit is contained in:
parent
89208475fe
commit
8cb9bca02b
|
|
@ -492,6 +492,7 @@ script = ExtResource( 10 )
|
||||||
animation_name = "fire"
|
animation_name = "fire"
|
||||||
timeout_seconds = 1.0
|
timeout_seconds = 1.0
|
||||||
animation_sequence = [ "fire" ]
|
animation_sequence = [ "fire" ]
|
||||||
|
jump_node = NodePath("../jump")
|
||||||
idle_node = NodePath("../idle")
|
idle_node = NodePath("../idle")
|
||||||
fall_node = NodePath("../fall")
|
fall_node = NodePath("../fall")
|
||||||
move_node = NodePath("../move")
|
move_node = NodePath("../move")
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
extends State
|
extends State
|
||||||
|
|
||||||
|
export (NodePath) var jump_node
|
||||||
export (NodePath) var idle_node
|
export (NodePath) var idle_node
|
||||||
export (NodePath) var fall_node
|
export (NodePath) var fall_node
|
||||||
export (NodePath) var move_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 idle_state: State = get_node(idle_node)
|
||||||
onready var fall_state: State = get_node(fall_node)
|
onready var fall_state: State = get_node(fall_node)
|
||||||
onready var move_state: State = get_node(move_node)
|
onready var move_state: State = get_node(move_node)
|
||||||
|
|
@ -20,10 +22,9 @@ func enter() -> void:
|
||||||
modifier_stack_ref.push_front($"../attack")
|
modifier_stack_ref.push_front($"../attack")
|
||||||
|
|
||||||
func process_input(_event: InputEvent) -> State:
|
func process_input(_event: InputEvent) -> State:
|
||||||
# if move_component.get_movement_direction() != 0.0:
|
if move_component.wants_jump() and parent.is_on_floor():
|
||||||
# return move_state
|
return jump_state
|
||||||
|
|
||||||
# move_component.wants_jump()
|
|
||||||
move_component.get_movement_direction()
|
move_component.get_movement_direction()
|
||||||
|
|
||||||
# if Input.is_action_just_pressed('dash'):
|
# if Input.is_action_just_pressed('dash'):
|
||||||
|
|
@ -70,4 +71,4 @@ func exit() -> void:
|
||||||
# var testmod :StateModifier = StateModifier.new()
|
# var testmod :StateModifier = StateModifier.new()
|
||||||
# testmod.name
|
# testmod.name
|
||||||
|
|
||||||
pass
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user