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

2020/5/11

Once I add the this while loop the world never loads... help!

Smizi Smizi

2020/5/11

#
What am I doing wrong?
int i=0;
        while(i<18)
        {
            addObject(new Leaf(),Greenfoot.getRandomNumber(getWidth()/2),Greenfoot.getRandomNumber(getHeight()/2)); 
        }
danpost danpost

2020/5/11

#
Smizi wrote...
What am I doing wrong? << Code Omitted >>
The thing that is wrong is that the condition to remain in the loop never becomes false.
Smizi Smizi

2020/5/11

#
thank you so much! I totally forgot about that
You need to login to post a reply.