p.fillStyle = "#3366CC"
    map.arc(playerPos[0] * 8, playerPos[1] * 8, 3, 0, 2 * pi, True)
    map.fill()
    map.beginPath()
    map.moveTo(8 * playerPos[0], 8 * playerPos[1])

    for i in range(0, len(wall), 4):

        theta1=playerDir - pi / 6 + pi * wall[i] / (3 * samples)
        theta2=playerDir - pi / 6 + pi * wall[i + 2] / (3 * samples)

        fix1 = cos(theta1 - playerDir)
        fix2 = cos(theta2 - playerDir)

        h = 2 - playerPosZ

        wallH1 = 100 / (wall[i + 1] * fix1)
        w