Hey guys, i have s problem.
I try to add some objects in the creation progress of my world : IG.
I use a for loop, like that in the "public IG()"
Then, in my Bloc class :
But i get an actor not in world error message from java console.
I think it's probably easy, but brain.class is running out of memory. And i have to put the code in thoses classes, like the code of setting the blocs picture must be in the bloc class.
Thanks a lot !
for(int j = 0; j < 2; j++) //Boucles d'ajout des blocs
{
for(int i=0; i < 6; i++)
{
Bloc bloc = new Bloc(Greenfoot.getRandomNumber(10) );
addObject(bloc, 100 + (i*121), 70 + (j*100));
}
}public Bloc(int param)
{
if(param <= 5)
{
setImage("bloc.png");
}
else if(param > 5)
{
setImage("blochelice.png");
getWorld().addObject(new Helice(), getX(), getY() ); //this part gets highlighted
}
}


