src/MainAppLayout.java
@Override
    public void keyPressed(KeyEvent e) {
        
        int keyCode = e.getKeyCode();
        
        if (keyCode == 38) {
            if (humanLocationY > 0 & playerWon == false & playerLost == false) {
                gameBoard[humanLocationY][humanLocationX] = 0;
                humanLocationY -= 1;
                zombieAlertCheck(humanLocationX, humanLocationY);
                gameBoard[humanLocationY][humanLocationX] = 2;
                updateBoard();
            }
        }
        else if (keyCode == 40) {
            if (humanLocationY < 9 & playerWon == false & playerLost == false) {
                gameBoard[humanLocationY][humanLocationX] = 0;
                humanLocationY += 1;
                zombieAlertCheck(humanLocationX, humanLocationY);
                gameBoard[humanLocationY][humanLocationX] = 2;
                updateBoard();
            }
        }
        else if (keyCode == 37) {
            if (humanLocationX > 0 & playerWon == false & playerLost == false) {
                gameBoard[humanLocationY][humanLocationX] = 0;
                humanLocationX -= 1;
                zombieAlertCheck(humanLocationX, humanLocationY);
                gameBoard[humanLocationY][humanLocationX] = 2;
                updateBoard();
            }
        }
        else if (keyCode == 39) {
            if (humanLocationX < 9 & playerWon == false & playerLost == false) {
                gameBoard[humanLocationY][humanLocationX] = 0;
                humanLocationX += 1;
                zombieAlertCheck(humanLocationX, humanLocationY);
                gameBoard[humanLocationY][humanLocationX] = 2;
                updateBoard();
            }
        }
        
    }
//Method of Key and Action Listeners

Method of Key and Action Listeners
Method of Key and Action Listeners
@Override
    public void keyPressed(KeyEvent e) {
        int keyCode = e.getKeyCode();
        if (keyCode == 38) {
            if (humanLocationY > 0 & playerWon == false & playerLost == false) {
                gameBoard[humanLocationY][humanLocationX] = 0;
                humanLocationY -= 1;
                zombieAlertCheck(humanLocationX, humanLocationY);
                gameBoard[humanLocationY][humanLocationX] = 2;
                updateBoard();
            }
        }
        else if (keyCode == 40) {
            if (humanLocationY < 9 & playerWon == false & playerLost == false) {
                gameBoard[humanLocationY][humanLocationX] = 0;
                humanLocationY += 1;
                zombieAlertCheck(humanLocationX, humanLocationY);
                gameBoard[humanLocationY][humanLocationX] = 2;
                updateBoard();
            }
        }
        else if (keyCode == 37) {
            if (humanLocationX > 0 & playerWon == false & playerLost == false) {
                gameBoard[humanLocationY][humanLocationX] = 0;
                humanLocationX -= 1;
                zombieAlertCheck(humanLocationX, humanLocationY);
                gameBoard[humanLocationY][humanLocationX] = 2;
                updateBoard();
            }
        }
        else if (keyCode == 39) {
            if (humanLocationX < 9 & playerWon == false & playerLost == false) {
                gameBoard[humanLocationY][humanLocationX] = 0;
                humanLocationX += 1;
                zombieAlertCheck(humanLocationX, humanLocationY);
                gameBoard[humanLocationY][humanLocationX] = 2;
                updateBoard();
            }
        }
    }
@ Override public void keyPressed ( KeyEvent e ) { int keyCode = e . getKeyCode ( ) ; if ( keyCode == 38 ) { if ( humanLocationY > 0 & playerWon == false & playerLost == false ) { gameBoard [ humanLocationY ] [ humanLocationX ] = 0 ; humanLocationY -= 1 ; zombieAlertCheck ( humanLocationX , humanLocationY ) ; gameBoard [ humanLocationY ] [ humanLocationX ] = 2 ; updateBoard ( ) ; } } else if ( keyCode == 40 ) { if ( humanLocationY < 9 & playerWon == false & playerLost == false ) { gameBoard [ humanLocationY ] [ humanLocationX ] = 0 ; humanLocationY += 1 ; zombieAlertCheck ( humanLocationX , humanLocationY ) ; gameBoard [ humanLocationY ] [ humanLocationX ] = 2 ; updateBoard ( ) ; } } else if ( keyCode == 37 ) { if ( humanLocationX > 0 & playerWon == false & playerLost == false ) { gameBoard [ humanLocationY ] [ humanLocationX ] = 0 ; humanLocationX -= 1 ; zombieAlertCheck ( humanLocationX , humanLocationY ) ; gameBoard [ humanLocationY ] [ humanLocationX ] = 2 ; updateBoard ( ) ; } } else if ( keyCode == 39 ) { if ( humanLocationX < 9 & playerWon == false & playerLost == false ) { gameBoard [ humanLocationY ] [ humanLocationX ] = 0 ; humanLocationX += 1 ; zombieAlertCheck ( humanLocationX , humanLocationY ) ; gameBoard [ humanLocationY ] [ humanLocationX ] = 2 ; updateBoard ( ) ; } } }
Method of Key and Action Listeners
Method of Key and Action Listeners