add asteroids

This project has sparked a interest in seeing what else i can creatate using coding
This commit is contained in:
tsmith37
2025-12-09 20:02:49 -05:00
parent 35ed9eb328
commit 69138c8466
5 changed files with 15 additions and 18 deletions

View File

@@ -1,14 +1,16 @@
from retro.game import Game
from spaceship import Spaceship
# from asteroid_spawner import AsteroidSpawner
from asteroid_spawner import AsteroidSpawner
from targets import Alien
from shooter import Shooter
import random
board_size = (100, 25)
width, height = board_size
ship = Spaceship(board_size)
shooter = Shooter()
spawner = Alien((random.randint(0, width-1), random.randint(0, height-1)))
game = Game([ship, spawner, shooter], {"score": 0}, board_size=board_size, color="white_on_blue")
game.play()
shooter = Shooter()
asteroid_spawner = AsteroidSpawner()
alien = Alien((random.randint(0, width - 1), random.randint(0, height - 1)))
game = Game([ship, shooter, asteroid_spawner, alien],{"score": 0},board_size=board_size,color="black_on_red")
game.play()