Random levels

Discussion and feedback on Construct 2

Post » Wed Jul 20, 2016 7:14 pm

Hi guys

I want to make a game with random choosing levels

for example , i made 10 levels for my game and when i press or click on start button , the computer choose a random level and start it

if you provide a tutorial on youtube , it would be awesome

thanks guys
B
2
Posts: 7
Reputation: 166

Post » Wed Jul 20, 2016 8:38 pm

I think for this question you don't need a video.

You just have to change one line
Image
with "go to layout by name" you can randomly choose a level the program should jump to.

Edit: you don't need a variable (like shown in the screenshot)

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Post » Fri Jul 22, 2016 7:31 am

Based on @fm4fanAT 's solution you can use this expression with the Go to layout by name action as well: "Layout "&int(random(10)+1)" if you named your layouts accordingly.
B
128
S
33
G
17
Posts: 1,551
Reputation: 20,488


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests