Best way to make this

0 favourites
  • 7 posts
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • Hey Everyone,

    I am trying to figure out the best way to design this:

    cl.ly/f254fed5fc44

    The 10 squares will be static and never change however the shape inside each block will be different and a different number of blocks will be filled at random.

    The one issue that I can see is aligning the container in the center of the screen then placing the sprites inside each box itself.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can just create 10 squares that remain there and change the shape displayed based on animation or animation frame. So 0 is blank and frame 1 could be circle, frame 2 triangle etc.

  • Thanks for the reply Plinkie, I tried that originally but getting the individual sprite squares to line up side by side and get them to center in the middle of the screen is my issue, unless I am missing something easy here?

  • Probably more difficult than it sounds. If it was one object you could centre it on screen using

    set position to

    x=(ViewportLeft(0) + ViewportRight(0))/2

    y=(ViewportTop(0) + ViewportBottom(0))/2

    You could create a sprite, when all the squares are in position, pin them to this sprite. Then use the calculation above on that sprite, then everything would be in the centre of the screen. Depends what your game does really.

  • made u a quick example

    hope it still helps you

    download item_loop_creation_random

    is probably not the best way, but is somewhat the easier way, best way to do this would be working with arrays and dictionary probably if is for inventory purposes. if not the example above should do the trick.

  • Thank you both for the help on this! gamecorpstudio I took a look at your code and incorporated it into mine however the spawn new object is only spawning on the initial "hidden" frame and not on the ones that were generated by the event code. Here is what I have so far: cl.ly/1b94cb49dab0

    This code should fill every frame created but instead its showing this: cl.ly/3140afe51535

  • Edited 4: i cant really fix your file unless i know what u mean by showing < howmanytoshow, the problem is obviously there. if u can upload that portion of code in a file somewhere i can fix it for u.

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