Add initial project files and implement core game features
- Created README.md with project description and setup instructions - Added project configuration files (TheGame.csproj, TheGame.sln, project.godot) - Implemented main game scenes (MainMenu.tscn, Game.tscn, LoadGameMenu.tscn) - Developed game logic in C# scripts (Game.cs, MainMenu.cs, LoadGameMenu.cs, PauseMenu.cs, SaveManager.cs) - Introduced save/load functionality and timer display - Included icon.svg for game branding
This commit is contained in:
120
scenes/Game.tscn
Normal file
120
scenes/Game.tscn
Normal file
@@ -0,0 +1,120 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bqkwdpfmu7tge"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/Game.cs" id="1_xncbp"]
|
||||
[ext_resource type="Script" path="res://scripts/PauseMenu.cs" id="2_a5qiy"]
|
||||
|
||||
[node name="Game" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource("1_xncbp")
|
||||
|
||||
[node name="Background" type="ColorRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
color = Color(0.2, 0.3, 0.4, 1)
|
||||
|
||||
[node name="UI" type="Control" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
|
||||
[node name="PauseButton" type="Button" parent="UI"]
|
||||
layout_mode = 0
|
||||
anchor_right = 0.1
|
||||
anchor_bottom = 0.08
|
||||
offset_left = 10.0
|
||||
offset_top = 10.0
|
||||
offset_right = -10.0
|
||||
offset_bottom = -10.0
|
||||
text = "☰"
|
||||
|
||||
[node name="TimerLabel" type="Label" parent="UI"]
|
||||
layout_mode = 0
|
||||
anchor_left = 0.85
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.08
|
||||
offset_left = 10.0
|
||||
offset_top = 10.0
|
||||
offset_right = -10.0
|
||||
offset_bottom = -10.0
|
||||
text = "00:00:00"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="GameContent" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -100.0
|
||||
offset_top = -20.0
|
||||
offset_right = 100.0
|
||||
offset_bottom = 20.0
|
||||
text = "GAME CONTENT HERE
|
||||
Press ESC or click pause button to pause"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="PauseMenu" type="Control" parent="."]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource("2_a5qiy")
|
||||
|
||||
[node name="Background" type="ColorRect" parent="PauseMenu"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
color = Color(0, 0, 0, 0.8)
|
||||
|
||||
[node name="MenuContainer" type="VBoxContainer" parent="PauseMenu"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -100.0
|
||||
offset_top = -120.0
|
||||
offset_right = 100.0
|
||||
offset_bottom = 120.0
|
||||
|
||||
[node name="TitleLabel" type="Label" parent="PauseMenu/MenuContainer"]
|
||||
layout_mode = 2
|
||||
text = "PAUSED"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="PauseMenu/MenuContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ResumeButton" type="Button" parent="PauseMenu/MenuContainer"]
|
||||
layout_mode = 2
|
||||
text = "Resume"
|
||||
|
||||
[node name="SaveButton" type="Button" parent="PauseMenu/MenuContainer"]
|
||||
layout_mode = 2
|
||||
text = "Save Game"
|
||||
|
||||
[node name="MainMenuButton" type="Button" parent="PauseMenu/MenuContainer"]
|
||||
layout_mode = 2
|
||||
text = "Exit to Main Menu"
|
||||
|
||||
[node name="DesktopButton" type="Button" parent="PauseMenu/MenuContainer"]
|
||||
layout_mode = 2
|
||||
text = "Exit to Desktop"
|
||||
|
||||
[connection signal="pressed" from="UI/PauseButton" to="." method="_on_pause_button_pressed"]
|
||||
[connection signal="pressed" from="PauseMenu/MenuContainer/ResumeButton" to="PauseMenu" method="_on_resume_button_pressed"]
|
||||
[connection signal="pressed" from="PauseMenu/MenuContainer/SaveButton" to="PauseMenu" method="_on_save_button_pressed"]
|
||||
[connection signal="pressed" from="PauseMenu/MenuContainer/MainMenuButton" to="PauseMenu" method="_on_main_menu_button_pressed"]
|
||||
[connection signal="pressed" from="PauseMenu/MenuContainer/DesktopButton" to="PauseMenu" method="_on_desktop_button_pressed"]
|
||||
54
scenes/LoadGameMenu.tscn
Normal file
54
scenes/LoadGameMenu.tscn
Normal file
@@ -0,0 +1,54 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cdnyu0lqxhn80"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/LoadGameMenu.cs" id="1_l8m0c"]
|
||||
|
||||
[node name="LoadGameMenu" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource("1_l8m0c")
|
||||
|
||||
[node name="Background" type="ColorRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
color = Color(0.15, 0.15, 0.25, 1)
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -200.0
|
||||
offset_top = -200.0
|
||||
offset_right = 200.0
|
||||
offset_bottom = 200.0
|
||||
|
||||
[node name="TitleLabel" type="Label" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "LOAD GAME"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="SaveList" type="VBoxContainer" parent="VBoxContainer/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="BackButton" type="Button" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Back to Main Menu"
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/BackButton" to="." method="_on_back_button_pressed"]
|
||||
54
scenes/MainMenu.tscn
Normal file
54
scenes/MainMenu.tscn
Normal file
@@ -0,0 +1,54 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dsrcpteclv0ar"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/MainMenu.cs" id="1_g4hxb"]
|
||||
|
||||
[node name="MainMenu" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource("1_g4hxb")
|
||||
|
||||
[node name="Background" type="ColorRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
color = Color(0.15, 0.15, 0.25, 1)
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -100.0
|
||||
offset_top = -100.0
|
||||
offset_right = 100.0
|
||||
offset_bottom = 100.0
|
||||
|
||||
[node name="TitleLabel" type="Label" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "THE GAME"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="StartButton" type="Button" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Start Game"
|
||||
|
||||
[node name="LoadButton" type="Button" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Load Game"
|
||||
|
||||
[node name="ExitButton" type="Button" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Exit"
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/StartButton" to="." method="_on_start_button_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/LoadButton" to="." method="_on_load_button_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/ExitButton" to="." method="_on_exit_button_pressed"]
|
||||
Reference in New Issue
Block a user