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

2015/1/6

Need Help Spawning random actors

Thanatos Thanatos

2015/1/6

#
I want to spawn 4 random classes in a world, how can I do this?
xFabi xFabi

2015/1/6

#
How about Using random Numbers? Private void spawn() { Int Count = 4; Int Random = 0 If(Count>0){ random = greenfoot.getRandomNumber(x,c) If(Random=1){ ... Count--; } Etc. }
danpost danpost

2015/1/6

#
Will this be during gameplay? if so, what parts should be random? possibilities are (a) when one is spawned (b) which one is spawned, (c) where one is spawned.
You need to login to post a reply.