Page 1 of 1
Looping using For
Posted:
Thu Oct 30, 2003 3:49 am
by jazz_e_bob
Why doesn't this code create 100 big rocks?
int t;
int TotalBigRocks = 100;
for (t = 1; t < 100; t++)
{
CreateActor("rockBig", "rockBig", "no parent", "no path", 0, 0, false);
}
Posted:
Thu Oct 30, 2003 11:32 am
by makslane
It is creating all in the same position 0, 0
Posted:
Thu Oct 30, 2003 7:00 pm
by jazz_e_bob
I thought so too but each rock has a random angle and directional velocity. I imagined they would fan out from the one position.
Maybe I should be using a timer as a loop instead?
Posted:
Thu Oct 30, 2003 8:32 pm
by makslane
New bug here...
It is very strange, it happens when calls CreateActor in loop like for or while.
Try use a timer: Periodic, 12ms, 100 times
Posted:
Fri Oct 31, 2003 2:52 am
by jazz_e_bob
Yes, I tried the timer method. Works well.