need help with rondom spawner
randizzapp
Member Posts: 1
good day i am new to gamesalad i am having with spawning actor in my game.i need someone to show me how to spawn random enemy actor or any actor to a particular location in my iphone portrait game in need the jail cell to spawn random in the middle left or right edges of the game .can someone help me please
Comments
Lets say you have 3 enemies A, B, and C and you want to spawn them at specific locations.
---Timer - Every 0.0 seconds, change Attribute RANDOM to random(1,3) (this will set your random value)
---Create a rule, If attribute random = 3, spawn actor C, in position (X,Y) relative to scene.
_____In the ELSE spot put another rule, If attribute random = 2, spawn actor B, in position (X,Y) relative to scene.
---_In the ELSE spot of that one just put spawn actor A, in position (X,Y) relative to scene.
3 will spawn your actors repeatedly every X seconds at whatever X and Y positions you put for your iphone
You don't really need to be generating a random value on every cycle, you can put it into your spawn timer.
Timer, Every (whatever) seconds,
--Change X to random(1,3)
--If attribute X=1 spawn actor A
----Otherwise If attribute X=2 spawn actor B
--------Otherwise spawn actor C
Ahh true... good one @Socks