 1, 1]
]
playerPos = [4, 4] # x,y (from top left)
playerDir = 0.4 # theta, facing right=0=2pi
playerPosZ =1
key = [0, 0, 0, 0, 0] # left, right, up, down

playerVelY = 0
face = []

def wallDistance(theta):
    global face
    data = []
    face = []
    x = playerPos[0]
    y = playerPos[1]

    atX = floor(x)
    atY = floor(y)

    thisRow = -1
    thisSide = -1

    lastHeight = 0
    dtheta = pi / (3 * samples) + 2 * pi

    for i in range(samples):
        # x = x + y is faster than x += y
        thet