How do I stick a block next to another

0 favourites
  • 4 posts
From the Asset Store
Ever intrigued by these little sticks to have just fun… Play 20 level of scintillating level of Match Sticks puzzle.
  • Hello

    how can i stick or pin a block to an other which is the same object?

    i want to make a game with blocks in it and i want to be able to pin a block to an others bottom or side.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • if you have a bunch of the same objects, you need to select the individual object before you can assign it an Action. Otherwise you will make all the objects do the same Action.

    so: 'For Each <object>' cycles through all the objects and you can assess each one at a time. or you can filter them by some sort of compare. Use the IIDs since that is unique and a way to identify each one.

    for your block scenario you need to create some instance variable that tells whether the block is currently in it's "stuck" state. I'd also have another variable that states if that block is the one everyone else is stuck to. Although it depends on your design..

  • Another method is to use families.

    So you have your block object. Add that to a family (let's call the family BlockFam)

    Then you can do..

    if BlockFam is overlapping Block at offset (0, -1) then pin BlockFam to Block.

    Very simplistic, but the complexity depends on what you're trying to achieve.

  • Thank you guys, i want to make a game similar of Junkbot this old lego game http://www.funnygames.in/game/lego_junkbot_1.html

    but i dont want to use lego blocks.

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