Skip to content

Commit

Permalink
Auto-format code 🧹🌟🤖
Browse files Browse the repository at this point in the history
  • Loading branch information
Formatter [BOT] committed Feb 28, 2024
1 parent ed08181 commit 71e983f
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions pyboy_environment/environments/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

class PyboyEnvironment:


def __init__(
self,
task: str,
Expand Down Expand Up @@ -61,9 +60,7 @@ def max_action_value(self) -> float:

@cached_property
def observation_space(self) -> int:
return len(
self._stats_to_state(self._generate_game_stats()
))
return len(self._stats_to_state(self._generate_game_stats()))

@cached_property
def action_num(self) -> int:
Expand All @@ -73,8 +70,6 @@ def set_seed(self, seed: int) -> None:
self.seed = seed
# There isn't a random element to set that I am aware of...



def reset(self) -> np.ndarray:
# restart game, skipping credits and selecting first pokemon
with open(self.init_path, "rb") as f:
Expand Down Expand Up @@ -179,18 +174,16 @@ def game_area(self) -> np.ndarray:
height = game_area_section[3]

tilemap_background = self.pyboy.botsupport_manager().tilemap_background()
game_area = np.asarray(tilemap_background[xx : xx + width, yy : yy + height], dtype=np.uint32
)
game_area = np.asarray(
tilemap_background[xx : xx + width, yy : yy + height], dtype=np.uint32
)

ss = self._get_sprites()
for s in ss:
_x = (s.x // 8) - xx

_y = (s.y // 8) - yy




if 0 <= _y < height and 0 <= _x < width:
game_area[_y][_x] = s.tile_identifier

Expand Down

0 comments on commit 71e983f

Please sign in to comment.