Introduction - If you have any usage issues, please Google them yourself
this.setOnMouseClicked(e -> {
if (e.getButton() == MouseButton.PRIMARY) {
x2 = (int) ((e.getX() - w) / w);
y2 = (int) ((e.getY() - w) / w);
g.drawImage(new Image("llkpics/checked.png"), x2 * w + w, y2 * w + w, w/6,w/6);
if (check == false) {
x1 = x2;
y1 = y2;
}
else {
int grade = 0;
if (isSame(x1, y1, x2, y2) && isCut(x1, y1, x2, y2) &&
map[y1 * COL + x1] != BLANK && map[y2 * COL + x2] != BLANK) {
grade = Integer.parseInt(MainFrame.tf.getText()) + 2;
MainFrame.tf.setText(String.valueOf(grade));
if (x1 != x2 || y1 != y2) {
map[y1 * COL + x1] = BLANK;
map[y2 * COL + x2] = BLANK;
myRepaint();
}
}
}
check = !check;
}
});