Deprecated Animation name in states. Moved exports to State base class.
This commit is contained in:
parent
d912c000ef
commit
173b8cc67c
|
|
@ -9,7 +9,7 @@
|
||||||
config_version=4
|
config_version=4
|
||||||
|
|
||||||
_global_script_classes=[ {
|
_global_script_classes=[ {
|
||||||
"base": "Node",
|
"base": "Reference",
|
||||||
"class": "Movement",
|
"class": "Movement",
|
||||||
"language": "GDScript",
|
"language": "GDScript",
|
||||||
"path": "res://src/playerC/player_move_component.gd"
|
"path": "res://src/playerC/player_move_component.gd"
|
||||||
|
|
|
||||||
|
|
@ -443,7 +443,6 @@ starting_state = NodePath("idle")
|
||||||
|
|
||||||
[node name="idle" type="Node" parent="Controllers/state_machine"]
|
[node name="idle" type="Node" parent="Controllers/state_machine"]
|
||||||
script = ExtResource( 2 )
|
script = ExtResource( 2 )
|
||||||
animation_name = "idle"
|
|
||||||
move_speed = 90.0
|
move_speed = 90.0
|
||||||
animation_sequence = [ "idle" ]
|
animation_sequence = [ "idle" ]
|
||||||
jump_node = NodePath("../jump")
|
jump_node = NodePath("../jump")
|
||||||
|
|
@ -453,7 +452,6 @@ fire_node = NodePath("../fire")
|
||||||
|
|
||||||
[node name="jump" type="Node" parent="Controllers/state_machine"]
|
[node name="jump" type="Node" parent="Controllers/state_machine"]
|
||||||
script = ExtResource( 7 )
|
script = ExtResource( 7 )
|
||||||
animation_name = "jump"
|
|
||||||
move_speed = 90.0
|
move_speed = 90.0
|
||||||
animation_sequence = [ "jump" ]
|
animation_sequence = [ "jump" ]
|
||||||
idle_node = NodePath("../idle")
|
idle_node = NodePath("../idle")
|
||||||
|
|
@ -472,7 +470,6 @@ dash_node = NodePath(".")
|
||||||
|
|
||||||
[node name="fall" type="Node" parent="Controllers/state_machine"]
|
[node name="fall" type="Node" parent="Controllers/state_machine"]
|
||||||
script = ExtResource( 4 )
|
script = ExtResource( 4 )
|
||||||
animation_name = "jump"
|
|
||||||
move_speed = 90.0
|
move_speed = 90.0
|
||||||
animation_sequence = [ "jump" ]
|
animation_sequence = [ "jump" ]
|
||||||
idle_node = NodePath("../idle")
|
idle_node = NodePath("../idle")
|
||||||
|
|
@ -480,15 +477,13 @@ move_node = NodePath("../move")
|
||||||
|
|
||||||
[node name="hurt" type="Node" parent="Controllers/state_machine"]
|
[node name="hurt" type="Node" parent="Controllers/state_machine"]
|
||||||
script = ExtResource( 8 )
|
script = ExtResource( 8 )
|
||||||
animation_name = "hit"
|
|
||||||
move_speed = -25.0
|
|
||||||
timeout_seconds = 1.0
|
timeout_seconds = 1.0
|
||||||
|
move_speed = -25.0
|
||||||
animation_sequence = [ "hit" ]
|
animation_sequence = [ "hit" ]
|
||||||
idle_node = NodePath("../idle")
|
idle_node = NodePath("../idle")
|
||||||
|
|
||||||
[node name="fire" type="Node" parent="Controllers/state_machine"]
|
[node name="fire" type="Node" parent="Controllers/state_machine"]
|
||||||
script = ExtResource( 10 )
|
script = ExtResource( 10 )
|
||||||
animation_name = "fire"
|
|
||||||
timeout_seconds = 1.0
|
timeout_seconds = 1.0
|
||||||
animation_sequence = [ "fire" ]
|
animation_sequence = [ "fire" ]
|
||||||
jump_node = NodePath("../jump")
|
jump_node = NodePath("../jump")
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
class_name State
|
class_name State
|
||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
|
export var timeout_seconds: float = 0.0
|
||||||
|
|
||||||
# Declare member variables here. Examples:
|
# Declare member variables here. Examples:
|
||||||
# var a = 2
|
var modifier_stack_ref: Array # Well this didn't work
|
||||||
# var b = "text"
|
var state_timeout: Timer
|
||||||
|
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready():
|
func _ready():
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,10 @@ extends State
|
||||||
|
|
||||||
# onready var jump_state: State = get_node(jump_node)
|
# 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 move_speed: float = 60
|
||||||
export var timeout_seconds: float = 0.0
|
|
||||||
|
|
||||||
export(Array, String) var animation_sequence
|
export(Array, String) var animation_sequence
|
||||||
# this just wouldn't work well. Maybe I can try a resource
|
# 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 current_animation_sequence: int = 0
|
||||||
var animation_suffix: String = '';
|
var animation_suffix: String = '';
|
||||||
|
|
||||||
var modifier_stack_ref: Array # Well this didn't work
|
|
||||||
|
|
||||||
var gravity: int = ProjectSettings.get_setting("physics/2d/default_gravity")
|
var gravity: int = ProjectSettings.get_setting("physics/2d/default_gravity")
|
||||||
|
|
||||||
|
|
@ -37,7 +37,7 @@ var parent: KinematicBody2D
|
||||||
|
|
||||||
#var animation_sequence_timer: Timer
|
#var animation_sequence_timer: Timer
|
||||||
|
|
||||||
var state_timeout: Timer
|
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
# Only add timout node if timer value was specified.
|
# Only add timout node if timer value was specified.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user