How do I Make Random Layouts and Videos

Get help using Construct 2

Post » Fri Oct 16, 2015 12:23 am

Hi!!!
I'm making a Game of Minigames like Dumb Ways to Die.
I have already done the Minigames, now I want to make the layouts appers random

I finish example 1st, and now I want to apper 4th, but next time want to be the 8th game and so...

Is there anyway that I can make that with Construct 2?

Also I have some videos and I want that they appear randomly... Can this happen to?

Thanks a lot to all.

Greetings from Mexico!!
B
11
S
2
G
1
Posts: 28
Reputation: 1,365

Post » Fri Oct 16, 2015 5:14 am

This would take some coding magic. A few variables to satisfy number variants, and labeling the layouts different numbers.

I would say layouts named "1" "2" "3" etc, then have an event that assigns a "currentlayout" variable as round(random(0-10)) where "10" would be the highest number labeled layout. Then "Go to layout (by name)" and use the variable "currentlayout" instead of a layout name.

Going off the top of my head here.
B
25
S
6
G
6
Posts: 262
Reputation: 3,690

Post » Fri Oct 16, 2015 5:16 am

Of course, you would also need a method to tell it what layouts were already used, and to avoid going to those as well. Not hard to do, I'd use an array or something to keep track of that.
B
25
S
6
G
6
Posts: 262
Reputation: 3,690

Post » Fri Oct 16, 2015 5:47 pm

Thanks roracle, that's one of the first idea that come in my mind.

In a Faceebook Group someone give me the idea, like this:
Go to layout by name then choose (layout1, layout2,....etc)

I have to think about the method to not to play the layouts already used. I will try the array.

Thanks a lot.
B
11
S
2
G
1
Posts: 28
Reputation: 1,365


Return to How do I....?

Who is online

Users browsing this forum: SERG 04 and 3 guests