Skip to content

Commit

Permalink
Merge pull request #62 from timotheeg/simpler_state_transition
Browse files Browse the repository at this point in the history
Update state without checking values
  • Loading branch information
alex-ong authored Jul 7, 2021
2 parents efeeb68 + 6a755a3 commit 488beeb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nestris_ocr/scan_strat/base_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self):
self.start_level = None
self.field = None
self.preview = None
self.gameid = 0
self.gameid = 1
self.piece_stats = PieceStatAccumulator()
self.gamestate = GameState.MENU
self.cur_piece = None
Expand Down
3 changes: 2 additions & 1 deletion nestris_ocr/scan_strat/naive_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
class NaiveStrategy(BaseStrategy):
def __init__(self, *args):
super(NaiveStrategy, self).__init__(*args)
self.gamestate = GameState.IN_GAME # allows starting OCR mid-game
self.tasks = self.setup_tasks()
self.interpolate = config["calibration.color_interpolation"]

Expand Down Expand Up @@ -83,7 +84,7 @@ def update_menu(self):

if self.lines and self.score and self.level:
self.gamestate = GameState.IN_GAME
if self.lines == "000" and self.score == "000000":
if (self.lines == "000" or self.lines == "025") and self.score == "000000":
return True

return False
Expand Down

0 comments on commit 488beeb

Please sign in to comment.