mirror of
https://github.com/tonytins/godotstarter.git
synced 2025-03-15 06:01:26 +00:00
Use GameKit singleton
This commit is contained in:
parent
3487305478
commit
9b06a6514b
10 changed files with 23 additions and 23 deletions
|
@ -3,6 +3,9 @@
|
|||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
|
@ -14,6 +17,7 @@ dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
|
|||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
|
@ -23,6 +27,7 @@ flags/srgb=2
|
|||
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
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -21,7 +21,6 @@ run/main_scene="res://scn/TitleScn.tscn"
|
|||
[autoload]
|
||||
|
||||
GameKit="*res://src/GameKit.gd"
|
||||
WinDialogs="*res://scn/WinDialogs.tscn"
|
||||
|
||||
[display]
|
||||
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://src/GameScn.gd" type="Script" id=1]
|
||||
[ext_resource path="res://scn/WinDialogs.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://scn/PauseScn.tscn" type="PackedScene" id=2]
|
||||
|
||||
[node name="GameScn" type="Node"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="WinDialogs" parent="." instance=ExtResource( 2 )]
|
||||
|
||||
[node name="PauseScn" parent="." instance=ExtResource( 2 )]
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://src/WinDialogs.gd" type="Script" id=1]
|
||||
[ext_resource path="res://src/PauseScn.gd" type="Script" id=1]
|
||||
|
||||
[node name="WinDialogs" type="Control"]
|
||||
[node name="PauseScn" type="Control"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="PauseWin" type="PopupDialog" parent="."]
|
||||
|
@ -63,8 +63,7 @@ bbcode_enabled = true
|
|||
bbcode_text = "[center]Created by
|
||||
Anthony Wilcox
|
||||
[/center]"
|
||||
text = "Created by
|
||||
Anthony Wilcox
|
||||
text = "
|
||||
"
|
||||
selection_enabled = true
|
||||
|
||||
|
@ -150,7 +149,6 @@ 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,7 +1,7 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://src/TitleScn.gd" type="Script" id=1]
|
||||
[ext_resource path="res://scn/WinDialogs.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://scn/PauseScn.tscn" type="PackedScene" id=2]
|
||||
|
||||
[node name="TitleScn" type="Node"]
|
||||
script = ExtResource( 1 )
|
||||
|
@ -30,8 +30,7 @@ margin_right = 147.0
|
|||
margin_bottom = 68.0
|
||||
text = "KLIC"
|
||||
|
||||
[node name="WinDialogs" parent="." instance=ExtResource( 2 )]
|
||||
|
||||
[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"]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
extends "res://src/GameKit.gd"
|
||||
extends Node
|
||||
|
||||
func _process(delta):
|
||||
if Input.is_action_pressed("ui_pause"):
|
||||
is_game_paused(true)
|
||||
$WinDialogs/PauseWin.show()
|
||||
GameKit.is_game_paused(true)
|
||||
$PauseScn/PauseWin.show()
|
|
@ -1,8 +1,8 @@
|
|||
extends "res://src/GameKit.gd"
|
||||
extends Control
|
||||
|
||||
func _on_ExitBtn_pressed():
|
||||
is_game_paused(false)
|
||||
switch_scenes("title")
|
||||
GameKit.is_game_paused(false)
|
||||
GameKit.switch_scenes("title")
|
||||
|
||||
func _on_SettingsBtn_pressed():
|
||||
$SettingsWin.show()
|
||||
|
@ -18,4 +18,4 @@ func _on_CloseAbtBtn_pressed():
|
|||
|
||||
func _on_ResumeBtn_pressed():
|
||||
$PauseWin.hide()
|
||||
is_game_paused(false)
|
||||
GameKit.is_game_paused(false)
|
|
@ -1,10 +1,10 @@
|
|||
extends "res://src/GameKit.gd"
|
||||
extends Node
|
||||
|
||||
func _on_PlayBtn_pressed():
|
||||
switch_scenes("game")
|
||||
GameKit.switch_scenes("game")
|
||||
|
||||
func _on_LicenseBtn_pressed():
|
||||
$WinDialogs/LicenseWin.show()
|
||||
$PauseScn/LicenseWin.show()
|
||||
|
||||
func _on_CreditsBtn_pressed():
|
||||
$WinDialogs/CreditsWin.show()
|
||||
$PauseScn/CreditsWin.show()
|
||||
|
|
Loading…
Add table
Reference in a new issue