Exemple #1
0
    def check_collisions(self):
        """Check for collisions between the ship and asteroids, and the bullet and asteroids."""
        if collisions.detect_ship_asteroid_collisions(self.ship, Asteroid):
            # self.child_con.send(str( collisions.detect_ship_asteroid_collisions(self.ship, Asteroid) ))
            self.death_event()

        collisions.detect_bullet_asteroid_collisions(Bullet, Asteroid)
        r = collisions.detect_eye_asteroid_collisions(self.ship.eyes, Asteroid)
        # print(r)
        self.child_con.send(str(r))
Exemple #2
0
    def check_collisions(self):
        """Check for collisions between the ship and asteroids, and the bullet and asteroids."""

        collisions.detect_bullet_asteroid_collisions(Bullet, Asteroid)

        if collisions.detect_ship_asteroid_collisions(self.ship, Asteroid):
            if collisions.return_first_match(
                    self.ship, Asteroid.asteroids.copy(),
                    collisions.detect_collision).colour == 7:
                self.death_event()
            else:
                Asteroid.asteroids.clear()
Exemple #3
0
    def check_collisions(self):
        """Check for collisions between the ship and asteroids, and the bullet and asteroids."""
        if collisions.detect_ship_asteroid_collisions(self.ship, Asteroid):
            self.death_event()

        collisions.detect_bullet_asteroid_collisions(Bullet, Asteroid)