(self)
| 24 | |
| 25 | class Env: |
| 26 | def __init__(self): |
| 27 | self.game = FlappyBird(pipe_gap=125) |
| 28 | self.env = PLE(self.game, fps=30, display_screen=False) |
| 29 | self.env.init() |
| 30 | self.env.getGameState = self.game.getGameState # maybe not necessary |
| 31 | |
| 32 | # by convention we want to use (0,1) |
| 33 | # but the game uses (None, 119) |
| 34 | self.action_map = self.env.getActionSet() #[None, 119] |
| 35 | |
| 36 | def step(self, action): |
| 37 | action = self.action_map[action] |