I was wondering about spawning random patterns in my game, here is what I ended up with, not sure if its the best way. Make an integer attribute named Random Number. Do a change attribute rule and change Random Number to "random(1,50)" to pick a number 1-50. Then when you want to spawn something from the list of 50 have a bunch of rules checking for if random is equal to 1 then spawn this one, etc.,etc.,
yea, do exactly what pixelRyan said, pick a random number, and then have rules that say
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
Or if you are just spawning one actor out of the 50 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"
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
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.