Changing scenes to a random one

beefy_clyrobeefy_clyro Member Posts: 5,394
edited November -1 in Working with GS (Mac)
Hi. I have 40 scenes and was wondering how i would have it so when you touch it changes to scenes at random, i dont want it in order? Thanks

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    you have to have a global integer attribute called myCurrentScene or something like that.

    Then use Change Attribute
    game.myCurrentScene To random(1,40)

    Then, a Rule for each one:

    When game.myCurrentScene is 1
    Change Scene To Scene 1

    When game.myCurrentScene is 2
    Change Scene To Scene 2

    etc...
  • GamexcbGamexcb Member Posts: 179
    Yeah its a lot of tedious work but its the most simple way to do it.
    Copy and paste is key!
    -Gamexcb
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    ah ok, that is tedious, thanks for the help, hope they make that simpler in the future :)
  • firemaplegamesfiremaplegames Member Posts: 3,211
    yes, i have 60 levels! soon to be 100.
    it's in my level select screens
    it's in my "try again" popup
    as well as my "go to the next scene" popup

    so currently i have those rules 120 times!
    yes, very tedious, but it works!

    Also, you can only select from levels in the drop down, so you can't do it ahead of time...
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Cheers guys, that worked a treat although, when i clicked the actor to trigger the change of attribute the scene flickered very quickly with another image behind. To resolve, i had the upon touch change attribute to random(1,40), all sets of when attribute = x, change to scene x and then right at the end added another change attribute but put it back to 0, this seems to ahve stopped the flickering and is working sweet as a nut. yay, thanks again
Sign In or Register to comment.