2021-11-14 06:34:51 +00:00
|
|
|
extends Control
|
|
|
|
|
2021-11-24 18:17:07 +00:00
|
|
|
# Path to Board class, for instantiating new Boards in code
|
|
|
|
var Board = preload("res://scenes/Game/Board.tscn")
|
2021-11-14 06:34:51 +00:00
|
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
func _ready():
|
|
|
|
pass # Replace with function body.
|
|
|
|
|
2021-11-24 18:17:07 +00:00
|
|
|
# Reveal a list of ships
|
|
|
|
func reveal_ships(ships:Array):
|
|
|
|
var board = Board.instance()
|
|
|
|
add_child(board);
|
|
|
|
for ship in ships:
|
|
|
|
board.callv("place_ship", ship)
|
2021-11-14 06:34:51 +00:00
|
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
|
|
#func _process(delta):
|
|
|
|
# pass
|
|
|
|
|
2021-11-14 06:43:32 +00:00
|
|
|
func _on_restart_button_down():
|
|
|
|
AudioBus.emit_signal("button_clicked")
|
2021-11-24 18:17:07 +00:00
|
|
|
MessageBus.emit_signal("change_scene", "Multiplayer")
|
|
|
|
MessageBus.emit_signal("kill_scene", "Game")
|
|
|
|
|
2021-11-14 06:34:51 +00:00
|
|
|
|
|
|
|
# returns player(s) back to main menu
|
2021-11-14 06:43:32 +00:00
|
|
|
func _on_exit_to_main_button_down():
|
2021-11-14 06:34:51 +00:00
|
|
|
AudioBus.emit_signal("button_clicked")
|
2021-11-24 18:17:07 +00:00
|
|
|
MessageBus.emit_signal("return_to_title")
|