Skip to main content
2 of 2
Clarified. Retitled to match better.
Anko
  • 13.5k
  • 10
  • 56
  • 82

Collision detection without classes, in Pygame

I am writing a game in Pygame and want to get collision detection working. The aim is that when an object hits another, the target object disappears. I want to avoid having classes for now, to keep things simple. This makes it difficult to get collision detection working, because the Rect method in Pygame assumes classes.

The logic I want to achieve is:

if object hits a target object
    target object disappears

What's the minimal code I'd need to achieve this?