Working prototype

This commit is contained in:
Sch1nken 2024-03-16 19:56:22 +01:00
parent 3de181134d
commit 1ed0ec226d
24 changed files with 682 additions and 31 deletions

25
GameOverMenu.gd Normal file
View file

@ -0,0 +1,25 @@
extends CanvasLayer
@onready var label = $Control/PanelContainer/VBoxContainer/Label
# Called when the node enters the scene tree for the first time.
func _ready():
visible = false
GameEvents.game_over.connect(_on_game_over)
func _on_game_over(black_lost: bool, white_lost: bool) -> void:
visible = true
if black_lost and white_lost:
# draw
label.text = "Draw!"
elif black_lost:
label.text = "White won!"
elif white_lost:
label.text = "Black won!"
else:
print("should never happen...")
func _on_button_pressed():
WSClient.close()
get_tree().change_scene_to_file("res://main_menu.tscn")