Dear Experts
I have a problem with the constructor of an actor. I want every actor not to appear from beginning on without delay. It would be perfect, if it is appearing for the first time after 10 seconds.
I tried this, but it does not work, what ever delay i put into:
Every solution is helpful for me. Thanks a lot!
wueschn
public class Klingonen extends Actor
{
public Klingonen()
{
int zahl = Greenfoot.getRandomNumber(2) + 1;
this.setImage("k" + zahl + "." + "png");
Greenfoot.delay(100000);
this.getImage().setTransparency(0);
this.setRotation(Greenfoot.getRandomNumber(65) - 5);
}public void act()
{
if(Greenfoot.getRandomNumber(1000) < 2)
{
if(this.getImage().getTransparency() == 0)
{
this.getImage().setTransparency(110);
}
else
{
this.getImage().setTransparency(0);
}
}
}
