0 Favourites

Block Pushing

This forum is currently in read-only mode.
  • I'm trying to make pushable blocks for my platformer but I've had no luck so far. Does anyone have any examples/tips on how to do this? Basically I need to be able to push the block left or right and have it fall over ledges. I'd like to use physics for this but I couldn't get anything decent with it :T Thanks for any help!

  • Give the Block the "Platform" Behavior. That'll give it automatic gravity too.

    Now, for the movement, Use the "Set X Component of Movement" in the Platformer actions to make it move as your character is pushing ("Move Left/Right" Control is Down + Overlapping at Offset (0,1)) the block. Use an "Else" to set the movement back to 0 when you're not pushing it.

    Hope this helps.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Here's a quick pushing example using the physics behaviour.

    http://dl.dropbox.com/u/1646976/pushing.cap

    I did make a custom movement version but it goes mental when a block lands on another block. I also got random lockups of the preview too. If you a need an example using custom movement I can have another experiment with it.

  • Give the Block the "Platform" Behavior. That'll give it automatic gravity too.

    Now, for the movement, Use the "Set X Component of Movement" in the Platformer actions to make it move as your character is pushing ("Move Left/Right" Control is Down + Overlapping at Offset (0,1)) the block. Use an "Else" to set the movement back to 0 when you're not pushing it.

    Hope this helps.

    Here is a example using Xeno's method.

    http://dl.dropbox.com/u/1646976/pushing2.cap

    The thing is you can't give something platform behaviour without setting it's controls. So if you give the box platform behaviour and set it to player 2 controls that aren't set in the application properties the box will go mad and fly all over the place. So give it player 1 controls and set it to always ignore input.

  • > Give the Block the "Platform" Behavior. That'll give it automatic gravity too.

    >

    > Now, for the movement, Use the "Set X Component of Movement" in the Platformer actions to make it move as your character is pushing ("Move Left/Right" Control is Down + Overlapping at Offset (0,1)) the block. Use an "Else" to set the movement back to 0 when you're not pushing it.

    >

    > Hope this helps.

    >

    Here is a example using Xeno's method.

    http://dl.dropbox.com/u/1646976/pushing2.cap

    The thing is you can't give something platform behaviour without setting it's controls. So if you give the box platform behaviour and set it to player 2 controls that aren't set in the application properties the box will go mad and fly all over the place. So give it player 1 controls and set it to always ignore input.

    Great solution! I used it in my game, thanks!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
78 10,773
Josek5494's avatar
Josek5494
Unread hot topic
51 10,466
irina's avatar
irina
Unread hot topic
46 9,319
matrixreal's avatar
matrixreal