Myrmidon
Myrmidon copied to clipboard
Simplify Entity.collide_with return value
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):
...