Making Random Length Platforms

From the Asset Store
Easily generate many levels from a set of pre-built scenes (Construct 3 template)
  • Hi Guys,

    I have been searching around but couldn't find a definite answer. How do I create a platform that's random in length with a starting and ending image?

    Base on my image above, I would like to start off with the blue triangle, create random amount of red squares and end it with a green triangle.

    Any help is appreciated. Thanks!

  • Have a look at the Template: Auto runner. They seem to use random platform length. You could just tag your start and end blocks on.

    You can find the templates in Construct 2, New Project, and scroll down.

    Hope that helps

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • let's say end pieces are 30 px wide, mid piece 10px

    Call function with parameters where to start (coordinates, param 0 and 1), how many mid pieces there can be (min: param 2, max: param 3)

    function "createplattform":

    vwidth(localvariable) = 0

    -- : create starttile at (function.param(0),function.param(1))

    add 30 to vwidth

    -- for 1 to floor(random(function.param(2),function.param(3)+1): create midtile at (function.param(0)+vwidth,function.param(1))

    add 10 to vwidth

    -- : create endtile at (function.param(0)+vwidth,function.param(1))

    Just make sure that the origin point of the tile is at 0,0 of the image (not in the middle) or you get overlaps.

  • mindfaQ

    Thanks! Will give it a try.

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