Again, change line 1 to this:
Then change the Schijven to schijven again. When calling this method, the object which was clicked is passed and can be used.
It could be something like this then:
The matrix is this at the beginning by the way.
{{0,-1,0,-1,0,-1,0,-1},
{-1,0,-1,0,-1,0,-1,0},
{0,-1,0,-1,0,-1,0,-1},
{-1,0,-1,0,-1,0,-1,0},
{0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0},
{1,0,1,0,1,0,1,0},
{0,1,0,1,0,1,0,1},
{1,0,1,0,1,0,1,0},
{0,1,0,1,0,1,0,1}}
public boolean madeMove(Schijven schijven)
if (schijven.id == -1)
{
if (y == 9) return false; //reached bottom already?
if (x < 9)
{
if (bord[y+1][x+1] == 0) //cell empty?
{
bord[y+1][x+1] = -1;
bord[y][x] = 0;
setLocation(x*50+25,y*50+25); //or showBord();
return true;
}
// check other directions to move
}
}

