Initial commit

This commit is contained in:
Tony Bark 2025-02-18 18:49:00 +00:00
commit cd3ef1c3da
14 changed files with 497 additions and 0 deletions

15
project/source/GameKit.gd Normal file
View file

@ -0,0 +1,15 @@
extends Node
const NOT_IMPLEMENTED = "This feature is not implemented"
func is_game_paused(is_paused):
if is_paused == true:
get_tree().paused = true
else:
get_tree().paused = false
func switch_scenes(is_mode):
if is_mode == "title":
get_tree().change_scene_to_file("res://scenes/TitleScn.tscn")
elif is_mode == "game":
get_tree().change_scene_to_file("res://scenes/GameScn.tscn")

View file

@ -0,0 +1,7 @@
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()

View 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()

View file

@ -0,0 +1,4 @@
extends Node
func _on_PlayBtn_pressed():
GameKit.switch_scenes("game")