rVelY = playerVelY + 0.02
    elif key[3] and not key[2]:
        if playerVelY > -0.1:
            playerVelY = playerVelY - 0.02
    else:
        if playerVelY < -0.02:
            playerVelY = playerVelY + 0.015
        elif playerVelY > 0.02:
            playerVelY = playerVelY - 0.015
        else:
            playerVelY = 0

    if playerVelY != 0:
        oldX = playerPos[0]
        oldY = playerPos[1]
        newX = oldX + cos(playerDir) * playerVelY
        newY = oldY + sin(playerDir) * playerVel