Skip to content

Commit

Permalink
Add parser option to record interactive game play (#214)
Browse files Browse the repository at this point in the history
* Add record option in parser

Added an option to record the interactive game play.

* Update `--record` to be set as `True`

Added suggestion for allowing to set `--record` as `True` al well as passing a directory

Co-authored-by: Vicki Pfau <[email protected]>

Co-authored-by: Vicki Pfau <[email protected]>
  • Loading branch information
parmarsuraj99 and endrift authored Nov 14, 2020
1 parent bd545a6 commit e65814f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions retro/examples/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ class RetroInteractive(Interactive):
"""
Interactive setup for retro games
"""
def __init__(self, game, state, scenario):
env = retro.make(game=game, state=state, scenario=scenario)
def __init__(self, game, state, scenario, record):
env = retro.make(game=game, state=state, scenario=scenario, record=record)
self._buttons = env.buttons
super().__init__(env=env, sync=False, tps=60, aspect_ratio=4/3)

Expand Down Expand Up @@ -245,9 +245,10 @@ def main():
parser.add_argument('--game', default='Airstriker-Genesis')
parser.add_argument('--state', default=retro.State.DEFAULT)
parser.add_argument('--scenario', default=None)
parser.add_argument('--record', default=None, nargs='?', const=True)
args = parser.parse_args()

ia = RetroInteractive(game=args.game, state=args.state, scenario=args.scenario)
ia = RetroInteractive(game=args.game, state=args.state, scenario=args.scenario, record=args.record)
ia.run()


Expand Down

0 comments on commit e65814f

Please sign in to comment.