How do I Create Random Sprite size layout

0 favourites
  • 3 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • Hello everyone.

    I have a layout size: 1500,700, and this event:

    [attachment=0:11xwe935][/attachment:11xwe935]

    it works, but i would like that the creation of the object was only between 100 and 600 on Y axis, and not the total size o Y axis.

    How can i do that?

  • By using the wonderful random(A,B) function, thus random(100,600)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Or, if you are allowing resize, random(LayoutHeight * x%, LayoutHeight * y%), where x% and y% are the minimum and maximum %of the height they should appear.

    For example:

    In a 480 x 640 layout if you'd like to have they appear between 100 and 600, you should use random(LayoutHeight * 0.16, LayoutHeight * 0.94), so, if the layout resizes to double its original size (960x1280), instead of having sprites appearing only in the upper half of the screen (100-600) they'd still be distributed proportionally as you expected (200-1200)...

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