extends Node

var playerNode
var enemies = []
var ui
var towersUi
var enemiesDestroyed = 0
var score = 0

var avaliableTowers = 3

func subbTowers():
	if towersUi:
		GameManager.avaliableTowers = max(GameManager.avaliableTowers - 1, 0)
		towersUi.remainingTowers(avaliableTowers)

func addTowers():
	if towersUi:
		GameManager.avaliableTowers = min(GameManager.avaliableTowers + 1, 3)
		towersUi.remainingTowers(avaliableTowers)

func countEnemys():
	enemiesDestroyed += 1

func playAudio(path):
	var stream = load(path)
	$AudioStreamPlayer.stream = stream
	$AudioStreamPlayer.play()

func stopMusic():
	$AudioStreamPlayer.stop()
