Relative Content

Tag Archive for pythonpygamecollision

Collision not working properly between rects in Pygame

I have a variable, colliding, that should check if two rects are colliding. The collision works fine most of the time, but when trying to check if the rects are NOT colliding, the if statement passes regardless of if they are actually colliding. After some logging, I discovered that the collision statement returns False most of the time, but returns True about 1 in 5 frames if the rects are colliding. I double checked that my rects are actually colliding, and are formatted properly.