2022-10-12 15:46:47 -04:00
|
|
|
extends Spatial
|
|
|
|
|
|
|
|
|
|
|
|
# Declare member variables here. Examples:
|
|
|
|
# var a = 2
|
|
|
|
# var b = "text"
|
|
|
|
var enemycount = 2
|
2022-10-12 16:04:23 -04:00
|
|
|
onready var NEXTSCENE = "res://Levels/Level05.tscn"
|
2022-10-12 15:46:47 -04:00
|
|
|
|
|
|
|
onready var WinMess = $Messages/Win
|
|
|
|
onready var EndTimer = $End
|
|
|
|
|
2022-10-12 21:20:58 -04:00
|
|
|
onready var balls = $"Player/HUD/PlayerLayer/ActualHUD/Balls"
|
|
|
|
|
2022-10-12 15:46:47 -04:00
|
|
|
func _ready():
|
2022-10-12 21:20:58 -04:00
|
|
|
balls.text = String(enemycount)
|
2022-10-12 15:46:47 -04:00
|
|
|
|
|
|
|
|
|
|
|
func _on_Enemy_dying():
|
|
|
|
enemycount -= 1
|
2022-10-12 21:20:58 -04:00
|
|
|
balls.text = String(enemycount)
|
2022-10-12 15:46:47 -04:00
|
|
|
if enemycount == 0:
|
|
|
|
WinMess.show()
|
|
|
|
EndTimer.start()
|
|
|
|
|
|
|
|
|
|
|
|
func _on_Win_timeout():
|
|
|
|
get_tree().change_scene(NEXTSCENE)
|
|
|
|
|