Sign in to follow this  
trandel

Blocks collision

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.