Beispiel #1
0
    def main(self, planets_amt: int) -> None:
        # Planet creation
        self.planets = []
        center = (self.width / 2, self.height / 2)
        max_orbit_radius = min(self.width / 2, self.height / 2) - 15

        self.planets = Planet.generate_random_planets(
            planets_amt, center, max_orbit_radius,
        )

        # Main game loop
        while self.running:
            for planet in self.planets:
                planet.rotate()

            self.update_screen()