Deleting enemies if too much
Posted: Mon Oct 09, 2017 10:03 am
I wish to stop enemies spawning when there are over 5 enemies, keeping the number of enemies at 5
I however have no idea how to do this properly, and as a result the enemies keep spawning and do not stop
Might be good to look at:
I actually have no idea why this does not work at stopping the enemies from spawning even if the enemies are far above 10.
You can make the "newTimer" a lower number so you can see the enemies flood the screen if you wish to test it
I however have no idea how to do this properly, and as a result the enemies keep spawning and do not stop
Might be good to look at:
Code: Select all
if timer < 1 and MaxPens < 5 then
Enemy_Pen_Spawn(randomX,randomY,20,20)
MaxPens = MaxPens + 1
end
You can make the "newTimer" a lower number so you can see the enemies flood the screen if you wish to test it