Jump to content

Blocks collision


trandel
 Share

Recommended Posts

Hello,

I'm new here so I would like to greet everyone!

 

I have a problem that is connected to collision detection.

 

I'm trying to build my map out of squares and I have a problem with top/bottom collision.

 

When I have two boxes placed one on another and the player can only jump as high as one box, it's still possible to jump of the edge of the bottom box. You can observe this behavior on this example: http://examples.phaser.io/_site/view_full.html?d=p2%20physics&f=platformer+material.js&t=platformer%20material

 

When you move the player left and you keep holding left key you can get "stuck" between those boxes.

 

Do you have any solution for that? I know it's a collision thing, because the player is overlapping the box for a  small per cent of 1 pixel and this percentage also triggers top/bottom collision with other blocks.

 

Can you change the collision bottom and top line to be for example 99% of the width?

 

Regards

Link to comment
Share on other sites

It's a problem some1 had recently with some sonic the hedgehog pseudo clone, can't find the thread, if memory serves it hasn't been solved, it's specific to p2.

 

Do you really need p2 ?

 

I mean, if it's just for a classic platformer it's pretty much like using the space shuttle to go to the super market.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...