Updated game reset to happen after defeat anim

This commit is contained in:
winniewk 2024-08-19 21:18:33 -04:00
parent 334167167f
commit d26b61d855
5 changed files with 9 additions and 6 deletions

View File

@ -32,7 +32,7 @@ current_scene="res://scenes/game.tscn"
center_split_offset=-272 center_split_offset=-272
selected_default_debugger_tab_idx=0 selected_default_debugger_tab_idx=0
selected_main_editor_idx=2 selected_main_editor_idx=2
selected_bottom_panel_item=0 selected_bottom_panel_item=1
[ScriptEditor] [ScriptEditor]

View File

@ -7,7 +7,7 @@ state={
"folded_lines": Array[int]([]), "folded_lines": Array[int]([]),
"h_scroll_position": 0, "h_scroll_position": 0,
"row": 39, "row": 39,
"scroll_position": 17.0, "scroll_position": 29.0,
"selection": false, "selection": false,
"syntax_highlighter": "GDScript" "syntax_highlighter": "GDScript"
} }
@ -59,11 +59,11 @@ state={
state={ state={
"bookmarks": PackedInt32Array(), "bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(), "breakpoints": PackedInt32Array(),
"column": 17, "column": 16,
"folded_lines": Array[int]([]), "folded_lines": Array[int]([]),
"h_scroll_position": 0, "h_scroll_position": 0,
"row": 115, "row": 29,
"scroll_position": 101.0, "scroll_position": 21.0,
"selection": false, "selection": false,
"syntax_highlighter": "GDScript" "syntax_highlighter": "GDScript"
} }

View File

@ -611,5 +611,6 @@ position = Vector2(559, 84)
[node name="Control" parent="CanvasLayer" instance=ExtResource("11_k7pka")] [node name="Control" parent="CanvasLayer" instance=ExtResource("11_k7pka")]
[connection signal="timeout" from="GameController/Timer" to="GameController" method="resetWorld"] [connection signal="timeout" from="GameController/Timer" to="GameController" method="resetWorld"]
[connection signal="defeatAnimComplete" from="CharacterBody2D" to="GameController" method="resetWorld"]
[connection signal="areatrigger" from="AreaTrigger" to="GameController" method="_on_area_2d_areatrigger"] [connection signal="areatrigger" from="AreaTrigger" to="GameController" method="_on_area_2d_areatrigger"]
[connection signal="body_entered" from="AreaTrigger" to="AreaTrigger" method="_on_body_entered"] [connection signal="body_entered" from="AreaTrigger" to="AreaTrigger" method="_on_body_entered"]

View File

@ -28,7 +28,6 @@ var bullet = preload("res://scenes/bullet.tscn")
var gravity = ProjectSettings.get_setting("physics/2d/default_gravity") var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
func defeated(): func defeated():
print("character body player defeated")
playPlayerAnimation("death") playPlayerAnimation("death")
living = false living = false

View File

@ -45,3 +45,6 @@ func _on_area_2d_coin_collected():
func playerDamage(): func playerDamage():
GameManager.playerDamage() GameManager.playerDamage()
ui.healthUpdate(GameManager.player.currentHealth) ui.healthUpdate(GameManager.player.currentHealth)
func resetGame():
timer.start()