Go To Random Layout

0 favourites
  • 4 posts
From the Asset Store
The ultimate voice pack filled with 1,536 files of .......wav and mp3 of individual numbers, letters, and words (that go
  • Hi All

    I've fiddled about with this but don't think its possible but can you go to a random layout

    with say an on clicked event.

    I'm looking to go to a random level at start of my game, wondered if above not possible, create

    a series of buttons each with a link to a specific layout then display one button at random instead.

    Interested in what people think.

  • Yes it's possible. You'd use something like -

    Sprite on clicked > Goto Layout (by name) > and then in the box use "Layout "&round(random(0,10))

    Or if you have changed your Layout names to something specific to your game, such as level names you could use the "choose" expression so:

    Sprite on clicked > Goto Layout (by name) > and then in the box use choose(emerald hills,underwater caverns,the end,the nether) this will randomly pick 1 value from the comma separated list.

    It just depends on how you have named your Layouts.

  • Thats great, got it working on a random button selection, but your method is alot cleaner.

    Many thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Yes it's possible. You'd use something like -

    Sprite on clicked > Goto Layout (by name) > and then in the box use "Layout "&round(random(0,10))

    Or if you have changed your Layout names to something specific to your game, such as level names you could use the "choose" expression so:

    Sprite on clicked > Goto Layout (by name) > and then in the box use choose(emerald hills,underwater caverns,the end,the nether) this will randomly pick 1 value from the comma separated list.

    It just depends on how you have named your Layouts.

    hey thanks alot it works

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)