Random Questions for Game? Random Scenes?

BreezeonholdBreezeonhold Member Posts: 187
edited November -1 in Working with GS (Mac)
Ok so I'm making this brain game like Jeopardy. I was wondering how you could make random questions pop up so that every time they start the app and click play it would appear with a new random question.

I could just make a bunch of scenes; but how would I make it pick random scenes??

Thanks hopefully someone can help me,

Ben

Comments

  • BreezeonholdBreezeonhold Member Posts: 187
    Anybody know?
  • Jamieo1977Jamieo1977 Member Posts: 7
    Hi

    Create an attribute (integer) for your scene, call it sceneselector, use the change attribute command to change sceneselector to a random number.

    Now create rules..
    if scenesleector =1 go to scene 2
    if sceneselector =2 go to scene 3
    etc..etc...
  • BreezeonholdBreezeonhold Member Posts: 187
    Will this make it go to random scenes? Well I'll test it soon; but have to go somewhere right now.

    Thanks Jamieo
  • SparkyidrSparkyidr Member Posts: 2,033
    yeah, should work.
    basically, you need an atribute that picks a random number when you click a button or whatever.
    Then tie up your scenes to a number.
    then say when the number is 1, pick scene 1, when it's 2 pick 2, when it's 23 pick 23.

    Becuase the attribute is picking a random number, hence the scene picked will be random.
  • BreezeonholdBreezeonhold Member Posts: 187
    Ok thanks!!!
  • BreezeonholdBreezeonhold Member Posts: 187
    Wait should I do this on every scene? Or just the button that their pushing when they start?
  • BreezeonholdBreezeonhold Member Posts: 187
    The only thing not working is that random number now in my change attribute... I tried a function of "random(1,5)" and that does nothing except go to one scene however when I have just = 1 then it goes to my scene 1 or if I have =2 it goes to scene 2... so on and so on... Just making it go to a random scene is still not working.
  • SparkyidrSparkyidr Member Posts: 2,033
    so you have an attribute, "scene number"
    when you click your button, have it change that attribute to "random(1,5)"
    then have a rule that says :
    when scene number = 1 change scene to scene1
    when scene number = 2 change scene to scene 2
    etc
    ??

    That looks like it should work.
  • BreezeonholdBreezeonhold Member Posts: 187
    Ok so here's what I have on my Start button so right when they click start it'll go right to the RANDOM questions. This start button is called "Title" and is the first scene.

    ↓Rule
    -Actor receives event - touch - is - pressed
    (The attribute below is put above the otherwise in the grey box)
    ↓Change Attribute
    -Change Attribute: self.Sceneselctor - To: random(1,5)
    -->Otherwise:

    (Separate Rule/ Box)

    -->Rule
    - Attribute - self.Scenes... = 1
    ↓Change Scene
    -Go to Scene: Question 1
    -->Otherwise:

    (Separate Rule/ Box)

    -->Rule
    -Attribute- self.Scenes... = 2
    ↓Change Scene
    -Go to Scene: Question 2
    --> Otherwise:

    It keeps on going down like this with the rules until 5. Hopefully you can find my problem. Also for some reason everytime I click my button it goes to the "question 5" scene.
  • BreezeonholdBreezeonhold Member Posts: 187
    ha I'm stupid!!!!! Ok here's what I was doing. Everything was right except when I tested it I was refreshing it and for some reason that doesn't work. When I go to the bottom of my scenes, click the "title" scene, and then click my "start" button on the scene it goes to random scenes. So it works thanks for helping ha
Sign In or Register to comment.