I'm trying to make enemies spawn randomly in a specified location but i can't get it to work, for example:
I have a sprite called Spawn and then i duplicated it all over the map, until here is all fine but when i do System -> Every 5 seconds -> Create Object Enemy on layer 0 at (Spawn.X , Spawn.Y) it always creates the enemy always in the first spawn and not in the others <img src="smileys/smiley26.gif" border="0" align="middle" />,
I tried to change the (Spawn.X , Spawn.Y) to (random(Spawn.X) , random(Spawn.Y)) but it also doesn't work (enemies never spawns). <img src="smileys/smiley26.gif" border="0" align="middle" />
Can anyone help me?
Thank you ^^
you can use the choose operator like this:
System.Every 5 Seconds:
-> System.Create Object Enemy at layer 0 at (Choose(x1, x2, x3, x4), Choose(y1, y2, y3, y4)
You can add as many parameters to the choose operator as you want(I think). Change the x1 to x positions you want obviously.
Hope that helps! <img src="smileys/smiley1.gif" border="0" align="middle" />
Here is the cap with smitchell idea(thanks): dl.dropbox.com/u/18148396/spawn2.capx
Here is the cap without smitchell idea (which only spawns in 1 location): dl.dropbox.com/u/18148396/Spawn.capx