Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | NeetUI |
In my Top-down shooting game, I have an array of enemy like this:
var normal_enemy = preload(“res://scenes/normalEnemy.tscn”)
var runner_enemy = preload(“res://scenes/runnerEnemy.tscn”)
var flying_enemy = preload(“res://scenes/flyingEnemy.tscn”)
var grabber_enemy = preload(“res://scenes/grabberEnemy.tscn”)
var tanker_enemy = preload(“res://scenes/tankerEnemy.tscn”)
var enemies_list = [normal_enemy, runner_enemy, flying_enemy, grabber_enemy, tanker_enemy]
The problem is I want “grabber” enemy to exist on the map one at a time (for balancing reason, think it’s like a mini boss). I can check if it is still on the map but is there any idea or logic how to temporary prevent the program to randomize and spawn more “grabber” if there is one on the map (all enemies are spawned as instance node) and let the program randomly spawn a new one if the one on the map is dead.