文件名称:连连看javafx
介绍说明--下载内容来自于网络,使用问题请自行百度
连连看,用javafx实现,
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;
}//2次一循环
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;
}
});(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;
}
});)
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;
}//2次一循环
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;
}
});(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;
}
});)
相关搜索: javaFx
(系统自动生成,下载前可以参看下载内容)
下载文件列表
文件名 | 大小 | 更新时间 |
---|---|---|
lianliankan | 0 | 2018-01-11 |
lianliankan\LLKCanvas.class | 6178 | 2018-01-11 |
lianliankan\LLKCanvas.java | 5357 | 2018-01-11 |
lianliankan\MainFrame.class | 3387 | 2018-01-11 |
lianliankan\MainFrame.java | 1418 | 2018-01-11 |
llkpics | 0 | 2018-01-11 |
llkpics\0.jpg | 5036 | 2018-01-11 |
llkpics\1.jpg | 3236 | 2018-01-11 |
llkpics\2.jpg | 4819 | 2018-01-11 |
llkpics\checked.png | 224561 | 2018-01-11 |
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.