How do I select random layout w/o repeating the same layout?

Just started using Construct 2? Post your questions here

Post » Sat Jun 10, 2017 12:34 am

I have my game set to choose random layouts. However, I can't figure out how to ensure that no layout is repeated. I would love any ideas. Thanks! <3 - Aubra
B
5
Posts: 2
Reputation: 229

Post » Sat Jun 10, 2017 6:47 pm

@aubrataylor
You can add the layout names or numbers to an array.
At the start of the play session shuffle the array using something like this:

https://www.dropbox.com/s/h8pmfmjgfkvu8 ... .capx?dl=0

(Run in debug to see the array data)

You can then just step through the array using a variable e.g.:
On trigger, add 1 to LayoutCurrent
Go to layout array.At(LayoutCurrent)
B
19
S
8
G
3
Posts: 429
Reputation: 3,972

Post » Sat Jun 10, 2017 7:14 pm

@aubrataylor

Here's a capx that combines all of the above:

https://www.dropbox.com/s/ay29f20t54x43 ... .capx?dl=0
B
19
S
8
G
3
Posts: 429
Reputation: 3,972

Post » Fri Jun 16, 2017 10:58 pm

Thank you so much! I look forward to playing with this over the weekend <3.
B
5
Posts: 2
Reputation: 229


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest