How do I stack different blocks together using the tile movement behavior?

0 favourites
  • 5 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • Hello guys. I'm trying to create a puzzle game. The main idea is to move and stack blocks tightly to each other. Everything goes well when the blocks look like vertical or horizontal bars, but when I'm trying to stack blocks with different shapes, then troubles begin. As you can see from the attached .gif, the green block just sly away when I try to put the blue one on the empty place in that way to create a square.

    This should be a game for my math class, but I have no clue how to resolve that issue. Maybe somebody knows how to do this. Every idea is appreciated.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It looks like if both the tile movement objects are solid, then they will push each other based on the bounding box rather than the collision box and not block movement. Ashley is this intended behavior?

    If you turn off solid for your object with default controls, they move together fine even with exact fit collision boxes.

    To work around this, you might want to not use the built in solids behavior at all, and make your own pushing/blocking mechanic through events.

  • It looks like if both the tile movement objects are solid, then they will push each other based on the bounding box rather than the collision box and not block movement. Ashley is this intended behavior?

    If you turn off solid for your object with default controls, they move together fine even with exact fit collision boxes.

    To work around this, you might want to not use the built in solids behavior at all, and make your own pushing/blocking mechanic through events.

    Hey oosyrag, thank you for the quick response. But I'm scared that I didn't describe the intended behavior fully and that could be a cause of misunderstanding. Yes, you are right. Everything works as expected when solid behavior is disabled, but then blocks are allowed to overlap each other.

    I want to create a game slightly similar to Tetris, where a player can move different shapes, stack them together but do not overlap other shapes on the screen.

  • They only push each other if they are both solid, and only overlap if they are both not solid.

    If only the one that isn't moving is solid, then it should work. You can use simulated controls if you still want to be able to push blocks, as I mentioned before.

  • They only push each other if they are both solid, and only overlap if they are both not solid.

    If only the one that isn't moving is solid, then it should work. You can use simulated controls if you still want to be able to push blocks, as I mentioned before.

    I thought so as well. I was disabling the solid for blocks that aren't moving. Also, I was setting collisions disabled for those blocks. But unfortunately, no one option out of those two does not work.

    It seems to resolve this issue is more difficult than it may look in the first place.

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