how can i run this methode once?
I want the else to run once, now if i start the game it will keep spamming Wall_red in the game.
can someone help me?
if(canSee(Red.class))
{
removeObject2(Wall_red.class);
}else
{
World world = getWorld();
world.addObject(new Wall_red(), wall*7,wall*3);
world.addObject(new Wall_red(), wall*11,wall*5);
world.addObject(new Wall_red(), wall*2,wall*7);
world.addObject(new Wall_red(), wall*8,wall*13);
world.addObject(new Wall_red(), wall*6,wall*16);
world.addObject(new Wall_red(), wall*2,wall*22);
world.addObject(new Wall_red(), wall*8,wall*22);
world.addObject(new Wall_red(), wall*11,wall*23);
}
