we didnt even write it a good 99% of it was copy and paste.

This commit is contained in:
cdonahue
2025-11-17 09:47:12 -05:00
parent ab49fda2bf
commit ac50df18d5
7 changed files with 65 additions and 16 deletions

View File

@@ -1,4 +1,18 @@
# asteroid_spawner.py
# -------------------
# By MWC Contributors
# This module defines an AsteroidSpawner agent class.
from random import randint
from asteroid import Asteroid
class AsteroidSpawner:
display = False
def __init__(self, board_size):
width, height = board_size
self.board_width = width
def play_turn(self, game):
game.state['score'] += 1
if self.should_spawn_asteroid(game.turn_number):
asteroid = Asteroid((randint(0, self.board_width - 1), 0))
game.add_agent(asteroid)
def should_spawn_asteroid(self, turn_number):
return randint(0, 1000) < turn_number