almost random level

Get help using Construct 2

Post » Sun Feb 26, 2012 7:38 am

is there a way of having the computer generate a random layout from a selected few,

example layouts

main menu
options
lvl 1
lvl 2
lvl 3
lvl 4


I want the computer to choose random layout from (lvl 1-lvl 4) not main menu or options
B
11
S
1
Posts: 57
Reputation: 1,519

Post » Sun Feb 26, 2012 9:08 am

[code]go to layout (by name) "lvl "&floor(random(4)+1)[/code]
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Mon Feb 27, 2012 12:56 am

Thank you very much, I shall try this now
B
11
S
1
Posts: 57
Reputation: 1,519

Post » Mon Feb 27, 2012 1:47 am

Apologies, I tried but not working.

Do I have to name my layouts with just numbers no words for this to work?
B
11
S
1
Posts: 57
Reputation: 1,519

Post » Mon Feb 27, 2012 1:57 am

got it, took out the spaces

instead of (lvl 1) I changed to (lvl1) and it worked perfectly.

code I used in case anyone is having same problem
"lvl" & floor(random(1,6))

Thanks for your help yann
B
11
S
1
Posts: 57
Reputation: 1,519


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests