def makeBoom(self): print('boom') selfEnt = coreInstance.entities[self.ownerId] toErase = [] [toErase.append(other.id) for other in coreInstance.entities.values() if distanceBetweenPoints(other.pos, selfEnt.pos) < 0.3] [coreInstance.deleteEntity(idToErase) for idToErase in toErase]
def onCollisionBrick(entA, entB, vector): if hasattr(entA, "name") and entA.name == "Brick": coreInstance.deleteEntity(entA.id)
def changeHealthBy(self, amount): self.health += amount if self.health <= 0: coreInstance.deleteEntity(self.ownerId)