Skip to content

Add collision handlers tutorial - #301

Open
viblo-majority wants to merge 1 commit into
viblo:masterfrom
viblo-majority:add-collision-handlers-tutorial
Open

Add collision handlers tutorial#301
viblo-majority wants to merge 1 commit into
viblo:masterfrom
viblo-majority:add-collision-handlers-tutorial

Conversation

@viblo-majority

Copy link
Copy Markdown

Summary

  • Add a new documentation tutorial explaining how collision handlers work in Pymunk
  • Covers all four callback phases: begin, pre_solve, post_solve, and separate
  • Includes practical examples like one-way platforms and brick-breaking mechanics

Details

The tutorial is aimed at users who have completed the basic SlideAndPinJoint tutorial and want to learn more advanced collision handling techniques. It covers:

  • Understanding the four collision callback phases
  • Setting up collision types
  • Registering collision handlers with space.on_collision()
  • Using begin callback to control collision processing (one-way platforms)
  • Passing custom data to handlers (game state, score tracking)
  • Using post_solve to read collision impulses for impact effects
  • Modifying collision properties in pre_solve
  • Wildcard collision handlers
  • A complete working example demonstrating all concepts

Add a new tutorial explaining how to use collision handlers to react
to physics events. Covers the four collision phases (begin, pre_solve,
post_solve, separate), practical examples including breakout-style
brick destruction, one-way platforms, and collision damage calculations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@viblo-majority
viblo-majority force-pushed the add-collision-handlers-tutorial branch from f8f2995 to b16f167 Compare January 19, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant