From 1aa41dde900f42dce4c268dc8186969853d7c493 Mon Sep 17 00:00:00 2001 From: agent-bot Date: Mon, 17 Aug 2026 17:51:33 +0000 Subject: [PATCH] Add main menu scene and script for Godot 4 project validation --- scenes/main_menu.tscn | 40 ++++++++++++++++++++++++++++++++++++++++ scripts/main_menu.gd | 13 +++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 scenes/main_menu.tscn create mode 100644 scripts/main_menu.gd diff --git a/scenes/main_menu.tscn b/scenes/main_menu.tscn new file mode 100644 index 0000000..9fb5cc7 --- /dev/null +++ b/scenes/main_menu.tscn @@ -0,0 +1,40 @@ +[gd_scene load_steps=2 format=3 uid="uid://main_menu"] + +[ext_resource type="Script" path="res://scripts/main_menu.gd" id="1_main"] + +[node name="MainMenu" type="Control"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_main") + +[node name="CenterContainer" type="CenterContainer" parent="."] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"] +layout_mode = 1 +theme_override_constants/separation = 16 +size_flags_horizontal = 4 + +[node name="TitleLabel" type="Label" parent="CenterContainer/VBoxContainer"] +layout_mode = 1 +text = "AGP Game" +horizontal_alignment = 1 +theme_override_font_sizes/font_size = 72 + +[node name="PlayButton" type="Button" parent="CenterContainer/VBoxContainer"] +layout_mode = 1 +text = "Play" +size_flags_horizontal = 4 + +[node name="QuitButton" type="Button" parent="CenterContainer/VBoxContainer"] +layout_mode = 1 +text = "Quit" +size_flags_horizontal = 4 diff --git a/scripts/main_menu.gd b/scripts/main_menu.gd new file mode 100644 index 0000000..c7131ae --- /dev/null +++ b/scripts/main_menu.gd @@ -0,0 +1,13 @@ +extends Control + + +func _ready(): + pass + + +func _on_play_button_pressed(): + get_tree().change_scene_to_file("res://scenes/game.tscn") + + +func _on_quit_button_pressed(): + get_tree().quit()