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

2016/2/6

Random Location spawn

The_Shados The_Shados

2016/2/6

#
HI, I am having trouble creating multiple objects in random locations in my world. pls help
Super_Hippo Super_Hippo

2016/2/6

#
This places 10 objects of class 'ClassName' in the world.
for (int i=0; i<10; i++) addObject(new ClassName(), Greenfoot.getRandomNumber(getWidth()), Greenfoot.getRandomNumber(getHeight()));
The_Shados The_Shados

2016/2/6

#
thank you it worked.
You need to login to post a reply.