"multiply frog enemy" timer and array AS3
- by VideoDnd
How can I use the counter value to multiply the frogs in the array? My counter goes from 0-100. I want to prove that I can increment the enemies using a counter.
EXPLAINED BETTER
I have 10 frogs in an array. I want to use a timer to add 10 more frogs on each iteration of the TimerEvent.TIMER firing.
//currentCount
var timer:Timer = new Timer(1000, 50);
timer.addEventListener(TimerEvent.TIMER, countdown);
timer.start();
function countdown(event:TimerEvent) {
// myText.text = String(0 + timer.currentCount);
}
//Creates 10 enemies "I want enemies to multiply 0-100"
var enemyArray:Array = new Array();
for (var i:int = 0; i < 10; i++)
{
var noname:FrogClass = new FrogClass();
noname.x = i*10; //this will just assign some different x and y value depending on i.
noname.y = i*11;
enemyArray.push(noname); //put the enemy into the array
addChild(noname); //puts it on the stage
}
SYMBOL PROPERTIES
NAME "noname"
CLASS "FrogClass"
WHY
I need specific examples using strings and arrays, because I'm stuck in a learning curve.
Stupid examples are more fun!