Exemplo n.º 1
0
def doMove(xPos, yPos, this_face):

    global face
    # getting the adjacent faces for the current face showing
    top, right, bot, left = Moves.adjacentFaces(this_face)

    # checking if the center of any face in the UV index is clicked and showing that face accordingly
    if 700 < xPos < 800 and 400 < yPos < 500:
        face = 0
    if 1000 < xPos < 1100 and 400 < yPos < 500:
        face = 1
    if 1300 < xPos < 1400 and 400 < yPos < 500:
        face = 2
    if 1600 < xPos < 1700 and 400 < yPos < 500:
        face = 3
    if 1000 < xPos < 1100 and 100 < yPos < 200:
        face = 4
    if 1000 < xPos < 1100 and 700 < yPos < 800:
        face = 5

    # front turn
    if 400 < xPos < 500 and 200 < yPos < 300:
        Moves.turnFront(this_face, cube)
    if 0 < xPos < 100 and 200 < yPos < 300:
        Moves.turnFront(this_face, cube, True)

    # top row
    if 100 < xPos < 200 and 200 < yPos < 300:
        Moves.turnLeft(this_face, cube)
    if 300 < xPos < 400 and 200 < yPos < 300:
        Moves.turnRight(this_face, cube)

    # bot row:
    if 100 < xPos < 200 and 600 < yPos < 700:
        Moves.turnLeft(this_face, cube, True)
    if 300 < xPos < 400 and 600 < yPos < 700:
        Moves.turnRight(this_face, cube, True)

    # right row:
    if 400 < xPos < 500 and 300 < yPos < 400:
        Moves.turnTop(this_face, cube, True)
    if 400 < xPos < 500 and 500 < yPos < 600:
        Moves.turnBot(this_face, cube)

    # left row:
    if 0 < xPos < 100 and 300 < yPos < 400:
        Moves.turnTop(this_face, cube)
    if 0 < xPos < 100 and 500 < yPos < 600:
        Moves.turnBot(this_face, cube, True)

    # turn faces:
    if 100 < xPos < 200 and 100 < yPos < 200:
        face = top
    if 300 < xPos < 400 and 100 < yPos < 200:
        face = bot
    if 100 < xPos < 200 and 700 < yPos < 800:
        face = left
    if 300 < xPos < 400 and 700 < yPos < 800:
        face = right