Deprecated Animation name in states. Moved exports to State base class.

This commit is contained in:
Nitsud Yarg 2024-05-27 19:37:35 -07:00
parent d912c000ef
commit 173b8cc67c
4 changed files with 9 additions and 14 deletions

View File

@ -9,7 +9,7 @@
config_version=4
_global_script_classes=[ {
"base": "Node",
"base": "Reference",
"class": "Movement",
"language": "GDScript",
"path": "res://src/playerC/player_move_component.gd"

View File

@ -443,7 +443,6 @@ starting_state = NodePath("idle")
[node name="idle" type="Node" parent="Controllers/state_machine"]
script = ExtResource( 2 )
animation_name = "idle"
move_speed = 90.0
animation_sequence = [ "idle" ]
jump_node = NodePath("../jump")
@ -453,7 +452,6 @@ fire_node = NodePath("../fire")
[node name="jump" type="Node" parent="Controllers/state_machine"]
script = ExtResource( 7 )
animation_name = "jump"
move_speed = 90.0
animation_sequence = [ "jump" ]
idle_node = NodePath("../idle")
@ -472,7 +470,6 @@ dash_node = NodePath(".")
[node name="fall" type="Node" parent="Controllers/state_machine"]
script = ExtResource( 4 )
animation_name = "jump"
move_speed = 90.0
animation_sequence = [ "jump" ]
idle_node = NodePath("../idle")
@ -480,15 +477,13 @@ move_node = NodePath("../move")
[node name="hurt" type="Node" parent="Controllers/state_machine"]
script = ExtResource( 8 )
animation_name = "hit"
move_speed = -25.0
timeout_seconds = 1.0
move_speed = -25.0
animation_sequence = [ "hit" ]
idle_node = NodePath("../idle")
[node name="fire" type="Node" parent="Controllers/state_machine"]
script = ExtResource( 10 )
animation_name = "fire"
timeout_seconds = 1.0
animation_sequence = [ "fire" ]
jump_node = NodePath("../jump")

View File

@ -1,11 +1,11 @@
class_name State
extends Node
export var timeout_seconds: float = 0.0
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var modifier_stack_ref: Array # Well this didn't work
var state_timeout: Timer
# Called when the node enters the scene tree for the first time.
func _ready():

View File

@ -13,9 +13,10 @@ extends State
# onready var jump_state: State = get_node(jump_node)
export var animation_name: String
## Deprecated
# export var animation_name: String
export var move_speed: float = 60
export var timeout_seconds: float = 0.0
export(Array, String) var animation_sequence
# this just wouldn't work well. Maybe I can try a resource
@ -27,7 +28,6 @@ var animation_index: int = 0
var current_animation_sequence: int = 0
var animation_suffix: String = '';
var modifier_stack_ref: Array # Well this didn't work
var gravity: int = ProjectSettings.get_setting("physics/2d/default_gravity")
@ -37,7 +37,7 @@ var parent: KinematicBody2D
#var animation_sequence_timer: Timer
var state_timeout: Timer
func _ready():
# Only add timout node if timer value was specified.