def colisaointerno(self, naves, lasers): for nave in naves: if nave.layer != self.damagetype and testa_colisao(self, nave): self.hp -= 1 if nave.imunity_timer == 0: nave.hp -= 1 nave.imunity_timer = 5
def colisao(self, naves): for nave in naves: if self.layer != nave.layer and testa_colisao(self, nave): nave.hp -= 1 if self.imunity_timer == 0: self.hp -= 1 self.imunity_timer = 5
def test_no_collision(): assert physics.testa_colisao(obj1, obj4) == False
def test_collision_laser(): assert physics.testa_colisao(obj3, obj4) == True
def test_collision_nave(): assert physics.testa_colisao(obj1, obj2) == True
def colisaoLaser(self, lasers): for laser in lasers: if self.damagetype != laser.damagetype and testa_colisao( self, laser): self.hp -= 1