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

2013/4/16

Need help having trouble to set the wombat initial leaves eaten to a random number from 1 - 17 and Currently, the wombats face EAST once placed in the world the wombat face a random direction as they are placed in the world

infant17 infant17

2013/4/16

#
Im a beginner in greenfoot and I somewhat get it but these two commands are giving me trouble can some help me?
sametguzelgun sametguzelgun

2013/4/16

#
Greenfoot.getRandomNumber (int number); thanks to generate the random numbers. setRotation (int angle); method can determine the angle through.
infant17 infant17

2013/4/16

#
does this go into the wombatworld or wombat class
sametguzelgun sametguzelgun

2013/4/16

#
wombat class
infant17 infant17

2013/4/16

#
thanks
infant17 infant17

2013/4/16

#
one more question what do you mean when u say thanks to generate the random number
sametguzelgun sametguzelgun

2013/4/16

#
I mean: to derive a random number between the numbers 1-17. Greenfoot.getRandomNumber (17); as
danpost danpost

2013/4/16

#
Actually, with 'max' set at '17' and 'min set at '1', you would use
int rand = Greenfoot.getRandomNumber(max + 1 - min) + min;
You need to login to post a reply.