hey everyone,
i need your help again. i want an actor to appear randomly at a certain point of the world as long as the game runs, with a randomly long break.
thanking you in anticipation :)


import greenfoot.*; class yourWorld extends World{ ActorClass A = new ActorClass(); public yourWorld(){ super(600,400); } public void act(){ int randomNumber = Greenfoot.getRandomNumber(30); if(randomNumber == 15){ int randomX = Greenfoot.getRandomNumber(600); int randomY = Greenfoot.getRandomNumber(400); addObject( A , randomX , random Y ); } } }