Random spawn only once

kiwacikiwaci Member, PRO Posts: 72
so, i'm making an endless game and i have 3 power-ups and what i want is to spawn randomly one of these power-ups once, then respawn a different one after 10sec ,so on.Can anyone please help me.

Thanks

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited March 2014
    Change attribute game.random (integer) to random(1,3)
    When attribute game.random=1
         [spawn actor 1]
    When attribute game.random=2
         [spawn actor 2]
    When attribute game.random=3
         [spawn actor 3]

    Timer every 10 seconds
         Change attribute game.random (integer) to random(1,3)
         When attribute game.random=1
              [spawn actor 1]
         When attribute game.random=2
              [spawn actor 2]
         When attribute game.random=3
              [spawn actor 3]

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited March 2014
    Do you want the choice to be unique each time? So that an example of a pattern of power-ups would be 1,3,2,4 but not 1,1,4,4? If so, Google random table gamesalad and you'll see a bunch of videos and comments about how to do this.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • kiwacikiwaci Member, PRO Posts: 72
    Do you want the choice to be unique each time? So that an example of a pattern of power-ups would be 1,3,2,4 but not 1,1,4,4? If so, Google random table gamesalad and you'll see a bunch of videos and comments about how to do this.
    no, thanks man , you guys are the best , that works perfectly. Again, thank you :)
Sign In or Register to comment.