How do I use an array to load random levels?

Get help using Construct 2

Post » Tue Oct 20, 2015 2:27 am

And once the level is loaded, remove it from the index?

I'm still very new to Construct 2, and much more to arrays so any help would be greatly appreciated. Thanks!
B
12
S
4
Posts: 29
Reputation: 933

Post » Tue Oct 20, 2015 12:27 pm

You would need a level to oversee the loading of the levels. After each level you would return to the overseer level to load the next level. When you load a level it marks off that it has been run by toggling a Boolean variable. (Only in Construct 2 we do not have Global boolean variables so you need to make one with an intager and use 0 and 1)

That is the simplest for non-programmers that I know of, The more complex version would get the maps from an array. Once it loads a map, it Pops or delete the index that the map info was in, so only the maps that have no run yet remain.

You can then save the array To as local storage. And load it again when needed.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Thu Oct 22, 2015 1:29 am

jojoe wrote:You would need a level to oversee the loading of the levels. After each level you would return to the overseer level to load the next level. When you load a level it marks off that it has been run by toggling a Boolean variable. (Only in Construct 2 we do not have Global boolean variables so you need to make one with an intager and use 0 and 1)

That is the simplest for non-programmers that I know of, The more complex version would get the maps from an array. Once it loads a map, it Pops or delete the index that the map info was in, so only the maps that have no run yet remain.

You can then save the array To as local storage. And load it again when needed.


Thanks for the reply, but I'll be honest and say that I still do not really know how to achieve this exactly. Would you be inclined to help me out more with details if you don't mind? Thank you so much.
B
12
S
4
Posts: 29
Reputation: 933


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 5 guests