mirror of
https://github.com/JohnBreaux/Boat-Battle.git
synced 2025-02-04 12:28:35 +00:00
Added victory screen
Added a victory screen. Since there is no current way to win, there is a 'win' button added to the top left of the game screen. Once clicked, victory text will appear and the player will be given the option to return to the main menu.
This commit is contained in:
@@ -14,6 +14,8 @@ onready var Fire = preload("res://scenes/Game/Fire.tscn")
|
||||
# Path to Player class, for instantiating new Players in code
|
||||
onready var Player = preload("res://scenes/Game/Player.tscn")
|
||||
|
||||
onready var Victory = preload("res://scenes/Game/Victory.tscn")
|
||||
|
||||
|
||||
# Array of instances of the Player class; stores the Players
|
||||
var players # = player1, player2, ...
|
||||
@@ -59,3 +61,10 @@ func _on_Forfeit_pressed():
|
||||
|
||||
func end():
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_Button_button_down():
|
||||
AudioBus.emit_signal("button_clicked")
|
||||
var victory = Victory.instance()
|
||||
add_child(victory)
|
||||
victory.connect("exit_main", self, "end")
|
||||
|
||||
Reference in New Issue
Block a user