文件名称:连连看javafx
- 所属分类:
- JSP源码/Java
- 资源属性:
- 上传时间:
- 2018-01-11
- 文件大小:
- 240kb
- 下载次数:
- 0次
- 提 供 者:
- 谭先生***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
连连看,用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(Mainfr a me.tf.getText()) + 2;
Mainfr a me.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(Mainfr a me.tf.getText()) + 2;
Mainfr a me.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(Mainfr a me.tf.getText()) + 2;
Mainfr a me.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(Mainfr a me.tf.getText()) + 2;
Mainfr a me.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 |