Exemplo n.º 1
0
 def __init__(self):
     self.pygameWindow = PYGAME_WINDOW()
     self.Get_Number_Of_Gestures()
     self.xMin = -200.0
     self.xMax = 200.0
     self.yMin = -200.0
     self.yMax = 200.0
Exemplo n.º 2
0
 def __init__(self):
     self.controller = Leap.Controller()
     self.pygameWindow = PYGAME_WINDOW()
     self.frameHandler = FRAME_HANDLER()
     # self.testData = self.frameHandler.testData
     self.frame = self.controller.frame()
     self.programState = 0
     self.wrongPosition = True
Exemplo n.º 3
0
    def __init__(self):

        self.controller = Leap.Controller()
        self.pyWindow = PYGAME_WINDOW()

        self.xMin = 10000.0
        self.xMax = -10000.0
        self.yMin = 10000.0
        self.yMax = -10000.0
Exemplo n.º 4
0
    def __init__(self):
        # self.controller = Leap.Controller()
        self.pygameWindow = PYGAME_WINDOW()
        # self.frame = self.controller.frame()

        self.clf = pickle.load(
            open(
                'C:\Users\Haley\Desktop\School Papers\HCI CS228 Jr\LeapDeveloperKit_3.2.1_win\LeapDeveloperKit_3.2.1+45911_win\LeapSDK\lib\CS228\Del6\userData\classifier_0135679_gettingthere.p'
            ))
        self.testData = np.zeros((1, 30), dtype='f')
        self.k = 0
Exemplo n.º 5
0
def Handle_Bone(bone, boneWidth):
    global xTip, yTip, zTip
    global currentlySigningCurrectly

    base = bone.prev_joint
    tip = bone.next_joint

    (xBase, yBase) = Handle_Vector_From_Leap(base)
    (xTip, yTip) = Handle_Vector_From_Leap(tip)

    if (currentlySigningCurrectly == True):
        PYGAME_WINDOW.Draw_Green_Line(pygameWindow, xBase, yBase, xTip, yTip,
                                      boneWidth)
    else:
        PYGAME_WINDOW.Draw_Black_Line(pygameWindow, xBase, yBase, xTip, yTip,
                                      boneWidth)
Exemplo n.º 6
0
def Handle_Bone(bone, drawingWidth):
    base = bone.prev_joint
    tip = bone.next_joint

    (baseX, baseY) = Handle_Vector_From_Leap(base)
    (tipX, tipY) = Handle_Vector_From_Leap(tip)

    PYGAME_WINDOW.Draw_Black_Line(pygWindow, baseX, baseY, tipX, tipY,
                                  drawingWidth)
Exemplo n.º 7
0
sys.path.insert(0, '../..')
import Leap
from pygameWindow import PYGAME_WINDOW
import pygame.image
import random
import constants
import pickle
import numpy as np
from random import seed
from random import randint
import time

clf = pickle.load(open('userData/classifier.p', 'rb'))
testData = np.zeros((1, 30), dtype='f')

pygameWindow = PYGAME_WINDOW()

x = 250
y = 250
xMin = -100.0
xMax = 100.0
yMin = -100.0
yMax = 100.0
programState = 0
handPos = 0
countForHandPos = 0
countForNumCorrect = 0
currentNumCorrect = 1
numToSign = 0
k = 0
numCounter = 0
Exemplo n.º 8
0
from __future__ import division
import sys
sys.path.insert(0, '..')
import Leap
from pygameWindow import PYGAME_WINDOW
import random
import constants

pygameWindow = PYGAME_WINDOW()

x = 250
y = 250
xMin = 1000.0
xMax = -1000.0
yMin = 1000.0
yMax = -1000.0


def Handle_Frame(frame):
    global x, y, xMin, xMax, yMin, yMax
    hand = frame.hands[0]
    fingers = hand.fingers
    indexFingerList = fingers.finger_type(Leap.Finger.TYPE_INDEX)
    indexFinger = indexFingerList[0]
    distalPhalanx = indexFinger.bone(Leap.Bone.TYPE_DISTAL)
    tip = distalPhalanx.next_joint
    x = int(tip[0])
    y = int(tip[1])
    if (x < xMin):
        xMin = x
    if (x > xMax):
Exemplo n.º 9
0
import pygame
import constants as constants
from pygameWindow import PYGAME_WINDOW
pygameWindow = PYGAME_WINDOW()


##########################################
def draw_startUpImage():
    global startImage
    startImage = pygame.image.load(
        "/Users/chief/Desktop/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/lib/CS228/Del7/gestureDirections/HoverHandOverLEap.png"
    )
    pygameWindow.screen.blit(startImage,
                             (constants.pygameWindowWidth / 2 +
                              constants.pygameWindowWidth / 8, 150))


##########################################
def draw_leftImage():
    startImage = pygame.image.load(
        "/Users/chief/Desktop/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/lib/CS228/Del7/gestureDirections/arrow pointing left.png"
    )
    pygameWindow.screen.blit(startImage,
                             (constants.pygameWindowWidth / 2 +
                              constants.pygameWindowWidth / 4, 150))


##########################################
def draw_rightImage():
    startImage = pygame.image.load(
        "/Users/chief/Desktop/LeapDeveloperKit_2.3.1+31549_mac/LeapSDK/lib/CS228/Del7/gestureDirections/arrow right.png"
Exemplo n.º 10
0
    userEntry['totalPercentage'] = totalPercentage
    userEntry['arithmaticStage'] = arithmaticStage
    userEntry['digitsToDisplay'] = digitsToDisplay
    userEntry['digitsThatHaveBeenDisplayed'] = digitsThatHaveBeenDisplayed
    userEntry['allDigitsDisplayedAndSucceeded'] = allDigitsDisplayedAndSucceeded
    userEntry['reducedTimeStage'] = reducedTimeStage

    pickle.dump(database, open('userData/database.p','wb'))

atexit.register(exit_handler)

############### LOCAL CODE (basically main) ###############

HandleDatabase()

pygameWindow = PYGAME_WINDOW()

while True:

    pygameWindow.Prepare()
    frame = controller.frame()
    k = 0

    if(len(frame.hands) < 1):
        programState = 0

    if programState == 0:
        HandleState0(frame)
    elif programState == 1:
        HandleState1(frame)
    elif programState == 2:
Exemplo n.º 11
0
import time
import Dict

import pygame
import pickle
import numpy as np
from pygameWindow import PYGAME_WINDOW
from constants import pygameWindowDepth, pygameWindowWidth
from random import randint
from timeit import default_timer as timer
from random import randrange

# import CenterData
clf = pickle.load(open('userData/classifier.p', 'rb'))
testData = np.zeros((1, 30), dtype='f')
pw = PYGAME_WINDOW()
x = pygameWindowWidth - pw.screen.get_width() // 2
y = pygameWindowDepth - pw.screen.get_height() // 2
number = 0  #run once
lastNumber = number
predictedArray = []
checkN = []
pauseCheckStart = 0
pauseCheckEnd = 0
correct = False
lastCorrect = False
start = True
userName = ''
database = {}
topTimeSigned = pickle.load(open('userData/topTime.p', 'rb'))
startTime = timer()
Exemplo n.º 12
0
import sys
#Add path to PATH
sys.path.insert(0, '../x86')

import Leap
import random

#Add classes and variables from other python files
from pygameWindow import PYGAME_WINDOW

#Variable Init
pygameWindow = PYGAME_WINDOW()
x = 300
y = 300
pygameX = 300
pygameY = 300
xMin = 1000.0
xMax = -1000.0
yMin = 1000.0
yMax = -1000.0

#Initialize controller
controller = Leap.Controller()


#Function List
def Perturb_Circle_Position():
    global x, y
    fourSidedDieRoll = random.randint(1, 4)
    if (fourSidedDieRoll == 1):
        x -= 2
Exemplo n.º 13
0
import numpy as np
from pygameWindow import PYGAME_WINDOW
import constants


def Perturb_Circle_Position():
    global x, y
    fourSidedDieRoll = np.random.randint(4) + 1
    if fourSidedDieRoll == 1:
        x -= constants.circleVelocity
    elif fourSidedDieRoll == 2:
        x += constants.circleVelocity
    elif fourSidedDieRoll == 3:
        y -= constants.circleVelocity
    elif fourSidedDieRoll == 4:
        y += constants.circleVelocity
    else:
        print("Warning. fourSidedDieRoll is not in [1,4].")


pygameWindow = PYGAME_WINDOW()
x = constants.pygameWindowWidth / 2
y = constants.pygameWindowDepth / 2

while (True):
    pygameWindow.Prepare()
    pygameWindow.DrawBlackCircles(x, y)
    Perturb_Circle_Position()
    pygameWindow.Reveal()
#    print('Draw something.')
Exemplo n.º 14
0
class FRAME_HANDLER:
    def __init__(self):
        # self.controller = Leap.Controller()
        self.pygameWindow = PYGAME_WINDOW()
        # self.frame = self.controller.frame()

        self.clf = pickle.load(
            open(
                'C:\Users\Haley\Desktop\School Papers\HCI CS228 Jr\LeapDeveloperKit_3.2.1_win\LeapDeveloperKit_3.2.1+45911_win\LeapSDK\lib\CS228\Del6\userData\classifier_0135679_gettingthere.p'
            ))
        self.testData = np.zeros((1, 30), dtype='f')
        self.k = 0

    def CenterData(self, data):
        for s in range(0, 2):
            allCoords = data[0, s::3]
            meanVal = allCoords.mean()
            data[0, s::3] = allCoords - meanVal
        return data

    def Scale(self, coord, leapMin, leapMax, winMin,
              winMax):  # Tested in Del6/Del02 - successful
        screenWidth = winMax - winMin
        drawWidth = leapMax - leapMin
        scalar = 1
        ratio = ((coord - leapMin) / drawWidth) * screenWidth * scalar
        return int(ratio)

    def Handle_Vector_From_Leap(self, v):  # Tested in Del07 - successful
        xPre = int(v[0])
        yPre = int(v[2])
        zPre = int(v[1])

        xv = self.Scale(xPre, constants.xMin, constants.xMax, 0,
                        (constants.pygameWindowWidth) / 2)
        yv = self.Scale(yPre, constants.yMin, constants.yMax, 0,
                        (constants.pygameWindowDepth) / 2)
        zv = zPre

        return xv, yv, zv

    def Handle_Finger(self, finger):
        global b
        for b in range(0, 4):
            bone = finger.bone(b)
            self.Handle_Bone(bone)

    def Handle_Bone(self, bone):
        #global k
        base = bone.prev_joint
        tip = bone.next_joint
        xBase, yBase, zBase = self.Handle_Vector_From_Leap(base)
        xTip, yTip, zTip = self.Handle_Vector_From_Leap(tip)
        if ((b == 0) or (b == 3)):
            self.testData[0, self.k] = tip[0]
            self.testData[0, self.k + 1] = tip[1]
            self.testData[0, self.k + 2] = tip[2]
            self.k = self.k + 3

        self.pygameWindow.Draw_Black_Line(xBase, yBase, xTip, yTip, (3 - b))
        print self.testData
        return self.testData

    def Handle_Frame_Init(self, frame):
        global x
        global y
        #global k

        handList = frame.hands
        if len(handList) > 0:
            handList = frame.hands
            self.k = 0
            #        for hand in handList:
            fingers = handList[0].fingers
            for finger in fingers:
                self.Handle_Finger(finger)
            # print(testData)
            self.testData = self.CenterData(self.testData)
            time.sleep(0.02)
            self.predictedClass = int(self.clf.Predict(self.testData))
            time.sleep(0.05)
Exemplo n.º 15
0
    database[userName]['0attempted'] = 0
    database[userName]['1attempted'] = 0
    database[userName]['2attempted'] = 0
    database[userName]['3attempted'] = 0
    database[userName]['4attempted'] = 0
    database[userName]['5attempted'] = 0
    database[userName]['6attempted'] = 0
    database[userName]['7attempted'] = 0
    database[userName]['8attempted'] = 0
    database[userName]['9attempted'] = 0
    print('welcome ' + userName + '.')
userRecord = database[userName]

controller = Leap.Controller()

pygameWindow = PYGAME_WINDOW()

clf = pickle.load(open('../Del6/userData/classifier.p', 'rb'))
testData = np.zeros((1, 30), dtype='f')
k = 0
x = 350
y = 350

xMin = 1000.0
xMax = -1000.0
yMin = 1000.0
yMax = -1000.0

programState = 0
userHandCentered = False
centeredTimes = 0
Exemplo n.º 16
0
import sys
sys.path.insert(0, '..')
import Leap

import pygame
from pygameWindow import PYGAME_WINDOW
from constants import pygameWindowDepth, pygameWindowWidth
from random import randint

pw = PYGAME_WINDOW()
x = pygameWindowWidth - pw.screen.get_width() // 2
y = pygameWindowDepth - pw.screen.get_height() // 2
xMin = 1000.0
xMax = -1000.0
yMin = 1000.0
yMax = -1000.0


def Perturb_Circle_Position():
    fourSidedDieRoll = randint(1, 4)
    global x, y
    if fourSidedDieRoll == 1:
        x = x - 1
    elif fourSidedDieRoll == 2:
        x = x + 1
    elif fourSidedDieRoll == 3:
        y = y - 1
    else:
        y = y + 1

Exemplo n.º 17
0
constants_instance2 = CONSTANTS()

from pygameWindow import PYGAME_WINDOW
import random

x = 250  #where the black circle is located
y = 250  #where the black circle is located

#
xMin = 100.0
xMax = 0.0
yMin = 100.0
yMax = 0.0

#create an instance of the class called PYGAME_WINDOW
instance = PYGAME_WINDOW()


#this method will alter the position on the circle as if it were on a graph
def Perturb_Circle_Position():
    global x
    global y
    fourSidedDieRoll = random.randint(1, 5)
    if fourSidedDieRoll == 1:
        x -= 1
    elif fourSidedDieRoll == 2:
        x += 1
    elif fourSidedDieRoll == 3:
        y -= 1
    else:
        y += 1
Exemplo n.º 18
0
from pygameWindow import PYGAME_WINDOW
import constants as c
import random
pygameWindow = PYGAME_WINDOW()

x = c.pygameWindowWidth / 2
y = c.pygameWindowDepth / 2


def Perturb_Circle_Position():
    global x, y
    fourSidedDieRoll = random.randint(1, 5)
    if fourSidedDieRoll == 1:
        x -= 1
    elif fourSidedDieRoll == 2:
        x += 1
    elif fourSidedDieRoll == 3:
        y -= 1
    else:
        y += 1


print(PYGAME_WINDOW)
while True:
    pygameWindow.prepare()
    pygameWindow.Draw_Black_Circle(x, y)
    Perturb_Circle_Position()
    pygameWindow.reveal()
Exemplo n.º 19
0
import pygame
from pygameWindow import PYGAME_WINDOW
from constants import pygameWindowDepth, pygameWindowWidth
from random import randint

pw = PYGAME_WINDOW()
x = pygameWindowWidth - pw.screen.get_width() // 2
y = pygameWindowDepth - pw.screen.get_height() // 2


def Perturb_Circle_Position():
    fourSidedDieRoll = randint(1, 4)
    global x, y
    if fourSidedDieRoll == 1:
        x = x - 1
    elif fourSidedDieRoll == 2:
        x = x + 1
    elif fourSidedDieRoll == 3:
        y = y - 1
    else:
        y = y + 1


while True:
    pw.Prepare()
    pw.Draw_Black_Circle(x, y)
    pw.Reveal()
    Perturb_Circle_Position()
Exemplo n.º 20
0
def Scale(value, minValue, maxValue, newMinValue, newMaxValue):

	global befValue

	if maxValue == minValue:
		return befValue

	percentage_scaling = (value - minValue) / (maxValue - minValue)
	befValue = ((newMaxValue - newMinValue) * percentage_scaling) + newMinValue
	return befValue



		

pygameWindow = PYGAME_WINDOW()

print(pygameWindow)

controller = Leap.Controller()

while True:

	pygameWindow.Prepare(pygameWindow)
	frame = controller.frame()
	for event in pygame.event.get(): #With this for loop pygame window do not crash
		if event.type == pygame.QUIT:
			sys.exit(0)
	if not (frame.hands.is_empty > 0):
		 Handle_Frame(frame)
		 
Exemplo n.º 21
0
constants_instance2 = CONSTANTS()

from pygameWindow import PYGAME_WINDOW
import random

x = 250 #where the black circle is located
y = 250 #where the black circle is located

#
xMin = 100.0
xMax = 0.0
yMin = 100.0
yMax = 0.0

#create an instance of the class called PYGAME_WINDOW
instance = PYGAME_WINDOW()

#this method will alter the position on the circle as if it were on a graph
def Perturb_Circle_Position():
    global x
    global y
    fourSidedDieRoll = random.randint(1,5)
    if fourSidedDieRoll == 1:
        x -= 1
    elif fourSidedDieRoll == 2:
                x += 1
    elif fourSidedDieRoll == 3:
        y -= 1
    else:
        y += 1
Exemplo n.º 22
0
## Imports of everything needed
import sys
sys.path.insert(0, '../..')
import Leap
import random
import pickle
import time
import numpy as np
from constants import *
from collections import Counter
from pygameWindow import PYGAME_WINDOW

## setting constants that are needed in the program
pygameWindow = PYGAME_WINDOW()
global x, y, xMin, xMax, yMin, yMax, programState, position
xMin = -300.0
xMax = 300.0
yMin = -300.0
yMax = 300.0
programState = 0
Xposition = []
Yposition = []
center = False
numCenterFrames = 0
countedFrame = 0
number = -1
correctNum = 0

## load the data
clf = pickle.load(open('userData/classifier.p', 'rb'))
testData = np.zeros((1, 30), dtype='f')
Exemplo n.º 23
0
    database[userName]['1attempted'] = 0
    database[userName]['2attempted'] = 0
    database[userName]['3attempted'] = 0
    database[userName]['4attempted'] = 0
    database[userName]['5attempted'] = 0
    database[userName]['6attempted'] = 0
    database[userName]['7attempted'] = 0
    database[userName]['8attempted'] = 0
    database[userName]['9attempted'] = 0
    database[userName]['numTries'] = 0
    print('welcome ' + userName + '.')
userRecord = database[userName]

controller = Leap.Controller()

pygameWindow = PYGAME_WINDOW()

clf = pickle.load(open('../Del6/userData/classifier.p', 'rb'))
testData = np.zeros((1, 30), dtype='f')
k = 0
x = 350
y = 350
game = RocketGame(x, y, pygameWindow)

xMin = 1000.0
xMax = -1000.0
yMin = 1000.0
yMax = -1000.0

programState = 0
programMode = 0
Exemplo n.º 24
0
import constants

#Do the code in Del01, then move the objects/methods/functions into pygame
#Then make everything self-referencing

from pygameWindow import PYGAME_WINDOW

#import constants
#import random

#circle position and axes
x = 0
y = 0

#Creating an instance of the PYGAME_WINDOW class
pygameWindow = PYGAME_WINDOW()

controller = Leap.Controller()

runStatus = True  #this is now a switch


def Handle_Frame_Init(
):  #This function works in Del01, but fails if I move it to pygameWindow
    global x
    global y

    handList = frame.hands
    if len(handList) > 0:  #use isempty to track values of objects in the list
        handList = frame.hands
        for hand in handList:
Exemplo n.º 25
0
    if x < xMin:
        xMin = x
    if x > xMax:
        xMax = x
    if y < yMin:
        yMin = y
    if y > yMax:
        yMax = y

    x = Scale(x, xMax, xMin, 0, constants.windowWidth)
    y = Scale(y, yMax, yMin, constants.windowWidth, 0)

    return (x, y)


pyWindow = PYGAME_WINDOW()

running = True
while running:

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
    pygame.event.get()
    pyWindow.Prepare()
    frame = controller.frame()
    handlist = frame.hands
    if (len(handlist) > 0):
        Handle_Frame(frame)

    pyWindow.Reveal()
Exemplo n.º 26
0
# load user DataBase
db = DataBase()
db.login()

#program globals
programState = 0
timeCentered = 0
items = [1, 7]
numberGoal = random.sample(items, 1)[0]
signDisplayTime = 0
maxSignDisplayTime = 30
correctSignCount = 0
successDisplayTime = 0

#drawing globals
pygameWindow = PYGAME_WINDOW()
controller = Leap.Controller()
xMin = 800
xMax = -800
yMin = 800
yMax = -800

# classifier globals
# sys.path.insert(0, "")
clf = pickle.load(open('userData/classifier.p', 'rb'))
testData = np.zeros((1, 30), dtype='f')
k = 0


def CenterData(set):
    for i in range(3):
Exemplo n.º 27
0
    database[userName]['1attempted'] = 0
    database[userName]['2attempted'] = 0
    database[userName]['3attempted'] = 0
    database[userName]['4attempted'] = 0
    database[userName]['5attempted'] = 0
    database[userName]['6attempted'] = 0
    database[userName]['7attempted'] = 0
    database[userName]['8attempted'] = 0
    database[userName]['9attempted'] = 0
    database[userName]['numTries'] = 0
    print('welcome ' + userName + '.')
userRecord = database[userName]

controller = Leap.Controller()

pygameWindow = PYGAME_WINDOW()

clf = pickle.load(open('../Del6/userData/classifier.p', 'rb'))
testData = np.zeros((1, 30), dtype='f')
k = 0
x = 350
y = 350

xMin = 1000.0
xMax = -1000.0
yMin = 1000.0
yMax = -1000.0

programState = 0
programMode = 0
userHandCentered = False
Exemplo n.º 28
0
class DELIVERABLE:
    def __init__(self):

        self.controller = Leap.Controller()
        self.pyWindow = PYGAME_WINDOW()

        self.xMin = 10000.0
        self.xMax = -10000.0
        self.yMin = 10000.0
        self.yMax = -10000.0

        print("hi")

    def Scale(self, var_to_scale, r1, r2, r3, r4):

        print(r1, r2)
        if r1 == r2:
            scaled_value = int((r1 + r2) / 2)
        else:
            old_range = r2 - r1
            new_range = r4 - r3

            scaled_value = (((var_to_scale - r1) * new_range) / old_range) + r3

        return (int(scaled_value))

    def Handle_Frame(self, frame):

        hand = frame.hands[0]
        fingers = hand.fingers
        for finger in fingers:
            self.Handle_Finger(finger)

    def Handle_Finger(self, finger):

        for bone_type in range(4):
            bone = self.Handle_Bone(finger, bone_type)

    def Handle_Bone(self, finger, bone_type):

        bone = finger.bone(bone_type)

        base = bone.prev_joint
        base_x, base_y = self.Handle_Vector_From_Leap(base)
        print(base_x)

        tip = bone.next_joint
        tip_x, tip_y = self.Handle_Vector_From_Leap(tip)

        self.pyWindow.Draw_Black_Line(base_x, base_y, tip_x, tip_y, bone_type)

        return (bone)

    def Handle_Vector_From_Leap(self, vector):

        self.x = int(vector[0] * -1.0)
        self.y = int(vector[2])

        if self.x < self.xMin:
            self.xMin = self.x
        if self.x > self.xMax:
            self.xMax = self.x
        if self.y < self.yMin:
            self.yMin = self.y
        if self.y > self.yMax:
            self.yMax = self.y

        self.x = self.Scale(self.x, self.xMax, self.xMin, 0,
                            constants.windowWidth)
        self.y = self.Scale(self.y, self.yMax, self.yMin,
                            constants.windowWidth, 0)

        return (self.x, self.y)

    def Run_Forever(self):

        running = True
        while running:

            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    running = False
            pygame.event.get()
            self.pyWindow.Prepare()
            frame = self.controller.frame()
            handlist = frame.hands
            if (len(handlist) > 0):
                self.Handle_Frame(frame)

            self.pyWindow.Reveal()

        pygame.quit()
Exemplo n.º 29
0
import sys

sys.path.insert(0, '..')

import Leap

controller = Leap.Controller()

from pygameWindow import PYGAME_WINDOW
import random

pygWindow = PYGAME_WINDOW()

x = 500
y = 500

xMin = 1000.0
xMax = -1000.0
yMin = 1000.0
yMax = -1000.0

# def Perturb_Circle_Position():
#     global x, y

#     fourSidedDieRoll = random.randint(1,4)

#     if fourSidedDieRoll == 1:
#         x += -1
#     elif(fourSidedDieRoll == 2):
#         x += 1
#     elif(fourSidedDieRoll == 3):
Exemplo n.º 30
0
        Handle_Frame(frame)

    else:
        programState = 0


def HandleState2():
    global programState, frame

    if not (frame.hands.is_empty > 0):
        Handle_Frame(frame)
    else:
        programState = 0


pygameWindow = PYGAME_WINDOW()

print(pygameWindow)

controller = Leap.Controller()

#DATABASE DICT

database = pickle.load(open('userData/database.p', 'rb'))

pickle.dump(database, open('userData/database.p', 'wb'))  #First time

userName = raw_input('Please enter your name: ')
if userName in database:
    print('Welcome back ' + userName + '.')
    database[userName]['login'] += 1