Generating Shapes in a square and snapping to them

0 favourites
  • 2 posts
From the Asset Store
Gravity Square is a game where I aim to reach the square at the polka dot door :)
  • I am making a game where barrels fall from the top and you drag and drop them into the designated slots and they snap into place. I have it working currently but I am using sprites that I placed to snap the barrels to them then destroy the barrel and change the animation frame on the placeholder sprite to a different color and opacity. I would like to make this blue box area randomly spawn the 3 shapes to fit in the box without overlapping or going outside the bounds and also have them snap from bottom to top since it's a tower stacking idea and it currently snaps to the top first. I'm relatively new to construct so my knowledge is limited and I think I need to scrap my current way of doing it and rework it from scratch. I would like to ask if anyone can help me with how I would achieve this.

    Images :

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I can't tell what you're trying to do exactly from your description and screenshots.

    You say the blocks fall, and you drag and drop them into predefined places.

    But from the last part of your paragraph you want to pack blocks inside an area.

    I'll venture some ideas how you can pack blocks inside an area.

    One is to start with a block the size of the area and split it up into smaller blocks.

    dropbox.com/s/f5h6gh9b3znuqqc/block_split.capx

    Another, which is a bit simpler is to start with a grid of identically sized blocks and merge them together here and there to make the bigger blocks.

    In this one I made it so you can drag blocks onto the grid which snap into place.

    dropbox.com/s/r0ejucffa5a9ue2/block_merge.capx

    Also here is a way to drop blocks on top of each other. But this is a loose packing. The only limit I added was the sides of the screen.

    dropbox.com/s/gsoi09vjspxtx0d/block_fall.capx

    There are probably other ways to do these things too. I don't think any of those are exactly what you were after but some of it may be helpful.

    In general if you break down what you want to do exactly you can then find ways to implement it inside construct's tools.

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