pygame is
pygame.org is
|
Rect Collision Response
Rect Collision Responsepymike (pymike)Tags:DescriptionThis is a simple demo on how to do side-based rectangle collision response. It's extremely simple, and not very hard to understand.
ConceptI'm putting this here since it's not in the download. Basically how it works is when you move a rect, you first move along the X axis, test for a collision, move out, then move along the Y axis, test for a collision, and move out. This prevents the infamous "corner-catching" bug, and lets you move smoothly along walls.![]() Links
ScreenshotPygame.org account CommentsIf you wish to leave a comment with your pygame.org account, please sign in first.
|
|