function DragHouse(ev) {
    var flag = false;

    mostRecentDragID = ev.target.id;

    if (mostRecentDragID === "rhombus") {
        if (rotationArr[RHOMBUS_INDEX] === 135 || rotationArr[RHOMBUS_INDEX] === 315) {
            flag = true;
        }
    }
    else if (mostRecentDragID === "square") {
        if (rotationArr[SQUARE_INDEX] === 0 || rotationArr[SQUARE_INDEX] === 90 || rotationArr[SQUARE_INDEX] === 180 || rotationArr[SQUARE_INDEX] === 270 || rotationArr[SQUARE_INDEX] === 360) {
            flag = true;
        }
    }
    else if (mostRecentDragID === "blueTri") {
        if (rotationArr[BLUE_TRI_INDEX] === 0 || rotationArr[BLUE_TRI_INDEX] === 90 || rotationArr[BLUE_TRI_INDEX] === 315 || rotationArr[BLUE_TRI_INDEX] === 360) {

            if (rotationArr[BLUE_TRI_INDEX] === 90 && aquaTriDropAreaEmpty === true) {
                var dropAr = document.getElementById("aquaTriDropArea");

                dropAr.style.webkitTransform = "rotate(270deg)";
                dropAr.style.msTransform = "rotate(270deg)";
                dropAr.style.transform = "rotate(270deg)";

                dropAr.style.zIndex = "4";
            }

            flag = true;
        }
    }
    else if (mostRecentDragID === "aquaTri") {
        if (rotationArr[AQUA_TRI_INDEX] === 270 || rotationArr[AQUA_TRI_INDEX] === 180) {
            if (rotationArr[AQUA_TRI_INDEX] === 180 && blueTriDropAreaEmpty === true) {
                var dropAr = document.getElementById("blueTriDropArea");
                dropAr.style.webkitTransform = "rotate(180deg)";
                dropAr.style.msTransform = "rotate(180deg)";
                dropAr.style.transform = "rotate(180deg)";

                dropAr.style.zIndex = "4";
            }
            else {
                var dropAr = document.getElementById("blueTriDropArea");
                dropAr.style.webkitTransform = "rotate(0deg)";
                dropAr.style.msTransform = "rotate(0deg)";
                dropAr.style.transform = "rotate(0deg)";
            }

            flag = true;
        }
    }
    else if (mostRecentDragID === "greenTri") {
        if (rotationArr[GREEN_TRI_INDEX] === 0 || rotationArr[GREEN_TRI_INDEX] === 180 || rotationArr[GREEN_TRI_INDEX] === 360) {
            if ((rotationArr[GREEN_TRI_INDEX] === 0 || rotationArr[GREEN_TRI_INDEX] === 360) && yellowTriDropAreaEmpty === true) {
                document.getElementById("yellowTriDropArea").style.zIndex = "3";
                document.getElementById("greenTriDropArea").style.zIndex = "2";
            }

            flag = true;
        }
    }
    else if (mostRecentDragID === "orangeTri") {
        if (rotationArr[ORANGE_TRI_INDEX] === 180) {
            flag = true;
        }
    }
    else if (mostRecentDragID === "yellowTri") {
        if (rotationArr[YELLOW_TRI_INDEX] === 0 || rotationArr[YELLOW_TRI_INDEX] === 180 || rotationArr[YELLOW_TRI_INDEX] === 360) {
            if ((rotationArr[YELLOW_TRI_INDEX] === 0 || rotationArr[YELLOW_TRI_INDEX] === 360) && greenTriDropAreaEmpty === true) {
                document.getElementById("yellowTriDropArea").style.zIndex = "2";
                document.getElementById("greenTriDropArea").style.zIndex = "3";
            }

            flag = true;
        }
    }

    if (flag === true) {
        //makes it seem like you're only dragging the object
        document.getElementById(ev.target.id).style.opacity = "0";
        ev.dataTransfer.setData("content", ev.target.id);
    }
    else {
        ev.preventDefault();
    }
}
//*********************** Functions specific to the House level (higher difficulty level) *************************************//
Functions specific to the House level (higher difficulty level)
Functions specific to the House level ( higher difficulty level )
function DragHouse(ev) {
    var flag = false;
    mostRecentDragID = ev.target.id;
    if (mostRecentDragID === "rhombus") {
        if (rotationArr[RHOMBUS_INDEX] === 135 || rotationArr[RHOMBUS_INDEX] === 315) {
            flag = true;
        }
    }
    else if (mostRecentDragID === "square") {
        if (rotationArr[SQUARE_INDEX] === 0 || rotationArr[SQUARE_INDEX] === 90 || rotationArr[SQUARE_INDEX] === 180 || rotationArr[SQUARE_INDEX] === 270 || rotationArr[SQUARE_INDEX] === 360) {
            flag = true;
        }
    }
    else if (mostRecentDragID === "blueTri") {
        if (rotationArr[BLUE_TRI_INDEX] === 0 || rotationArr[BLUE_TRI_INDEX] === 90 || rotationArr[BLUE_TRI_INDEX] === 315 || rotationArr[BLUE_TRI_INDEX] === 360) {
            if (rotationArr[BLUE_TRI_INDEX] === 90 && aquaTriDropAreaEmpty === true) {
                var dropAr = document.getElementById("aquaTriDropArea");
                dropAr.style.webkitTransform = "rotate(270deg)";
                dropAr.style.msTransform = "rotate(270deg)";
                dropAr.style.transform = "rotate(270deg)";
                dropAr.style.zIndex = "4";
            }
            flag = true;
        }
    }
    else if (mostRecentDragID === "aquaTri") {
        if (rotationArr[AQUA_TRI_INDEX] === 270 || rotationArr[AQUA_TRI_INDEX] === 180) {
            if (rotationArr[AQUA_TRI_INDEX] === 180 && blueTriDropAreaEmpty === true) {
                var dropAr = document.getElementById("blueTriDropArea");
                dropAr.style.webkitTransform = "rotate(180deg)";
                dropAr.style.msTransform = "rotate(180deg)";
                dropAr.style.transform = "rotate(180deg)";
                dropAr.style.zIndex = "4";
            }
            else {
                var dropAr = document.getElementById("blueTriDropArea");
                dropAr.style.webkitTransform = "rotate(0deg)";
                dropAr.style.msTransform = "rotate(0deg)";
                dropAr.style.transform = "rotate(0deg)";
            }
            flag = true;
        }
    }
    else if (mostRecentDragID === "greenTri") {
        if (rotationArr[GREEN_TRI_INDEX] === 0 || rotationArr[GREEN_TRI_INDEX] === 180 || rotationArr[GREEN_TRI_INDEX] === 360) {
            if ((rotationArr[GREEN_TRI_INDEX] === 0 || rotationArr[GREEN_TRI_INDEX] === 360) && yellowTriDropAreaEmpty === true) {
                document.getElementById("yellowTriDropArea").style.zIndex = "3";
                document.getElementById("greenTriDropArea").style.zIndex = "2";
            }
            flag = true;
        }
    }
    else if (mostRecentDragID === "orangeTri") {
        if (rotationArr[ORANGE_TRI_INDEX] === 180) {
            flag = true;
        }
    }
    else if (mostRecentDragID === "yellowTri") {
        if (rotationArr[YELLOW_TRI_INDEX] === 0 || rotationArr[YELLOW_TRI_INDEX] === 180 || rotationArr[YELLOW_TRI_INDEX] === 360) {
            if ((rotationArr[YELLOW_TRI_INDEX] === 0 || rotationArr[YELLOW_TRI_INDEX] === 360) && greenTriDropAreaEmpty === true) {
                document.getElementById("yellowTriDropArea").style.zIndex = "2";
                document.getElementById("greenTriDropArea").style.zIndex = "3";
            }
            flag = true;
        }
    }
    if (flag === true) {
        document.getElementById(ev.target.id).style.opacity = "0";
        ev.dataTransfer.setData("content", ev.target.id);
    }
    else {
        ev.preventDefault();
    }
}
function DragHouse ( ev ) { var flag = false ; mostRecentDragID = ev . target . id ; if ( mostRecentDragID === "rhombus" ) { if ( rotationArr [ RHOMBUS_INDEX ] === 135 || rotationArr [ RHOMBUS_INDEX ] === 315 ) { flag = true ; } } else if ( mostRecentDragID === "square" ) { if ( rotationArr [ SQUARE_INDEX ] === 0 || rotationArr [ SQUARE_INDEX ] === 90 || rotationArr [ SQUARE_INDEX ] === 180 || rotationArr [ SQUARE_INDEX ] === 270 || rotationArr [ SQUARE_INDEX ] === 360 ) { flag = true ; } } else if ( mostRecentDragID === "blueTri" ) { if ( rotationArr [ BLUE_TRI_INDEX ] === 0 || rotationArr [ BLUE_TRI_INDEX ] === 90 || rotationArr [ BLUE_TRI_INDEX ] === 315 || rotationArr [ BLUE_TRI_INDEX ] === 360 ) { if ( rotationArr [ BLUE_TRI_INDEX ] === 90 && aquaTriDropAreaEmpty === true ) { var dropAr = document . getElementById ( "aquaTriDropArea" ) ; dropAr . style . webkitTransform = "rotate(270deg)" ; dropAr . style . msTransform = "rotate(270deg)" ; dropAr . style . transform = "rotate(270deg)" ; dropAr . style . zIndex = "4" ; } flag = true ; } } else if ( mostRecentDragID === "aquaTri" ) { if ( rotationArr [ AQUA_TRI_INDEX ] === 270 || rotationArr [ AQUA_TRI_INDEX ] === 180 ) { if ( rotationArr [ AQUA_TRI_INDEX ] === 180 && blueTriDropAreaEmpty === true ) { var dropAr = document . getElementById ( "blueTriDropArea" ) ; dropAr . style . webkitTransform = "rotate(180deg)" ; dropAr . style . msTransform = "rotate(180deg)" ; dropAr . style . transform = "rotate(180deg)" ; dropAr . style . zIndex = "4" ; } else { var dropAr = document . getElementById ( "blueTriDropArea" ) ; dropAr . style . webkitTransform = "rotate(0deg)" ; dropAr . style . msTransform = "rotate(0deg)" ; dropAr . style . transform = "rotate(0deg)" ; } flag = true ; } } else if ( mostRecentDragID === "greenTri" ) { if ( rotationArr [ GREEN_TRI_INDEX ] === 0 || rotationArr [ GREEN_TRI_INDEX ] === 180 || rotationArr [ GREEN_TRI_INDEX ] === 360 ) { if ( ( rotationArr [ GREEN_TRI_INDEX ] === 0 || rotationArr [ GREEN_TRI_INDEX ] === 360 ) && yellowTriDropAreaEmpty === true ) { document . getElementById ( "yellowTriDropArea" ) . style . zIndex = "3" ; document . getElementById ( "greenTriDropArea" ) . style . zIndex = "2" ; } flag = true ; } } else if ( mostRecentDragID === "orangeTri" ) { if ( rotationArr [ ORANGE_TRI_INDEX ] === 180 ) { flag = true ; } } else if ( mostRecentDragID === "yellowTri" ) { if ( rotationArr [ YELLOW_TRI_INDEX ] === 0 || rotationArr [ YELLOW_TRI_INDEX ] === 180 || rotationArr [ YELLOW_TRI_INDEX ] === 360 ) { if ( ( rotationArr [ YELLOW_TRI_INDEX ] === 0 || rotationArr [ YELLOW_TRI_INDEX ] === 360 ) && greenTriDropAreaEmpty === true ) { document . getElementById ( "yellowTriDropArea" ) . style . zIndex = "2" ; document . getElementById ( "greenTriDropArea" ) . style . zIndex = "3" ; } flag = true ; } } if ( flag === true ) { document . getElementById ( ev . target . id ) . style . opacity = "0" ; ev . dataTransfer . setData ( "content" , ev . target . id ) ; } else { ev . preventDefault ( ) ; } }
Functions specific to the House level (higher difficulty level)
Functions specific to the House level ( higher difficulty level )
//makes it seem like you're only dragging the object