The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.39 / 5.00 38,635 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.09 / 5.00 15,161 ViewsHey guys, I have an array that i am using to store my mc class. How do i limit my array so that it only gives me a certain amount of mc's at a time like say 5 waves of 10 mc's? Looked on the web for a tutorial and can't find what I need:
var mc:Mc;
var flashtimer = new Timer(2500);
flashtimer.start();
flashtimer.addEventListener(TimerEvent.T IMER, createNewmc;
function createNewmc (e:TimerEvent) : void
{
var enemyArray:Array = new Array();
for (var i:int = 0; i <3; i++)
{
var mc:Mc = new Mc();
mc.x =Math.random() * 480;
mc.y = 180;
mc.scaleX = .2;
mc.scaleY = .2;
mc.addEventListener (Event.ENTER_FRAME, spidermove);
mc.addEventListener (MouseEvent.CLICK, killspider1);
mc.addEventListener (Event.ENTER_FRAME, sp1onTime);
enemyArray.push(mc); //put the enemy into the array
addChild(mc);
Thanx!!!!!!!!!!!!!!!!!!!
You basically have what you need, just put the for loop inside an if statement that says
if(flashTimer reaches a certain time){
your for loop with i<10 instead of i<3
}
and if you only want 5 waves put the
flashTimer.start()
into a for loop that loops 5 times