When I start my level in multiplayer mode, the result of following code is always 20, but in single player there are random values.. do you know what's the reason behind that??
Code:
void onLevelLoad()
{
for(int i = 0; i <= 20; i++) jjAddObject(OBJECT::APPLE, jjRandom()%3000, jjRandom()%3000);
}
int count()
{
int x = 0;
for (int i = 1; i < jjObjectCount-1; i++) if(jjObjects[i].isActive) x++;
return x;
}
void onMain()
{
if(jjGameTicks%210 == 0) jjAlert(""+count());
}
@Sir Ementaler: Thanks!
Last edited by Stavros; Mar 12, 2014 at 11:34 AM.
|