Myrmidon icon indicating copy to clipboard operation
Myrmidon copied to clipboard

Simplify Entity.collide_with return value

Open Frimkron opened this issue 9 years ago • 0 comments

Entity.collide_with currently returns a namedtuple containing a boolean to indicate whether a collision occured, and the entity collided with. This could be simplified to just return the entity or None, and the truthiness of the result could still be used for boolean checks, e.g:

collision = self.collide_with(entities)

or

if self.collide_with(entities):
    ...

Frimkron avatar Feb 12 '15 11:02 Frimkron