Beispiel #1
0
'''
    HOW TO USE THIS
Once you run makeMap.py, it will monitor and screenshot the game.
The player have to play the game in the "right" way so that
AI could learn from it.  
'''
import numpy as np
from PIL import Image
from time import sleep
from configure import Configuration as cfg
from pyautogui import click, screenshot
from directinputs import Keys
directKeys = Keys()

GameRegion = cfg.get_game_region("Getting Over It")
scrshotList = []

#countdown
for i in range(10) :
    print(10 - i)
    sleep(1.0)

saved_scrshot_count = 0
array_scrshot = np.zeros((int(GameRegion[3]), int(GameRegion[2]), 3))

while(True) :
    pre_array_scrshot = array_scrshot
    sleep(0.01)
    # get screen shot
    scrshot = (screenshot(region = GameRegion)).convert('RGB')
    array_scrshot = np.array(scrshot) / 255.5