diff --git a/GameOver.gd b/GameOver.gd new file mode 100644 index 0000000..1b5c1f4 --- /dev/null +++ b/GameOver.gd @@ -0,0 +1,23 @@ +extends Node2D + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + + +func _on_timer_timeout(): + $Restart.visible = true; + $Quit.visible = true; + +func _on_restart_pressed(): + get_tree().change_scene_to_file("res://Levels/level.tscn"); + + +func _on_quit_pressed(): + get_tree().quit(); diff --git a/game_over.tscn b/game_over.tscn new file mode 100644 index 0000000..0536e6c --- /dev/null +++ b/game_over.tscn @@ -0,0 +1,54 @@ +[gd_scene load_steps=3 format=3 uid="uid://d1ek3aw31vio2"] + +[ext_resource type="Script" path="res://GameOver.gd" id="1_2w7nc"] +[ext_resource type="Texture2D" uid="uid://cyodm2ixiok7d" path="res://Images/Game_Over.png" id="2_guyua"] + +[node name="GameOver" type="Node2D"] +script = ExtResource("1_2w7nc") + +[node name="ColorRect" type="ColorRect" parent="."] +offset_left = -35.0 +offset_top = -101.0 +offset_right = 5.0 +offset_bottom = -61.0 +scale = Vector2(50, 50) +color = Color(0, 0, 0, 1) + +[node name="GameOver" type="Sprite2D" parent="."] +position = Vector2(536, 537) +scale = Vector2(8, 8) +texture = ExtResource("2_guyua") + +[node name="Timer" type="Timer" parent="."] +wait_time = 2.0 +one_shot = true +autostart = true + +[node name="Restart" type="Button" parent="."] +offset_left = 1265.0 +offset_top = 352.0 +offset_right = 1718.0 +offset_bottom = 534.0 +theme_override_font_sizes/font_size = 127 +text = "Restart +" + +[node name="Quit" type="Button" parent="."] +offset_left = 1359.0 +offset_top = 591.0 +offset_right = 1628.0 +offset_bottom = 769.0 +theme_override_font_sizes/font_size = 124 +text = "Quit" + +[node name="Label" type="Label" parent="."] +offset_left = 1103.0 +offset_top = 29.0 +offset_right = 1854.0 +offset_bottom = 221.0 +theme_override_font_sizes/font_size = 138 +text = "Game Over" + +[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"] +[connection signal="pressed" from="Restart" to="." method="_on_restart_pressed"] +[connection signal="pressed" from="Quit" to="." method="_on_quit_pressed"]