Add pausing

This commit is contained in:
2025-01-08 16:53:40 -06:00
parent c1b3601170
commit bb9140169f
12 changed files with 115 additions and 4 deletions

View File

@@ -0,0 +1,33 @@
class_name PauseSystem extends Node
enum PauseType {
NOT_PAUSED,
FULLY_PAUSED,
ENTITY_PAUSED,
CUTSCENE_PAUSED
};
var pauseType:PauseType = PauseType.NOT_PAUSED;
var entities:Array = [];
var playerPaused:bool = false;
func getPauseState() -> PauseType:
if isPlayerPaused():
return PauseType.FULLY_PAUSED;
return pauseType;
func pause(
pauseType:PauseType,
entities:Array = [],
) -> void:
self.pauseType = pauseType;
self.entities = entities;
func unpause() -> void:
self.pauseType = PauseType.NOT_PAUSED;
func isPlayerPaused() -> bool:
return playerPaused;
func playerPauseToggle() -> void:
playerPaused = !playerPaused;