Main Menu buttons work

This commit is contained in:
Nicholas 2025-05-17 15:28:23 +01:00
parent c7eda0a08a
commit d4a4f1e826
7 changed files with 22 additions and 5 deletions

View File

@ -1,6 +1,8 @@
[gd_scene load_steps=3 format=3 uid="uid://bmvb0o7ohxcfd"] [gd_scene load_steps=5 format=3 uid="uid://bmvb0o7ohxcfd"]
[ext_resource type="Texture2D" uid="uid://yqukd7l5xsxg" path="res://Cat on news.PNG" id="1_5b7ti"] [ext_resource type="Texture2D" uid="uid://yqukd7l5xsxg" path="res://Cat on news.PNG" id="1_5b7ti"]
[ext_resource type="Script" uid="uid://dseq7dsrcpds6" path="res://start_game.gd" id="1_i5qic"]
[ext_resource type="Script" uid="uid://br2tmqcmfkf7a" path="res://exit_game.gd" id="2_12kdf"]
[sub_resource type="SystemFont" id="SystemFont_7yr4w"] [sub_resource type="SystemFont" id="SystemFont_7yr4w"]
@ -12,7 +14,7 @@ anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
[node name="Button" type="Button" parent="."] [node name="Start button" type="Button" parent="."]
layout_mode = 0 layout_mode = 0
offset_left = 367.0 offset_left = 367.0
offset_top = 168.0 offset_top = 168.0
@ -21,8 +23,9 @@ offset_bottom = 246.0
theme_override_fonts/font = SubResource("SystemFont_7yr4w") theme_override_fonts/font = SubResource("SystemFont_7yr4w")
theme_override_font_sizes/font_size = 51 theme_override_font_sizes/font_size = 51
text = "Start" text = "Start"
script = ExtResource("1_i5qic")
[node name="Button2" type="Button" parent="."] [node name="Exit button" type="Button" parent="."]
offset_left = 368.0 offset_left = 368.0
offset_top = 332.0 offset_top = 332.0
offset_right = 778.0 offset_right = 778.0
@ -30,9 +33,13 @@ offset_bottom = 410.0
theme_override_fonts/font = SubResource("SystemFont_7yr4w") theme_override_fonts/font = SubResource("SystemFont_7yr4w")
theme_override_font_sizes/font_size = 51 theme_override_font_sizes/font_size = 51
text = "Exit" text = "Exit"
script = ExtResource("2_12kdf")
[node name="Sprite2D" type="Sprite2D" parent="."] [node name="Background" type="Sprite2D" parent="."]
z_index = -100 z_index = -100
position = Vector2(578.503, 288.125) position = Vector2(578.503, 288.125)
scale = Vector2(2.71364, 2.71364) scale = Vector2(2.71364, 2.71364)
texture = ExtResource("1_5b7ti") texture = ExtResource("1_5b7ti")
[connection signal="pressed" from="Start button" to="Start button" method="_on_pressed"]
[connection signal="pressed" from="Exit button" to="Exit button" method="_on_pressed"]

View File

@ -1,2 +1 @@
# GameJam # GameJam

4
exit_game.gd Normal file
View File

@ -0,0 +1,4 @@
extends Button
func _on_pressed() -> void:
get_tree().quit()

1
exit_game.gd.uid Normal file
View File

@ -0,0 +1 @@
uid://br2tmqcmfkf7a

View File

@ -11,5 +11,6 @@ config_version=5
[application] [application]
config/name="The crystaline adventure" config/name="The crystaline adventure"
run/main_scene="uid://bmvb0o7ohxcfd"
config/features=PackedStringArray("4.4", "Forward Plus") config/features=PackedStringArray("4.4", "Forward Plus")
config/icon="res://icon.svg" config/icon="res://icon.svg"

4
start_game.gd Normal file
View File

@ -0,0 +1,4 @@
extends Button
func _on_pressed() -> void:
get_tree().change_scene_to_file("res://startLevel.tscn")

1
start_game.gd.uid Normal file
View File

@ -0,0 +1 @@
uid://dseq7dsrcpds6