How to change to selected scenes randomly?

How do I change to selected scenes randomly?Here is an example of what I mean:

Scene 1:Menu
Scene 2:A scene with a button saying 'Change Scene'
Scene 3:A blue scene(SELECTED SCENE)
Scene 4:A red scene (SELECTED SCENE)
Scene 5:A green scene (SELECTED SCENE)
Scene 6:'GAME OVER' scene

There are six scenes.I am now in scene two.After I press a button,I would randomly
change to scene three,four or five.How do I do this?

Also help me with this problem:
http://forums.gamesalad.com/discussion/55005/why-is-my-web-preview-button-not-clickable#latest

I appreciate your help.
:-)

Comments

  • JarrenHJarrenH Member Posts: 206
    Your going to have to set up a integer attribute and put a random number into it. Then based off of the random number, go to the correct scene.

    Change Attribute: self.LevelNum to Random(3,5)

    If self.LevelNum = 3 then
    Change scene: Scene 3
    otherwise
    if self.LevelNum = 4 then
    Change Scene: Scene 4
    otherwise
    if self.levelNum = 5 then
    Change Scene: Scene 5

    This is the only way I know how to do this, unfortunatly you cannot reference a scene using the expression editor, so the only way to do it is nested rules.
  • Pencil Kraken GamesPencil Kraken Games Member Posts: 42
    @JarrenH
    Is there a free template like this or video tutorial?
  • PaxPaxPaxPax Member Posts: 106
    @JarrenH
    Is there a free template like this or video tutorial?
    yes, gshelper has one. random scene generator.
  • Sliced Bread AppsSliced Bread Apps Member Posts: 9
    You could also just have an integer attribute that is in a rule that says (for example) when key --> space --> is down --> change attribute --> game.integer (name it whatever) --> to random(1,3)

    Then you have 3 other rules that say when game.integer = 1, 2, or 3 it changes the scene to different ones for each rule. Hope this helps!
Sign In or Register to comment.