Random Questions for Game? Random Scenes?
Breezeonhold
Member Posts: 187
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
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
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...
Thanks Jamieo
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.
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.
↓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.