@chris My fruit offset does not work

This commit is contained in:
kdang
2026-01-09 09:49:15 -05:00
parent d6adfef5a1
commit 267fffa9b0
9 changed files with 69 additions and 54 deletions

17
manager.py Normal file
View File

@@ -0,0 +1,17 @@
from fruit import Fruit, SHAPE_DEFINITIONS
from random import choice
from retro.errors import AgentNotFoundByName
class FruitManager:
display = False
def play_turn(self, game):
try:
game.get_agent_by_name("fruit")
except AgentNotFoundByName:
self.create_piece(game)
def create_piece(self, game):
fruit = Fruit((14, 1), game, choice(SHAPE_DEFINITIONS))
game.add_agent(fruit)