24 lines
486 B
GDScript3
24 lines
486 B
GDScript3
|
extends Spatial
|
||
|
|
||
|
|
||
|
# Declare member variables here. Examples:
|
||
|
# var a = 2
|
||
|
# var b = "text"
|
||
|
onready var Enemies = [ $Enemy, $Enemy2 ]
|
||
|
var isWinner = false
|
||
|
|
||
|
# Called when the node enters the scene tree for the first time.
|
||
|
func _ready():
|
||
|
pass # Replace with function body.
|
||
|
|
||
|
|
||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||
|
func _process(delta):
|
||
|
isWinner = true
|
||
|
for Enemy in Enemies:
|
||
|
if !Enemy.isDead:
|
||
|
isWinner = false
|
||
|
|
||
|
if isWinner:
|
||
|
get_tree().quit()
|