From 147831727be6be437ee904da6567aec17f0131ba Mon Sep 17 00:00:00 2001 From: Tony Bark Date: Tue, 18 Feb 2025 13:46:50 -0500 Subject: [PATCH] Refreshed to 4.3 - Did some refactoring and clean up --- .gitignore | 68 +++++-------- project/default_env.tres | 2 +- project/icon.png.import | 32 +++--- project/lang/local.csv | 14 --- project/lang/local.csv.import | 16 --- project/lang/local.en.translation | Bin 825 -> 0 bytes project/lang/local.sv.translation | Bin 856 -> 0 bytes project/project.godot | 22 ++--- project/scenes/GameScn.tscn | 14 +++ project/scenes/PauseScn.tscn | 45 +++++++++ project/scenes/TitleScn.tscn | 25 +++++ project/scn/GameScn.tscn | 9 -- project/scn/PauseScn.tscn | 154 ----------------------------- project/scn/TitleScn.tscn | 36 ------- project/{src => source}/GameKit.gd | 4 +- project/{src => source}/GameScn.gd | 3 +- project/source/PauseScn.gd | 15 +++ project/source/TitleScn.gd | 4 + project/src/PauseScn.gd | 21 ---- project/src/TitleScn.gd | 10 -- 20 files changed, 155 insertions(+), 339 deletions(-) delete mode 100644 project/lang/local.csv delete mode 100644 project/lang/local.csv.import delete mode 100644 project/lang/local.en.translation delete mode 100644 project/lang/local.sv.translation create mode 100644 project/scenes/GameScn.tscn create mode 100644 project/scenes/PauseScn.tscn create mode 100644 project/scenes/TitleScn.tscn delete mode 100644 project/scn/GameScn.tscn delete mode 100644 project/scn/PauseScn.tscn delete mode 100644 project/scn/TitleScn.tscn rename project/{src => source}/GameKit.gd (67%) rename project/{src => source}/GameScn.gd (61%) create mode 100644 project/source/PauseScn.gd create mode 100644 project/source/TitleScn.gd delete mode 100644 project/src/PauseScn.gd delete mode 100644 project/src/TitleScn.gd diff --git a/.gitignore b/.gitignore index cbc6def..8c5faef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,49 +1,22 @@ -### Audio ### - -*.wav -*.ogg - -# Created by https://www.gitignore.io/api/linux,godot,macos,backup,windows,dotnetcore,executable,monodevelop,visualstudiocode -# Edit at https://www.gitignore.io/?templates=linux,godot,macos,backup,windows,dotnetcore,executable,monodevelop,visualstudiocode - -### Backup ### -*.bak -*.gho -*.ori -*.orig -*.tmp - -### DotnetCore ### -# .NET Core build folders -/bin -/obj - -# Common node modules locations -/node_modules -/wwwroot/node_modules - - -### Executable ### -*.app -*.bat -*.cgi -*.com -*.exe -*.gadget -*.jar -*.pif -*.vb -*.wsf +# Created by https://www.toptal.com/developers/gitignore/api/godot,visualstudiocode,macos,linux,windows +# Edit at https://www.toptal.com/developers/gitignore?templates=godot,visualstudiocode,macos,linux,windows ### Godot ### +# Godot 4+ specific ignores +.godot/ # Godot-specific ignores .import/ export.cfg export_presets.cfg +# Imported translations (automatically generated from CSV files) +*.translation + # Mono-specific ignores .mono/ +data_*/ +mono_crash.*.json ### Linux ### *~ @@ -69,6 +42,7 @@ export_presets.cfg # Icon must end with two \r Icon + # Thumbnails ._* @@ -88,15 +62,9 @@ Network Trash Folder Temporary Items .apdisk -### MonoDevelop ### -#User Specific -*.userprefs -*.usertasks - -#Mono Project Files -*.pidb -*.resources -test-results/ +### macOS Patch ### +# iCloud generated files +*.icloud ### VisualStudioCode ### .vscode/* @@ -104,10 +72,18 @@ test-results/ !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix ### VisualStudioCode Patch ### # Ignore all local history of files .history +.ionide ### Windows ### # Windows thumbnail cache files @@ -135,4 +111,4 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk -# End of https://www.gitignore.io/api/linux,godot,macos,backup,windows,dotnetcore,executable,monodevelop,visualstudiocode \ No newline at end of file +# End of https://www.toptal.com/developers/gitignore/api/godot,visualstudiocode,macos,linux,windows diff --git a/project/default_env.tres b/project/default_env.tres index ad86b72..9df75f5 100644 --- a/project/default_env.tres +++ b/project/default_env.tres @@ -1,6 +1,6 @@ [gd_resource type="Environment" load_steps=2 format=2] -[sub_resource type="ProceduralSky" id=1] +[sub_resource type="Sky" id=1] radiance_size = 4 sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 ) diff --git a/project/icon.png.import b/project/icon.png.import index 96cbf46..078624e 100644 --- a/project/icon.png.import +++ b/project/icon.png.import @@ -1,8 +1,9 @@ [remap] importer="texture" -type="StreamTexture" -path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" +type="CompressedTexture2D" +uid="uid://cltqljwt37ib5" +path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex" metadata={ "vram_texture": false } @@ -10,25 +11,24 @@ metadata={ [deps] source_file="res://icon.png" -dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] +dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"] [params] compress/mode=0 +compress/high_quality=false compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 +compress/hdr_compression=1 compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" process/fix_alpha_border=true process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/project/lang/local.csv b/project/lang/local.csv deleted file mode 100644 index c544972..0000000 --- a/project/lang/local.csv +++ /dev/null @@ -1,14 +0,0 @@ -,en,sv -KENG,English,Engelsk -KSWD,Swedish,Svenska -KRUS,Resume,Återuppta -KPUS,Paused,Pausad -KPLY,Play,Spela -KCRE,Credits,Eftertexter -KABO,About,Handla om -KLIC,License,Licens -KSOO,Coming Soon,Kommer snart -KEXT,Exit,Utgång -KHELP,Help,Hjälp -KSET,Settings,Inställningar -KLANG,Languages,Språk \ No newline at end of file diff --git a/project/lang/local.csv.import b/project/lang/local.csv.import deleted file mode 100644 index beece0d..0000000 --- a/project/lang/local.csv.import +++ /dev/null @@ -1,16 +0,0 @@ -[remap] - -importer="csv_translation" -type="Translation" - -[deps] - -files=[ "res://lang/local.en.translation", "res://lang/local.sv.translation" ] - -source_file="res://lang/local.csv" -dest_files=[ "res://lang/local.en.translation", "res://lang/local.sv.translation" ] - -[params] - -compress=true -delimiter=0 diff --git a/project/lang/local.en.translation b/project/lang/local.en.translation deleted file mode 100644 index 351efbdae3a46c5893ff0d1d44496ad3fe22b3c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 825 zcmbu8ze^)Q6vyAGiFf{jv(e(fXkn}jL5o8oD!Hgdim$hH(DJOLIG{lz<2jG)T3xz_FhPY|in?3Vk z^nn~018i9^1fGnIV*I5mp2B#>#IwfF8^2)uvhit-Rm2&P169B^F{N8_^YGjelj`4= z9)Iw@Tnm%xrK`2?i-@^JrpJ66|C8S?V9Y1V{64#rIe0$Q?!4#M2d9vdTDYDx@6XN2 zBMULlXHxxdocH)nU)L9|O#j+?WByHXQhbHZxx4fK|ChPoYkaL&?(@wx=zQaR=IOqr zhs-6u#5_8q+!MBRDdo9~|Qo_p>&XJ+cN^(SPl0PX;o zZvZn@p%-7IBGO8jFpeNy%(`&A4@jks+o>-bD)xnHn7E;R8A-Z!axW4~l1fmPq}C#k znmXYeose`D%SBYzFk(ST>V><|_FK|efp5|#4Wr=rnD)~!F%XYC>;@lY8Xp}UqaJP= zc5cs?vB3i=TGq?N(g1J^V7mhJ0EgCYVtxCBe;4Z^>yKD|V0ql~gk_gw5S%-W^fA?x|b^aXvATO(a=v)WGT$IQ_@>;vUy^ zI*<3e+^j?A9Q@W@eC1E^6W8wIITzOv1J&2rmP*Kr0;zP1UYa1=jsnW7oojdQ=QO)4 zBi#}-72+e*lzYRw-rwDv^5-85haK70Mrm>yQHfLn&otX^QC@qiYTc#jLQXTHtwocv PH%6xIBr$@hj(_Sun(?r2 diff --git a/project/project.godot b/project/project.godot index 71aac21..f6343d6 100644 --- a/project/project.godot +++ b/project/project.godot @@ -6,21 +6,17 @@ ; [section] ; section goes between [] ; param=value ; assign values to parameters -config_version=4 - -_global_script_classes=[ ] -_global_script_class_icons={ - -} +config_version=5 [application] -config/name="Godot 3.1 Starter" -run/main_scene="res://scn/TitleScn.tscn" +config/name="Godot 4.3 Starter" +run/main_scene="res://scenes/TitleScn.tscn" +config/features=PackedStringArray("4.3") [autoload] -GameKit="*res://src/GameKit.gd" +GameKit="*res://source/GameKit.gd" [display] @@ -30,11 +26,11 @@ window/size/resizable=false ui_pause={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null) - ] +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194305,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":6,"pressure":0.0,"pressed":false,"script":null) +] } [locale] -translations=PoolStringArray( "res://lang/local.en.translation", "res://lang/local.sv.translation" ) +translations=PackedStringArray("res://lang/local.en.translation", "res://lang/local.sv.translation") diff --git a/project/scenes/GameScn.tscn b/project/scenes/GameScn.tscn new file mode 100644 index 0000000..cd9afab --- /dev/null +++ b/project/scenes/GameScn.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=4 format=3 uid="uid://b0fl2hf2lbd0s"] + +[ext_resource type="Script" path="res://source/GameScn.gd" id="1"] +[ext_resource type="Texture2D" uid="uid://cltqljwt37ib5" path="res://icon.png" id="2_24hj0"] +[ext_resource type="PackedScene" uid="uid://baomgr7v1oi8q" path="res://scenes/PauseScn.tscn" id="3_gdh7b"] + +[node name="GameScn" type="Node"] +script = ExtResource("1") + +[node name="Sprite2D" type="Sprite2D" parent="."] +position = Vector2(466, 192) +texture = ExtResource("2_24hj0") + +[node name="PauseScn" parent="." instance=ExtResource("3_gdh7b")] diff --git a/project/scenes/PauseScn.tscn b/project/scenes/PauseScn.tscn new file mode 100644 index 0000000..dcb8dc4 --- /dev/null +++ b/project/scenes/PauseScn.tscn @@ -0,0 +1,45 @@ +[gd_scene load_steps=2 format=3 uid="uid://baomgr7v1oi8q"] + +[ext_resource type="Script" path="res://source/PauseScn.gd" id="1"] + +[node name="PauseScn" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1") +metadata/_edit_use_anchors_ = true + +[node name="PauseWin" type="Window" parent="."] +title = "Pause" +position = Vector2i(0, 36) +size = Vector2i(150, 150) +visible = false + +[node name="PauseVbox" type="VBoxContainer" parent="PauseWin"] +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -111.0 +offset_top = -70.0 +offset_right = 108.0 +offset_bottom = 58.0 +grow_horizontal = 2 +grow_vertical = 2 +alignment = 1 + +[node name="ResumeBtn" type="Button" parent="PauseWin/PauseVbox"] +layout_mode = 2 +text = "Resume" + +[node name="ExitBtn" type="Button" parent="PauseWin/PauseVbox"] +layout_mode = 2 +text = "Exit" + +[connection signal="close_requested" from="PauseWin" to="." method="_on_pause_win_close_requested"] +[connection signal="pressed" from="PauseWin/PauseVbox/ResumeBtn" to="." method="_on_resume_btn_pressed"] +[connection signal="pressed" from="PauseWin/PauseVbox/ExitBtn" to="." method="_on_exit_btn_pressed"] diff --git a/project/scenes/TitleScn.tscn b/project/scenes/TitleScn.tscn new file mode 100644 index 0000000..27fb7c1 --- /dev/null +++ b/project/scenes/TitleScn.tscn @@ -0,0 +1,25 @@ +[gd_scene load_steps=2 format=3 uid="uid://dih82g5487hy7"] + +[ext_resource type="Script" path="res://source/TitleScn.gd" id="1"] + +[node name="TitleScn" type="Node"] +script = ExtResource("1") + +[node name="TitleVBox" type="VBoxContainer" parent="."] +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -73.5 +offset_top = -23.5 +offset_right = 73.5 +offset_bottom = 23.5 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="PlayBtn" type="Button" parent="TitleVBox"] +layout_mode = 2 +text = "Play" + +[connection signal="pressed" from="TitleVBox/PlayBtn" to="." method="_on_PlayBtn_pressed"] diff --git a/project/scn/GameScn.tscn b/project/scn/GameScn.tscn deleted file mode 100644 index 89468e7..0000000 --- a/project/scn/GameScn.tscn +++ /dev/null @@ -1,9 +0,0 @@ -[gd_scene load_steps=3 format=2] - -[ext_resource path="res://src/GameScn.gd" type="Script" id=1] -[ext_resource path="res://scn/PauseScn.tscn" type="PackedScene" id=2] - -[node name="GameScn" type="Node"] -script = ExtResource( 1 ) - -[node name="PauseScn" parent="." instance=ExtResource( 2 )] diff --git a/project/scn/PauseScn.tscn b/project/scn/PauseScn.tscn deleted file mode 100644 index 5d45efc..0000000 --- a/project/scn/PauseScn.tscn +++ /dev/null @@ -1,154 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://src/PauseScn.gd" type="Script" id=1] - -[node name="PauseScn" type="Control"] -script = ExtResource( 1 ) - -[node name="PauseWin" type="PopupDialog" parent="."] -pause_mode = 2 -editor/display_folded = true -margin_left = 430.0 -margin_top = 200.0 -margin_right = 606.0 -margin_bottom = 314.0 - -[node name="PauseVbox" type="VBoxContainer" parent="PauseWin"] -anchor_right = 1.0 -anchor_bottom = 1.0 -margin_left = 10.0 -margin_top = 10.0 -margin_right = -10.0 -margin_bottom = -10.0 - -[node name="PauseLbl" type="Label" parent="PauseWin/PauseVbox"] -margin_right = 156.0 -margin_bottom = 14.0 -text = "KPUS" -align = 1 - -[node name="SettingsBtn" type="Button" parent="PauseWin/PauseVbox"] -margin_top = 18.0 -margin_right = 156.0 -margin_bottom = 38.0 -text = "KSET" - -[node name="ResumeBtn" type="Button" parent="PauseWin/PauseVbox"] -margin_top = 42.0 -margin_right = 156.0 -margin_bottom = 62.0 -text = "KRUS" - -[node name="ExitBtn" type="Button" parent="PauseWin/PauseVbox"] -margin_top = 66.0 -margin_right = 156.0 -margin_bottom = 86.0 -text = "KEXT" - -[node name="CreditsWin" type="AcceptDialog" parent="."] -editor/display_folded = true -margin_left = 404.0 -margin_top = 158.0 -margin_right = 752.0 -margin_bottom = 425.0 -window_title = "KCRE" - -[node name="CreditsTxt" type="RichTextLabel" parent="CreditsWin"] -margin_left = 8.0 -margin_top = 8.0 -margin_right = 340.0 -margin_bottom = 231.0 -focus_mode = 2 -bbcode_enabled = true -bbcode_text = "[center]Created by -Anthony Wilcox -[/center]" -text = " -" -selection_enabled = true - -[node name="SettingsWin" type="AcceptDialog" parent="."] -pause_mode = 2 -editor/display_folded = true -margin_left = 504.0 -margin_top = 264.0 -margin_right = 656.0 -margin_bottom = 332.0 -window_title = "KSET" - -[node name="Grid" type="GridContainer" parent="SettingsWin"] -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -margin_left = -68.0 -margin_top = -26.0 -margin_right = 68.0 -margin_bottom = -2.0 -columns = 3 - -[node name="LicenseWin" type="AcceptDialog" parent="."] -editor/display_folded = true -margin_left = 278.0 -margin_top = 159.0 -margin_right = 745.0 -margin_bottom = 431.0 -window_title = "KLIC" - -[node name="LicenseTxt" type="RichTextLabel" parent="LicenseWin"] -margin_left = 8.0 -margin_top = 8.0 -margin_right = 459.0 -margin_bottom = 236.0 -bbcode_enabled = true -bbcode_text = "This is free and unencumbered software released into the public domain. - -Anyone is free to copy, modify, publish, use, compile, sell, or -distribute this software, either in source code form or as a compiled -binary, for any purpose, commercial or non-commercial, and by any -means. - -In jurisdictions that recognize copyright laws, the author or authors -of this software dedicate any and all copyright interest in the -software to the public domain. We make this dedication for the benefit -of the public at large and to the detriment of our heirs and -successors. We intend this dedication to be an overt act of -relinquishment in perpetuity of all present and future rights to this -software under copyright law. - -THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -For more information, please refer to " -text = "This is free and unencumbered software released into the public domain. - -Anyone is free to copy, modify, publish, use, compile, sell, or -distribute this software, either in source code form or as a compiled -binary, for any purpose, commercial or non-commercial, and by any -means. - -In jurisdictions that recognize copyright laws, the author or authors -of this software dedicate any and all copyright interest in the -software to the public domain. We make this dedication for the benefit -of the public at large and to the detriment of our heirs and -successors. We intend this dedication to be an overt act of -relinquishment in perpetuity of all present and future rights to this -software under copyright law. - -THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -For more information, please refer to " -[connection signal="pressed" from="PauseWin/PauseVbox/SettingsBtn" to="." method="_on_SettingsBtn_pressed"] -[connection signal="pressed" from="PauseWin/PauseVbox/ResumeBtn" to="." method="_on_ResumeBtn_pressed"] -[connection signal="pressed" from="PauseWin/PauseVbox/ExitBtn" to="." method="_on_ExitBtn_pressed"] diff --git a/project/scn/TitleScn.tscn b/project/scn/TitleScn.tscn deleted file mode 100644 index 412b9f3..0000000 --- a/project/scn/TitleScn.tscn +++ /dev/null @@ -1,36 +0,0 @@ -[gd_scene load_steps=3 format=2] - -[ext_resource path="res://src/TitleScn.gd" type="Script" id=1] -[ext_resource path="res://scn/PauseScn.tscn" type="PackedScene" id=2] - -[node name="TitleScn" type="Node"] -script = ExtResource( 1 ) - -[node name="TitleVBox" type="VBoxContainer" parent="."] -editor/display_folded = true -margin_left = 428.0 -margin_top = 244.0 -margin_right = 575.0 -margin_bottom = 380.0 - -[node name="PlayBtn" type="Button" parent="TitleVBox"] -margin_right = 147.0 -margin_bottom = 20.0 -text = "KPLY" - -[node name="CreditsBtn" type="Button" parent="TitleVBox"] -margin_top = 24.0 -margin_right = 147.0 -margin_bottom = 44.0 -text = "KCRE" - -[node name="LicenseBtn" type="Button" parent="TitleVBox"] -margin_top = 48.0 -margin_right = 147.0 -margin_bottom = 68.0 -text = "KLIC" - -[node name="PauseScn" parent="." instance=ExtResource( 2 )] -[connection signal="pressed" from="TitleVBox/PlayBtn" to="." method="_on_PlayBtn_pressed"] -[connection signal="pressed" from="TitleVBox/CreditsBtn" to="." method="_on_CreditsBtn_pressed"] -[connection signal="pressed" from="TitleVBox/LicenseBtn" to="." method="_on_LicenseBtn_pressed"] diff --git a/project/src/GameKit.gd b/project/source/GameKit.gd similarity index 67% rename from project/src/GameKit.gd rename to project/source/GameKit.gd index 27a1e1c..d14e111 100644 --- a/project/src/GameKit.gd +++ b/project/source/GameKit.gd @@ -10,6 +10,6 @@ func is_game_paused(is_paused): func switch_scenes(is_mode): if is_mode == "title": - get_tree().change_scene("res://scn/TitleScn.tscn") + get_tree().change_scene_to_file("res://scenes/TitleScn.tscn") elif is_mode == "game": - get_tree().change_scene("res://scn/GameScn.tscn") \ No newline at end of file + get_tree().change_scene_to_file("res://scenes/GameScn.tscn") diff --git a/project/src/GameScn.gd b/project/source/GameScn.gd similarity index 61% rename from project/src/GameScn.gd rename to project/source/GameScn.gd index ba66f57..3a1e899 100644 --- a/project/src/GameScn.gd +++ b/project/source/GameScn.gd @@ -3,4 +3,5 @@ extends Node func _process(delta): if Input.is_action_pressed("ui_pause"): GameKit.is_game_paused(true) - $PauseScn/PauseWin.show() \ No newline at end of file + $PauseScn/PauseWin.move_to_center(); + $PauseScn/PauseWin.show() diff --git a/project/source/PauseScn.gd b/project/source/PauseScn.gd new file mode 100644 index 0000000..eaaf0ee --- /dev/null +++ b/project/source/PauseScn.gd @@ -0,0 +1,15 @@ +extends Control + +func _resume_game() -> void: + $PauseWin.hide() + GameKit.is_game_paused(false) + +func _on_resume_btn_pressed() -> void: + _resume_game() + +func _on_exit_btn_pressed() -> void: + GameKit.is_game_paused(false) + GameKit.switch_scenes("title") + +func _on_pause_win_close_requested() -> void: + _resume_game() diff --git a/project/source/TitleScn.gd b/project/source/TitleScn.gd new file mode 100644 index 0000000..e8ae56a --- /dev/null +++ b/project/source/TitleScn.gd @@ -0,0 +1,4 @@ +extends Node + +func _on_PlayBtn_pressed(): + GameKit.switch_scenes("game") diff --git a/project/src/PauseScn.gd b/project/src/PauseScn.gd deleted file mode 100644 index 0baf1a0..0000000 --- a/project/src/PauseScn.gd +++ /dev/null @@ -1,21 +0,0 @@ -extends Control - -func _on_ExitBtn_pressed(): - GameKit.is_game_paused(false) - GameKit.switch_scenes("title") - -func _on_SettingsBtn_pressed(): - $SettingsWin.show() - -func _on_CreditsBtn_pressed(): - $CreditsWin.show() - -func _on_LicenseBtn_pressed(): - $LicenseWin.show() - -func _on_CloseAbtBtn_pressed(): - $AboutWin.hide() - -func _on_ResumeBtn_pressed(): - $PauseWin.hide() - GameKit.is_game_paused(false) \ No newline at end of file diff --git a/project/src/TitleScn.gd b/project/src/TitleScn.gd deleted file mode 100644 index 1b88877..0000000 --- a/project/src/TitleScn.gd +++ /dev/null @@ -1,10 +0,0 @@ -extends Node - -func _on_PlayBtn_pressed(): - GameKit.switch_scenes("game") - -func _on_LicenseBtn_pressed(): - $PauseScn/LicenseWin.show() - -func _on_CreditsBtn_pressed(): - $PauseScn/CreditsWin.show()