Created
August 22, 2018 02:03
-
-
Save fabito/40a5a512b1f7b44b170dbf904068d8c9 to your computer and use it in GitHub Desktop.
neyboy_env - step method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def step(self, action): | |
self.game.resume() | |
if action == ACTION_LEFT: | |
self.game.tap_left() | |
elif action == ACTION_RIGHT: | |
self.game.tap_right() | |
self.state = self.game.get_state() | |
self.game.pause() | |
is_over = self.state.status == GAME_OVER_SCREEN | |
if is_over: | |
reward = -1 | |
else: | |
reward = self.state.score | |
return self.state.snapshot, reward, is_over, dict() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment