global state, timer Log.info('START', language) timer = None state = WAITING_FOR_PHOTO isGameRunning = False pygame.mixer.music.load(sounds[language][0]) pygame.mixer.music.play() isGameRunning = True clock = pygame.time.Clock() lastTime = pygame.time.get_ticks() Log.init('selfie.log', 'SELFIE') Log.info('INIT') try: while isGameRunning: ret1, currImage1 = camera1.read() ret2, currImage2 = camera2.read() screen.fill([0, 0, 0]) if imageSurface1 is not None and imageSurface2 is not None: firstSpaceX = (screen.get_width() // 2 - imageSurface1.get_width()) firstSpaceY = (screen.get_height() - imageSurface1.get_height()) // 2 screen.blit(imageSurface2, (firstSpaceX, firstSpaceY))
def __init__(self): Log.init(LOG_FILE_PATH) Log.getLogger().info('START') self.touchPos = (0, 0)