mirror of
https://github.com/tonytins/godotstarter.git
synced 2025-03-14 21:51:25 +00:00
Refreshed to 4.3
- Did some refactoring and clean up
This commit is contained in:
parent
c8011a16dd
commit
147831727b
20 changed files with 155 additions and 339 deletions
68
.gitignore
vendored
68
.gitignore
vendored
|
@ -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
|
||||
# End of https://www.toptal.com/developers/gitignore/api/godot,visualstudiocode,macos,linux,windows
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
|
@ -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
|
Binary file not shown.
Binary file not shown.
|
@ -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")
|
||||
|
|
14
project/scenes/GameScn.tscn
Normal file
14
project/scenes/GameScn.tscn
Normal file
|
@ -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")]
|
45
project/scenes/PauseScn.tscn
Normal file
45
project/scenes/PauseScn.tscn
Normal file
|
@ -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"]
|
25
project/scenes/TitleScn.tscn
Normal file
25
project/scenes/TitleScn.tscn
Normal file
|
@ -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"]
|
|
@ -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 )]
|
|
@ -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 <http://unlicense.org>"
|
||||
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 <http://unlicense.org>"
|
||||
[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"]
|
|
@ -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"]
|
|
@ -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")
|
||||
get_tree().change_scene_to_file("res://scenes/GameScn.tscn")
|
|
@ -3,4 +3,5 @@ extends Node
|
|||
func _process(delta):
|
||||
if Input.is_action_pressed("ui_pause"):
|
||||
GameKit.is_game_paused(true)
|
||||
$PauseScn/PauseWin.move_to_center();
|
||||
$PauseScn/PauseWin.show()
|
15
project/source/PauseScn.gd
Normal file
15
project/source/PauseScn.gd
Normal file
|
@ -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()
|
4
project/source/TitleScn.gd
Normal file
4
project/source/TitleScn.gd
Normal file
|
@ -0,0 +1,4 @@
|
|||
extends Node
|
||||
|
||||
func _on_PlayBtn_pressed():
|
||||
GameKit.switch_scenes("game")
|
|
@ -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)
|
|
@ -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()
|
Loading…
Add table
Reference in a new issue