howto Spawn random actors?
guru-at-zidware
Member Posts: 369
HI..working on a quiz of sorts and wanted to spawn random actors, say from a list of 50? Any thoughts?
John
John
Comments
http://gamesalad.com/game/1621
http://gamesalad.com/game/1627
if number = 1
spawn actor1
if number = 2
spawn actor2
but, to keep memory down, you're better off hiding all the actors offscreen, and then MOVING them into the camera's view depending on the number, spawning and destroying is very taxing on memory
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
Then you could do what I did for my one card poker game.
Create just one actor to spawn an in the actor
Have this. Create an integer attribute called something like random
Change attribute. Self.random to random(1,50)
Change attribute. Self.image to floor(self.random)..".png"
Just name all your images like 1.png, 2.png etc.