Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to get edge pieces only on canvas. #4

Open
himanshu19890 opened this issue Jan 27, 2014 · 0 comments
Open

Trying to get edge pieces only on canvas. #4

himanshu19890 opened this issue Jan 27, 2014 · 0 comments

Comments

@himanshu19890
Copy link

Hello, thanks for this excellent library.I am experimenting with it and trying to get only edge pieces on canvas.I am modifying the puzzle constructor like below code.

  public Puzzle(Context c, Bitmap[] images, String location, int width, int height, Difficulty d) {
    for (int i = 0; i < images.length; i++) {
        if(pg.isEdge(i, width, height)){
            edgePieces.add(new Piece(c, images[i], d.getOffset()));
        }
        else{
            pieces.add(new Piece(c, images[i], d.getOffset()));
        }
    }

    this.width = width;
    findNeighbors(width);
}

But every time app throws error on line:- if(pg.isEdge(i, width, height)){ . I think isEdge method is not working.Please help me to get rid of this error.

Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant