Feature Request: Collision Detection System
Would like a collision system for pyglet. Please allow it to detect collisions between sprites, other sprites, and pyglet.shape's.
Maybe:
list_of_items = [item2, item3, ...]
@window.event
def on_collide(item1, list_of_items): #if item1 collides with any item in the list
print("It has collided")
There are existing physics libraries out there such as pymunk. I think collision detection might be a bit out of scope for pyglet itself, however it is fairly simple to implement yourself. Here is a good article I would recommend using, it contains info on collision detection but you can take it further with resolution too.
I would have to agree that it's a bit out of scope. Pymunk is a good suggestion for complex simulations, and should integrate smoothly without much trouble.
For simple AABB collision detection, it would be fairly easy to roll your own.