online multiplayer chess game (note server currently down)
Diffstat (limited to 'Globals.gd')
-rw-r--r--Globals.gd20
1 files changed, 19 insertions, 1 deletions
diff --git a/Globals.gd b/Globals.gd
index a90b33b..0b2e72b 100644
--- a/Globals.gd
+++ b/Globals.gd
@@ -14,6 +14,8 @@ var board_color1: Color = Color(0.870588, 0.890196, 0.901961)
var board_color2: Color = Color(0.54902, 0.635294, 0.678431)
var white_king: King = null
var black_king: King = null
+var spectating := false
+var chat: Chat = null
var turn := true # true for white, false for black
# true cuz white goes first
@@ -22,6 +24,7 @@ func reset_vars() -> void:
__nosethalfmove = false
pawns = []
team = true
+ spectating = false
grid = null
fullmove = 1
halfmove = 0
@@ -54,10 +57,25 @@ func get_turn() -> String:
return "white" if turn else "black"
+func get_team() -> String:
+ return "white" if team else "black"
+
+
func _ready() -> void:
VisualServer.set_default_clear_color(Color.black)
Debug.monitor(self, "fullmove")
Debug.monitor(self, "halfmove")
Debug.monitor(self, "in_check")
Debug.monitor(self, "turn", "get_turn()")
- Debug.monitor(self, "team")
+ Debug.monitor(self, "team", "get_team()")
+ Debug.monitor(self, "static memory", "get_static_memory()")
+ Debug.monitor(self, "dynamic memory", "get_dynamic_memory()")
+ Debug.monitor(Engine, "fps", "get_frames_per_second()")
+
+
+func get_static_memory() -> String:
+ return String.humanize_size(OS.get_static_memory_usage())
+
+
+func get_dynamic_memory() -> String:
+ return String.humanize_size(OS.get_dynamic_memory_usage())