generated from mwc/lab_retro
Completed the retro lab, making changes so it'd work.
In asteroid.py line 14, I changed HEIGHT to game.board_size[1] In asteroid.py line 15 I changed game.remove_agent_by_name(self.name) to game.remove_agent(self) Was the code given on the page supposed to work as is? It read like it should have just been a copy+ paste+run, but I had to make the above changes to do so. For example, I don't think asteroid objects have names, so you can't remove them by name? And nowhere was HEIGHT defined.
This commit is contained in:
10
try.py
Normal file
10
try.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# Was supposed to try this per the introduction to retro, but this doesn't
|
||||
# actually seem to work? I keep getting an error...
|
||||
|
||||
from retro.game import Game
|
||||
from retro.agent import ArrowKeyAgent
|
||||
|
||||
agent = ArrowKeyAgent()
|
||||
state = {}
|
||||
game = Game([agent], state)
|
||||
game.play()
|
||||
Reference in New Issue
Block a user