summaryrefslogtreecommitdiff
path: root/scenes
diff options
context:
space:
mode:
Diffstat (limited to 'scenes')
-rw-r--r--scenes/game_over.gd5
-rw-r--r--scenes/game_over.tscn37
-rw-r--r--scenes/levels/base_level.gd4
-rw-r--r--scenes/menu.tscn1
4 files changed, 44 insertions, 3 deletions
diff --git a/scenes/game_over.gd b/scenes/game_over.gd
new file mode 100644
index 0000000..0d1787a
--- /dev/null
+++ b/scenes/game_over.gd
@@ -0,0 +1,5 @@
+extends Node2D
+
+
+func _on_AnimationPlayer_animation_finished(anim_name):
+ get_tree().change_scene("res://scenes/menu.tscn")
diff --git a/scenes/game_over.tscn b/scenes/game_over.tscn
new file mode 100644
index 0000000..1a0aa37
--- /dev/null
+++ b/scenes/game_over.tscn
@@ -0,0 +1,37 @@
+[gd_scene load_steps=5 format=2]
+
+[ext_resource path="res://textures/texts/game_over.png" type="Texture" id=1]
+[ext_resource path="res://scenes/game_over.gd" type="Script" id=2]
+[ext_resource path="res://textures/backgrounds/background_grey.png" type="Texture" id=3]
+
+[sub_resource type="Animation" id=1]
+resource_name = "fly"
+length = 3.048
+tracks/0/type = "bezier"
+tracks/0/path = NodePath("Sprite:position:y")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/keys = {
+"points": PoolRealArray( 92.8571, -0.25, 0, 0.47, 446.97, -924.456, -0.52, -186.363, 0.25, 0 ),
+"times": PoolRealArray( 2, 3 )
+}
+
+[node name="Node2D" type="Node2D"]
+position = Vector2( 403.175, 267.103 )
+script = ExtResource( 2 )
+
+[node name="Sprite2" type="Sprite" parent="."]
+position = Vector2( 194.362, 97.3519 )
+texture = ExtResource( 3 )
+
+[node name="Sprite" type="Sprite" parent="."]
+position = Vector2( 230.523, 73.7867 )
+scale = Vector2( 1.06474, 1.06474 )
+texture = ExtResource( 1 )
+
+[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
+autoplay = "fly"
+anims/fly = SubResource( 1 )
+[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_AnimationPlayer_animation_finished"]
diff --git a/scenes/levels/base_level.gd b/scenes/levels/base_level.gd
index 66085c5..29f72d7 100644
--- a/scenes/levels/base_level.gd
+++ b/scenes/levels/base_level.gd
@@ -47,8 +47,8 @@ func _on_Level_lost_heart(instakill):
if instakill:
_health = 0
_health -= 1
- if _health == 0:
- pass # TODO: lose scenario
+ if _health <= 0:
+ get_tree().change_scene("res://scenes/game_over.tscn")
_health_bar.set_health(_health)
func _load_next_level():
diff --git a/scenes/menu.tscn b/scenes/menu.tscn
index 3828ad6..48707b6 100644
--- a/scenes/menu.tscn
+++ b/scenes/menu.tscn
@@ -194,7 +194,6 @@ anims/startgame = SubResource( 2 )
[node name="Outgoing" type="AnimationPlayer" parent="."]
anims/tointro = SubResource( 3 )
anims/tosettings = SubResource( 4 )
-
[connection signal="on_click" from="Content/Back" to="." method="_on_Back_on_click"]
[connection signal="on_click" from="Content/HardMode" to="." method="_on_HardMode_on_click"]
[connection signal="on_click" from="Content/Exit" to="." method="_on_Exit_on_click"]