So here's the deal.
I'm making a small platformer, using tile maps to define the levels, and creating the solid tiles as static physical objects that collide with the player, and everything is fine about that.
Usually, collision works just great. Except when the player reaches the edge between a tile and another. Sometimes he passes through them, sometimes he gets stuck on it, and I can't figure out why.
To try and ease this, I made a small algorithm to scan for adjacent tiles horizontally and create them as a single continuous object, but as far as vertical strips of tiles (Walls) go, they still have the same bug, so I'm here humbly asking for help.
The bug occurs sometimes when you try to jump while pressing onto a vertical wall, you ocasionally get stuck, as if you were touching the ground.
I dunno what is wrong or why this happens, but it's always on the edge between two tiles.
Here's the .love for the game if its any help, and thanks.
PS: Feel free to comment on any other aspect of the game if you want.
Unexpected Box Edge Collision
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- dreadkillz
- Party member
- Posts: 223
- Joined: Sun Mar 04, 2012 2:04 pm
- Location: USA
Re: Unexpected Box Edge Collision
Didn't check the code, but it may be related to 4.5 EDGE SHAPES: http://www.box2d.org/manual.html#_Toc258082970
Re: Unexpected Box Edge Collision
And it is!dreadkillz wrote:Didn't check the code, but it may be related to 4.5 EDGE SHAPES: http://www.box2d.org/manual.html#_Toc258082970
That's exactly the problem I'm having. And apparently the only way to solve it is by using Chain Shapes to generate the landscape from the tilemaps, it seems.
And that is going to take a much more complicated algorithm than I thought. Anyway, that was exactly what I was looking for, thanks a lot!
Now to figure out a practical way to create the whole landscape in continuous ChainShapes.
Who is online
Users browsing this forum: Google [Bot], pgimeno and 12 guests