Skip to content

Commit

Permalink
Press a while the joypad is ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
thatguy11325 committed Jul 28, 2024
1 parent e83234b commit 72b2639
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ debug:
env:
headless: False
stream_wrapper: False
init_state: victory_road
init_state: Bulbasaur
max_steps: 16
log_frequency: 1
disable_wild_encounters: True
Expand All @@ -22,7 +22,7 @@ debug:
num_envs: 1
envs_per_worker: 1
num_workers: 1
env_batch_size: 32
env_batch_size: 128
env_pool: True
zero_copy: False
batch_size: 128
Expand Down
5 changes: 3 additions & 2 deletions pokemonred_puffer/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,9 +678,10 @@ def run_action_on_emulator(self, action):
if not self.disable_ai_actions:
self.pyboy.send_input(VALID_ACTIONS[action])
self.pyboy.send_input(VALID_RELEASE_ACTIONS[action], delay=8)
self.pyboy.tick(self.action_freq, render=True)
self.pyboy.tick(self.action_freq, render=False)
while self.read_m("wJoyIgnore"):
self.pyboy.tick(1, render=False)
self.pyboy.button("a", delay=8)
self.pyboy.tick(24, render=False)

if self.events.get_event("EVENT_GOT_HM01"):
if self.auto_teach_cut and not self.check_if_party_has_hm(0x0F):
Expand Down

0 comments on commit 72b2639

Please sign in to comment.