public boolean isOutOfCellBounds()
    {
        boolean out = false;
        switch (direction) {
            case 0:
                out = (int)y <= (row - 1) * pixels + pixels / 2;
                break;
            
            case 1:
                out = (int)x >= (column + 1) * pixels + pixels / 2;
                break;
            
            case 2:
                out = (int)y >= (row + 1) * pixels + pixels / 2;
                break;
                
            case 3:
                out = (int)x <= (column - 1) * pixels + pixels / 2;
                break;
        }
        return out;
    }