CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - TF.e
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - TF.e - List
[
JSP/Java
]
连连看javafx
DL : 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(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; } });)
Date
: 2025-12-20
Size
: 240kb
User
:
谭先生456
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.