How do I choose random level, but...

Get help using Construct 2

Post » Sun Mar 08, 2015 4:45 pm

How do I allow the player to choose a random level, but exclude the previous 3 levels played? I want the excluded levels to be playable after 3 levels have been played.
B
3
Posts: 8
Reputation: 194

Post » Sun Mar 08, 2015 7:55 pm

Ummm... I think you can add an array (small 3 by 1) and then store the last three levels as Lvl1,Lvl 2, Lvl 3 then you can code in after the random lvl number that is the lvl number equals any of the past three it re-rolls (You will probably need another mechanism that stores the last lvl then pushes the next two back.)
B
9
S
2
Posts: 54
Reputation: 638

Post » Mon Mar 09, 2015 7:09 pm

MythStylz wrote:Ummm... I think you can add an array (small 3 by 1) and then store the last three levels as Lvl1,Lvl 2, Lvl 3 then you can code in after the random lvl number that is the lvl number equals any of the past three it re-rolls (You will probably need another mechanism that stores the last lvl then pushes the next two back.)


I'm unfamiliar with using arrays. I'll have to read more on it. I think I get the part of storing the level and re-rolling if it lands on any of the stored numbers. I don't understand how I can "push the next two back." Maybe on start of layout, modify the array?

Is there an easier way? Is it possible do this using variables?
B
3
Posts: 8
Reputation: 194


Return to How do I....?

Who is online

Users browsing this forum: Aquanex2, Johnzo, tarek2 and 2 guests