public boolean isBorder(Snake snake, KeyEvent keyEvent)
    {
        int sp2x = snake.getX()+60;
        int sp4y = snake.getY()+45;
        int sp1x = snake.getX();



        if(sp2x >= 985 && keyEvent.getKeyCode() == KeyEvent.VK_RIGHT)
            return true;

        if(sp4y > 665 && keyEvent.getKeyCode() == KeyEvent.VK_DOWN)
            return true;

        if(sp4y <=  35&& keyEvent.getKeyCode() == KeyEvent.VK_UP)
            return true;

        if(sp1x < 0 && keyEvent.getKeyCode() == KeyEvent.VK_LEFT)
            return true;

        return false;
    }