Checkpoint 2: Attaching the "asteroid" to the player if the player touches the "asteroid" This part was challenging as there were new commands I learned while trying to incorporate the retro lab componemets. I included the "asteroid sprawner" to get more than on "asteroid" on the screen. The next part is to end the game.

This commit is contained in:
erbrown
2025-12-14 22:07:22 -05:00
parent 0141fafc98
commit 1a02f78bb1
7 changed files with 73 additions and 5 deletions

View File

@@ -1,7 +1,11 @@
from retro.game import Game
from player import Player
from apple import Apple
from apple_sprawner import AppleSpawner
board_size = (100, 25)
player = Player(board_size)
game = Game([player], {"score": 0}, board_size=board_size, color = "white")
apple = Apple((board_size[0] // 2, 0))
spawner = AppleSpawner()
game = Game([player,spawner], {"score": 0}, board_size=board_size, color = "white")
game.play()