Exemple #1
0
 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
Exemple #2
0
 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
Exemple #3
0
def test_no_collision():
    assert physics.testa_colisao(obj1, obj4) == False
Exemple #4
0
def test_collision_laser():
    assert physics.testa_colisao(obj3, obj4) == True
Exemple #5
0
def test_collision_nave():
    assert physics.testa_colisao(obj1, obj2) == True
Exemple #6
0
 def colisaoLaser(self, lasers):
     for laser in lasers:
         if self.damagetype != laser.damagetype and testa_colisao(
                 self, laser):
             self.hp -= 1