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

  • tiger27tiger27 Member Posts: 127

    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 randomspawn is 1
    If pressureplate1 <=3
    
    Spawn Avoid at 129, (whatever you want y to be.)
    
    If randomspawn is 2
    If pressureplate2 <=3
    
    Spawn Avoid at 188, (whatever you want y to be.)
    

    If you encounter trouble message me and I'll see what I can do.

  • avivday1997avivday1997 Member Posts: 3

    @tiger27 said:
    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 randomspawn is 1
    If pressureplate1 <=3
     
    Spawn Avoid at 129, (whatever you want y to be.)
     
    If randomspawn is 2
    If pressureplate2 <=3
    
    Spawn Avoid at 188, (whatever you want y to be.)
    

    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!

  • tiger27tiger27 Member Posts: 127

    Cool, Later!

  • avivday1997avivday1997 Member Posts: 3

    @tiger27 said:
    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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2015

    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

  • tiger27tiger27 Member Posts: 127

    @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.

Sign In or Register to comment.