Working prototype
This commit is contained in:
parent
3de181134d
commit
1ed0ec226d
24 changed files with 682 additions and 31 deletions
25
GameOverMenu.gd
Normal file
25
GameOverMenu.gd
Normal 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")
|
||||
Loading…
Add table
Add a link
Reference in a new issue