number of random spawning
hello,
i'm kind of new on gamesalad and im creating a game.
my game is an endless runner,
in my game there is an object called: avoid - object that keep on coming.
there is an integer that called randomspawn and i've changed it to random(1,2).
if randomspawn = 1, avoid will spawn on Y = 188
if random spawn = 2, avoid will spawn on Y = 129
i don't want it to spawn more than 3 times in a row.
how can i do it?
for example(1 will be the 188, 2 is 129):
1 1 1 1 1 1 1
2 2 2 2
this is how i like to be, not more than 3 times in arrow.
Now it spawning lots of times in a row and i want to change..
it spawn like:
1 1 1 1 1 1 1 1 1 1 1111 111111
2 2 2 2 2 2 22 22
help me ! please!!!
thanks, Aviv Day.
Answers
Okay, you should try creating an invisible pressure plate for both locations. If an avoid touches the 1st pressure plate, add one to an attribute titled PressurePlate1. If an avoid touches the 2nd pressure plate, add one to an attribute titled PressurePlate2. Then, in the spawner:
If you encounter trouble message me and I'll see what I can do.
thank you very much, its very late now, i'll check on this tommorow.
thanks again!
Cool, Later!
i understood what you said,
but what is a pressure plate? how can i create it? and what i need to for checking if avoid touch the pressure plate?
thanks again
Here's a demo I made with Mac Creator. You may want to Google convert mac to windows gamesalad to find instructions for opening it on a PC.
The basic idea is that you concatenate the value of the random number onto a text string and when the last three characters of that text string are "111" you force the next value to be 2 and when they are "222" you force the next value to be 1; otherwise, you choose a random value between 1 and 2.
Here's a sample list of values it generated:
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@avivday1997 a "pressure plate" is just an invisible actor for an actor to collide with. To check if avoid touched the pressure plate, just create a collide behavior.