View Single Post
Stavros Stavros's Avatar

JCF Member

Joined: Mar 2014

Posts: 1

Stavros is doing well so far

Mar 12, 2014, 09:08 AM
Stavros is offline
Reply With Quote
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 10:34 AM.