Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
markub3327 committed Mar 11, 2023
1 parent 59a4ea4 commit 701fa18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions flappy_bird_gymnasium/envs/flappy_bird_env_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,15 @@ def _get_observation(self):
player_y = self._game.player_y
v_dist = ((upper_pipe_y + lower_pipe_y) / 2) - player_y
pipes.append((h_dist, v_dist))

pipes = sorted(pipes, key=lambda x: x[0])
vel_y = self._game.player_vel_y
rot = self._game.player_rot

if self._normalize_obs:
pipes = [(h / self._screen_size[0], v / self._screen_size[1]) for h, v in pipes]
pipes = [
(h / self._screen_size[0], v / self._screen_size[1]) for h, v in pipes
]
vel_y /= PLAYER_MAX_VEL_Y
rot /= 90

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import setuptools

_VERSION = "0.1.0"
_VERSION = "0.1.1"

# Short description.
short_description = "A Gymnasium environment for the Flappy Bird game."
Expand Down

0 comments on commit 701fa18

Please sign in to comment.