Platformer polygon sticking

Official forum for the Chipmunk2D Physics Library.
Post Reply
rfranknj
Posts: 1
Joined: Fri May 07, 2010 9:55 am
Contact:

Platformer polygon sticking

Post by rfranknj »

Hey, I'm working on a platformer in Python using pymunk for physics. Currently my player is represented as a square with infinite moment of inertia in the physics engine. I load tiles and use points stored in a configuration file to create polygons that correspond to the tile's shape (ie sloping up, sloping down, etc).

I currently have the ability to load a couple tiles and move my block along them by setting the surface velocity. The problem is that when I reach the corner of the next tile polygon, the player-block sticks. Here's my attempt to represent the problem in an image:

Image

The black polygons are tiles and the blue block is the player. It sticks at the red points. It actually makes some sense that it would stick right before the slope tile (triangle), but between the squares it shouldn't stick.

Some possible solutions include making the collision data completely separate from the tiles (ie using one large land-polygon), making the square a hexagon like shape, or attempting to ignore such collisions (using specialized collision handlers).

Any help is appreciated.

edit: oh wow, I just realized there's a topic literally right below this one describing the same problem, you can ignore this
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Platformer polygon sticking

Post by slembcke »

rfranknj wrote:oh wow, I just realized there's a topic literally right below this one describing the same problem, you can ignore this
Was just about to point at that one. The thread wasn't named something that was obviously the same though. ;) Cheers.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
shane
Posts: 1
Joined: Tue May 11, 2010 8:53 am
Contact:

Re: Platformer polygon sticking

Post by shane »

Any chance you could link to the other thread if you have it handy? The reply moved the threads around I suspect.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Platformer polygon sticking

Post by slembcke »

Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests