function increaseGridSlot(myEvent) {
    let clickedOn = myEvent.target;

    if(hGridArray[clickedOn.myRow][clickedOn.myCol] + 1 > 16) {
        alert("Max limit reached: Wurm houses cannot go beyond 16 levels!");
        return;
    }

    hGridArray[clickedOn.myRow][clickedOn.myCol]++;
    if(hGridArray[clickedOn.myRow][clickedOn.myCol] == 1) {
        numSquaresSelected++;
        if(numSquaresSelected == 1) buildingPlaced = true;
        
        let myResultsFromChange = changeRequirements(clickedOn, true);

        if(myResultsFromChange == -1) {
            numSquaresSelected--;
            hGridArray[clickedOn.myRow][clickedOn.myCol] = 0;
            return;
        }

        clickedOn.style.backgroundColor = getElevatedColor(hGridArray[clickedOn.myRow][clickedOn.myCol]);
        clickedOn.innerHTML = 1;
        return;
    }

    if(hGridArray[clickedOn.myRow][clickedOn.myCol] == 2) numElevated++;

    let myGridSlot = hGridArray[clickedOn.myRow][clickedOn.myCol];
    clickedOn.innerHTML = myGridSlot;
    changeRequirements(clickedOn, true);
    clickedOn.style.backgroundColor = getElevatedColor(hGridArray[clickedOn.myRow][clickedOn.myCol]);
}
//the addition of a level. Left click is assumed for the event.
the addition of a level. Left click is assumed for the event.
the addition of a level . Left click is assumed for the event .
function increaseGridSlot(myEvent) {
    let clickedOn = myEvent.target;
    if(hGridArray[clickedOn.myRow][clickedOn.myCol] + 1 > 16) {
        alert("Max limit reached: Wurm houses cannot go beyond 16 levels!");
        return;
    }
    hGridArray[clickedOn.myRow][clickedOn.myCol]++;
    if(hGridArray[clickedOn.myRow][clickedOn.myCol] == 1) {
        numSquaresSelected++;
        if(numSquaresSelected == 1) buildingPlaced = true;
        let myResultsFromChange = changeRequirements(clickedOn, true);
        if(myResultsFromChange == -1) {
            numSquaresSelected--;
            hGridArray[clickedOn.myRow][clickedOn.myCol] = 0;
            return;
        }
        clickedOn.style.backgroundColor = getElevatedColor(hGridArray[clickedOn.myRow][clickedOn.myCol]);
        clickedOn.innerHTML = 1;
        return;
    }
    if(hGridArray[clickedOn.myRow][clickedOn.myCol] == 2) numElevated++;
    let myGridSlot = hGridArray[clickedOn.myRow][clickedOn.myCol];
    clickedOn.innerHTML = myGridSlot;
    changeRequirements(clickedOn, true);
    clickedOn.style.backgroundColor = getElevatedColor(hGridArray[clickedOn.myRow][clickedOn.myCol]);
}
function increaseGridSlot ( myEvent ) { let clickedOn = myEvent . target ; if ( hGridArray [ clickedOn . myRow ] [ clickedOn . myCol ] + 1 > 16 ) { alert ( "Max limit reached: Wurm houses cannot go beyond 16 levels!" ) ; return ; } hGridArray [ clickedOn . myRow ] [ clickedOn . myCol ] ++ ; if ( hGridArray [ clickedOn . myRow ] [ clickedOn . myCol ] == 1 ) { numSquaresSelected ++ ; if ( numSquaresSelected == 1 ) buildingPlaced = true ; let myResultsFromChange = changeRequirements ( clickedOn , true ) ; if ( myResultsFromChange == - 1 ) { numSquaresSelected -- ; hGridArray [ clickedOn . myRow ] [ clickedOn . myCol ] = 0 ; return ; } clickedOn . style . backgroundColor = getElevatedColor ( hGridArray [ clickedOn . myRow ] [ clickedOn . myCol ] ) ; clickedOn . innerHTML = 1 ; return ; } if ( hGridArray [ clickedOn . myRow ] [ clickedOn . myCol ] == 2 ) numElevated ++ ; let myGridSlot = hGridArray [ clickedOn . myRow ] [ clickedOn . myCol ] ; clickedOn . innerHTML = myGridSlot ; changeRequirements ( clickedOn , true ) ; clickedOn . style . backgroundColor = getElevatedColor ( hGridArray [ clickedOn . myRow ] [ clickedOn . myCol ] ) ; }
the addition of a level.
the addition of a level .