Files
Litcraft_Python_B/farm/main_farm.py
Thaloria 9a2c40c5c4 added 3s with gap support
added explosive detonation on stuck
2022-10-07 16:19:35 +02:00

39 lines
858 B
Python

from Field_Representation import Field
from time import time
import cv2 as cv
import keyboard
def run():
field = Field()
loop_time_p = time()
pause = True
while True:
if keyboard.is_pressed('p') == True:
pause = True
print('q pressed')
elif keyboard.is_pressed('o') == True:
pause = False
print('o pressed')
if pause:
# cv.waitKey(500)
if (time() - loop_time_p) >= 5:
loop_time_p = time()
print("pausing")
continue
#cords, screenshot = field.get_current_board_state()
cords = field.assess_playfield_and_make_move()
print(cords)
cv.waitKey(1000)
#cv.imshow("screenshot", screenshot)
#cv.waitKey(150)
#print(cords)
if __name__ == "__main__":
run()