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

2020/10/9

How to add wait

ShauryaThapan ShauryaThapan

2020/10/9

#
Hello, Creating a game. Want to add wait between Greenfoot.setWorld(new Next()); and Greenfoot.setWorld(new Space());
    public void YouWin()
    {
        if (Score >= 50)
        {
            Greenfoot.setWorld(new Space());
            Greenfoot.setWorld(new Next());
            
            Greenfoot.setWorld(new Space());
        }
    }

    public void YouWin2()
    {
        if (Score >= 100)
        {
            Greenfoot.setWorld(new Space());
            Greenfoot.setWorld(new Next());
            
            Greenfoot.setWorld(new Space());
        }  
    }

    public void YouWin3()
    {
        if (Score >= 200)
        {
            getWorld().addObject(new YouWin(), 300, 300);
        }  
    }
ShauryaThapan ShauryaThapan

2020/10/9

#
Greenfoot.setWorld(new Next()); = Next Level Slide Greenfoot.setWorld(new Space()); = Play Area
danpost danpost

2020/10/9

#
Add int timer to Next class. Increment and check value each act frame. When reaching some value (maybe 120), set a new Space world active.
ShauryaThapan ShauryaThapan

2020/10/9

#
Got it
You need to login to post a reply.