Commit 3683dbca authored by Taddeüs Kroes's avatar Taddeüs Kroes

Fix exa detection when exa is crushed lower

parent 087df026
...@@ -28,7 +28,7 @@ MIN_BASIC_SAT = 180 ...@@ -28,7 +28,7 @@ MIN_BASIC_SAT = 180
MIN_BOMB_SAT = 130 MIN_BOMB_SAT = 130
DETECT_EXA_X = 30 DETECT_EXA_X = 30
DETECT_EXA_Y = 547 DETECT_EXA_Y = 547, 555
EXA_HUE = 129 EXA_HUE = 129
EXA_MIN_VAL = 194 EXA_MIN_VAL = 194
DETECT_HELD_Y = 579 DETECT_HELD_Y = 579
...@@ -115,8 +115,8 @@ def detect_blocks(board): ...@@ -115,8 +115,8 @@ def detect_blocks(board):
def detect_exa(board): def detect_exa(board):
for col in range(COLUMNS): for col in range(COLUMNS):
x = col * BLOCK_SIZE + DETECT_EXA_X x = col * BLOCK_SIZE + DETECT_EXA_X
y = DETECT_EXA_Y + COLUMN_VSHIFT[col] for y in DETECT_EXA_Y:
h, s, v = board.getpixel((x, y)) h, s, v = board.getpixel((x, y + COLUMN_VSHIFT[col]))
if is_hue(h, EXA_HUE) and v >= EXA_MIN_VAL: if is_hue(h, EXA_HUE) and v >= EXA_MIN_VAL:
return col return col
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment