forked from team-sg/hero-mark-2
respawn animation (implements #213)
This commit is contained in:
parent
7cc669e813
commit
cb6a9e13f4
4 changed files with 90 additions and 2 deletions
BIN
graphics/player/sg_respawn.png
Normal file
BIN
graphics/player/sg_respawn.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.6 KiB |
35
graphics/player/sg_respawn.png.import
Normal file
35
graphics/player/sg_respawn.png.import
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/sg_respawn.png-83125dc5d93640f1f36a4388495f77b6.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://graphics/player/sg_respawn.png"
|
||||||
|
dest_files=[ "res://.import/sg_respawn.png-83125dc5d93640f1f36a4388495f77b6.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=false
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
|
@ -313,9 +313,12 @@ func _on_Drowning_state_entered() -> void:
|
||||||
animation_player.call_deferred("play", "drown")
|
animation_player.call_deferred("play", "drown")
|
||||||
|
|
||||||
func _on_Respawn_state_entered() -> void:
|
func _on_Respawn_state_entered() -> void:
|
||||||
|
animation_player.play("respawn")
|
||||||
global_position = Game.respawn_point
|
global_position = Game.respawn_point
|
||||||
graphics.visible = true
|
graphics.visible = true
|
||||||
state_chart.call_deferred("send_event", "get_real")
|
|
||||||
|
func _on_Respawn_state_exited() -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
func _on_Edge_state_entered():
|
func _on_Edge_state_entered():
|
||||||
animation_player.play("edge")
|
animation_player.play("edge")
|
||||||
|
@ -521,3 +524,8 @@ func _on_OxygenTimer_timeout():
|
||||||
#Reset low oxygen effect when leaving level
|
#Reset low oxygen effect when leaving level
|
||||||
func _on_Player_tree_exited():
|
func _on_Player_tree_exited():
|
||||||
set_underwater_audio(false)
|
set_underwater_audio(false)
|
||||||
|
|
||||||
|
|
||||||
|
func _on_animation_finished(anim_name: String) -> void:
|
||||||
|
if anim_name == "respawn":
|
||||||
|
state_chart.send_event("get_real")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=53 format=2]
|
[gd_scene load_steps=55 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://objects/player/player.gd" type="Script" id=1]
|
[ext_resource path="res://objects/player/player.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://graphics/player/palettes/default.png" type="Texture" id=2]
|
[ext_resource path="res://graphics/player/palettes/default.png" type="Texture" id=2]
|
||||||
|
@ -28,6 +28,7 @@
|
||||||
[ext_resource path="res://graphics/player/sg_jump_ladder.png" type="Texture" id=26]
|
[ext_resource path="res://graphics/player/sg_jump_ladder.png" type="Texture" id=26]
|
||||||
[ext_resource path="res://graphics/player/sg_edge.png" type="Texture" id=27]
|
[ext_resource path="res://graphics/player/sg_edge.png" type="Texture" id=27]
|
||||||
[ext_resource path="res://graphics/player/sg_drown.png" type="Texture" id=28]
|
[ext_resource path="res://graphics/player/sg_drown.png" type="Texture" id=28]
|
||||||
|
[ext_resource path="res://graphics/player/sg_respawn.png" type="Texture" id=29]
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id=1]
|
[sub_resource type="ShaderMaterial" id=1]
|
||||||
shader = ExtResource( 3 )
|
shader = ExtResource( 3 )
|
||||||
|
@ -774,6 +775,47 @@ tracks/3/keys = {
|
||||||
"values": [ 0.0 ]
|
"values": [ 0.0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id=25]
|
||||||
|
resource_name = "respawn"
|
||||||
|
length = 0.4
|
||||||
|
step = 0.05
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/path = NodePath("Graphics/Sprite:texture")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PoolRealArray( 0 ),
|
||||||
|
"transitions": PoolRealArray( 1 ),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ ExtResource( 29 ) ]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/path = NodePath("Graphics/Sprite:hframes")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PoolRealArray( 0 ),
|
||||||
|
"transitions": PoolRealArray( 1 ),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ 8 ]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/path = NodePath("Graphics/Sprite:frame")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PoolRealArray( 0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35 ),
|
||||||
|
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1 ),
|
||||||
|
"update": 1,
|
||||||
|
"values": [ 0, 1, 2, 3, 4, 5, 6, 7 ]
|
||||||
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id=11]
|
[sub_resource type="Animation" id=11]
|
||||||
resource_name = "shoot_airborne"
|
resource_name = "shoot_airborne"
|
||||||
length = 0.001
|
length = 0.001
|
||||||
|
@ -1155,6 +1197,7 @@ anims/idle = SubResource( 6 )
|
||||||
anims/jump = SubResource( 8 )
|
anims/jump = SubResource( 8 )
|
||||||
anims/ladder_jump = SubResource( 21 )
|
anims/ladder_jump = SubResource( 21 )
|
||||||
anims/push = SubResource( 17 )
|
anims/push = SubResource( 17 )
|
||||||
|
anims/respawn = SubResource( 25 )
|
||||||
anims/shoot_airborne = SubResource( 11 )
|
anims/shoot_airborne = SubResource( 11 )
|
||||||
anims/shoot_grounded = SubResource( 10 )
|
anims/shoot_grounded = SubResource( 10 )
|
||||||
anims/stim = SubResource( 19 )
|
anims/stim = SubResource( 19 )
|
||||||
|
@ -1586,6 +1629,7 @@ align = 1
|
||||||
|
|
||||||
[connection signal="tree_exited" from="." to="." method="_on_Player_tree_exited"]
|
[connection signal="tree_exited" from="." to="." method="_on_Player_tree_exited"]
|
||||||
[connection signal="body_entered" from="Hitbox" to="." method="_on_Hitbox_body_entered"]
|
[connection signal="body_entered" from="Hitbox" to="." method="_on_Hitbox_body_entered"]
|
||||||
|
[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_animation_finished"]
|
||||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement" to="." method="_process_movement"]
|
[connection signal="state_physics_processing" from="StateChart/Root/Movement" to="." method="_process_movement"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded" to="." method="_on_Grounded_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded" to="." method="_on_Grounded_state_entered"]
|
||||||
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded" to="." method="_process_grounded"]
|
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded" to="." method="_process_grounded"]
|
||||||
|
@ -1628,6 +1672,7 @@ align = 1
|
||||||
[connection signal="state_entered" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Teleporting_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Teleporting_state_entered"]
|
||||||
[connection signal="state_exited" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Inactive_state_exited"]
|
[connection signal="state_exited" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Inactive_state_exited"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Health/Respawn" to="." method="_on_Respawn_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Health/Respawn" to="." method="_on_Respawn_state_entered"]
|
||||||
|
[connection signal="state_exited" from="StateChart/Root/Health/Respawn" to="." method="_on_Respawn_state_exited"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Health/Dead" to="." method="_on_Dead_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Health/Dead" to="." method="_on_Dead_state_entered"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Health/Drowning" to="." method="_on_Drowning_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Health/Drowning" to="." method="_on_Drowning_state_entered"]
|
||||||
[connection signal="state_exited" from="StateChart/Root/Health/Drowning" to="." method="_on_Drowning_state_exited"]
|
[connection signal="state_exited" from="StateChart/Root/Health/Drowning" to="." method="_on_Drowning_state_exited"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue