Random Scene Selection
In my game, i want to have it randomly order which of the scenes(minigames) it runs.
Like when they hit "Play", it goes to another scene, and displays the order in which they will play the minigames. When they hit continue it runs in the scenes in that order. In addition, each minigame has a little score scene between them summing up their total scores.
So how do i go about doing this?
Like when they hit "Play", it goes to another scene, and displays the order in which they will play the minigames. When they hit continue it runs in the scenes in that order. In addition, each minigame has a little score scene between them summing up their total scores.
So how do i go about doing this?
Comments
-If actor receives touch
-CHANGE Attribute "Game.Scene" to random(min,max)
//* your minimum is likely to be "1" and the max stands for the playable levels//*
Then a NEW Rule:
-If Attribute "Game.Scene" = 1
- Change Scene to "Level 1"
A New RULE:
-If Attribute "Game.Scene" = 2
- Change Scene to "Level 2"
and so on....
I think what I'm getting at is, I know how to randomize them all by integers, which i have set up. And then call the integers by saying like -If random_game1 = 2 then change scene to game1-
But how can I have the last 3 minigames be randomized between 1-4 without selecting one that has been selected.
EX: -random_game1 = (random(1,4))-....and say it comes out to pick 2..then I have...-random_game2 (rand(1,4)-...but i don't want this one to pick 2 as well. And so on.
Sorry if thats confusing haha...
Create a boolean attribute for each scene you're choosing from.
Do your random select to pick a scene.
When a scene is selected set the boolean for that scene to true.
Each time you randomly select run a check to see if the boolean for that scene is already true (i.e. has already been picked);
If it is then discard that result and roll again.
That way you should only get each scene picked once.
Hope that makes sense!