This site requires JavaScript, please enable it in your browser!
Greenfoot back
mcgougan33
mcgougan33 wrote ...

2016/3/28

I need my actor to spawn after 10 seconds

mcgougan33 mcgougan33

2016/3/28

#
Hi guys, So I am currently trying to get a plane to spawn into my game after 10 seconds, I am unsure how to write this in the actor and also whether it has to be written in the world. Could someone please advise?
Super_Hippo Super_Hippo

2016/3/28

#
Use this in the world subclass:
private int timer = 0;

public void act()
{
    timer++;
    if (timer==550)
    {
        addObject(new Plane(), 100, 200); //change coordinates
    }
}
You need to login to post a reply.