Add a value to actors in loop
Posted: Tue Jun 12, 2007 3:50 pm
I'm converting some old Basic code I made a while back. When it comes to the For/Next loops I'm not sure how they translate to GE. For example, to assign the value 100 to the X position of 5 objects in my old code is something like:
for a=1 to 5 : Position Object (a),100,0 : Next a
How can I do a similar thing to my actors, ie if they are named as
Alien1, Alien2, Alien3 etc....
Can I do a For/Next loop and assign values to an array of 5 objects called Alien with something like...
for(i=0; i<5; i++)
{
Alien[i].x=100;
}
for a=1 to 5 : Position Object (a),100,0 : Next a
How can I do a similar thing to my actors, ie if they are named as
Alien1, Alien2, Alien3 etc....
Can I do a For/Next loop and assign values to an array of 5 objects called Alien with something like...
for(i=0; i<5; i++)
{
Alien[i].x=100;
}