Death
This commit is contained in:
parent
18424079b4
commit
a764680733
|
|
@ -163,3 +163,7 @@ func _on_Movement_StateMachine_state_changed(old_state_name, new_state):
|
||||||
# stamina_component.reduce_stamina(state_stamina_cost["jump"])
|
# stamina_component.reduce_stamina(state_stamina_cost["jump"])
|
||||||
if state_stamina_cost.has(new_state.name):
|
if state_stamina_cost.has(new_state.name):
|
||||||
stamina_component.reduce_stamina(state_stamina_cost[new_state.name])
|
stamina_component.reduce_stamina(state_stamina_cost[new_state.name])
|
||||||
|
|
||||||
|
|
||||||
|
func _on_Health_Component_health_depleted():
|
||||||
|
movement_state_machine.change_to_known_state('death')
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=36 format=2]
|
[gd_scene load_steps=37 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://lib/parent_scenes/actor.tscn" type="PackedScene" id=1]
|
[ext_resource path="res://lib/parent_scenes/actor.tscn" type="PackedScene" id=1]
|
||||||
[ext_resource path="res://assets/actors/players/playerE/PlayerE_SpriteFrames.tres" type="SpriteFrames" id=2]
|
[ext_resource path="res://assets/actors/players/playerE/PlayerE_SpriteFrames.tres" type="SpriteFrames" id=2]
|
||||||
|
|
@ -29,6 +29,7 @@
|
||||||
[ext_resource path="res://src/actors/players/playerE/states/attack_punch.tres" type="Resource" id=27]
|
[ext_resource path="res://src/actors/players/playerE/states/attack_punch.tres" type="Resource" id=27]
|
||||||
[ext_resource path="res://src/components/PewMachine.tscn" type="PackedScene" id=28]
|
[ext_resource path="res://src/components/PewMachine.tscn" type="PackedScene" id=28]
|
||||||
[ext_resource path="res://lib/components/Stamina_Component.tscn" type="PackedScene" id=29]
|
[ext_resource path="res://lib/components/Stamina_Component.tscn" type="PackedScene" id=29]
|
||||||
|
[ext_resource path="res://src/actors/players/playerE/states/death.tres" type="Resource" id=30]
|
||||||
|
|
||||||
[sub_resource type="Resource" id=3]
|
[sub_resource type="Resource" id=3]
|
||||||
resource_local_to_scene = true
|
resource_local_to_scene = true
|
||||||
|
|
@ -81,7 +82,7 @@ player_number = 1
|
||||||
|
|
||||||
[node name="Movement_StateMachine" parent="." index="0"]
|
[node name="Movement_StateMachine" parent="." index="0"]
|
||||||
starting_state_name = "idle"
|
starting_state_name = "idle"
|
||||||
states = [ ExtResource( 4 ), ExtResource( 9 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 12 ), ExtResource( 11 ), ExtResource( 10 ), ExtResource( 13 ), ExtResource( 14 ), ExtResource( 15 ), SubResource( 3 ), ExtResource( 19 ), ExtResource( 20 ), ExtResource( 22 ), ExtResource( 23 ), ExtResource( 27 ) ]
|
states = [ ExtResource( 4 ), ExtResource( 9 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 12 ), ExtResource( 11 ), ExtResource( 10 ), ExtResource( 13 ), ExtResource( 14 ), ExtResource( 15 ), SubResource( 3 ), ExtResource( 19 ), ExtResource( 20 ), ExtResource( 22 ), ExtResource( 23 ), ExtResource( 27 ), ExtResource( 30 ) ]
|
||||||
|
|
||||||
[node name="AnimatedSprite_StateReceiver" parent="." index="1"]
|
[node name="AnimatedSprite_StateReceiver" parent="." index="1"]
|
||||||
frames = ExtResource( 2 )
|
frames = ExtResource( 2 )
|
||||||
|
|
@ -157,3 +158,4 @@ interactable_parent_callback = "touch_the_thing"
|
||||||
[node name="PewMachine" parent="." index="12" instance=ExtResource( 28 )]
|
[node name="PewMachine" parent="." index="12" instance=ExtResource( 28 )]
|
||||||
|
|
||||||
[connection signal="state_changed" from="Movement_StateMachine" to="." method="_on_Movement_StateMachine_state_changed"]
|
[connection signal="state_changed" from="Movement_StateMachine" to="." method="_on_Movement_StateMachine_state_changed"]
|
||||||
|
[connection signal="health_depleted" from="Health_Component" to="." method="_on_Health_Component_health_depleted"]
|
||||||
|
|
|
||||||
17
src/actors/players/playerE/states/death.tres
Normal file
17
src/actors/players/playerE/states/death.tres
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
[gd_resource type="Resource" load_steps=2 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://lib/classes/state_animated_actor.gd" type="Script" id=1]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
resource_name = "death"
|
||||||
|
script = ExtResource( 1 )
|
||||||
|
debug_state = false
|
||||||
|
timeout_seconds = 0.0
|
||||||
|
name = "death"
|
||||||
|
horizontal_speed = 1.36422e-12
|
||||||
|
horizontal_acceleration = 0.0
|
||||||
|
horizontal_speed_offset = 0.0
|
||||||
|
horizontal_speed_offset_acceleration = 0.0
|
||||||
|
jerk_factor = 0.0
|
||||||
|
animation_sequence = [ "death" ]
|
||||||
Loading…
Reference in New Issue
Block a user