資源簡介
基于JAVA的連連看游戲設(shè)計.rar

代碼片段和文件信息
package?control;
import?java.awt.event.ActionEvent;
import?java.awt.event.ActionListener;
import?java.awt.event.MouseAdapter;
import?java.awt.event.MouseEvent;
import?java.awt.event.WindowEvent;
import?java.awt.event.WindowListener;
import?javax.swing.JButton;
import?javax.swing.JComboBox;
import?model.Model;
import?view.GamePanel;
public?class?Control?extends?MouseAdapter?implements?ActionListener??WindowListener{
private?Model?model;
public?Control(Model?model){
this.model=model;
}
public?void?actionPerformed(ActionEvent?e)?{
String?cmd=e.getActionCommand().toLowerCase();
if(cmd.equals(“refresh“))
model.refresh();
else?if(cmd.equals(“start“))
model.restartGame();
else?if(cmd.equals(“set“)){
}
else?if(cmd.equals(“remind“))
model.showTip();
else?if(cmd.equals(“demo“)){
JButton?btn=(JButton)?e.getSource();
if(btn.getText().equals(“演示“)){
model.startDemo();
btn.setText(“停止“);
}
else{
model.stopDemo();
btn.setText(“演示“);
model.restartGame();
}
}
else?if(cmd.equals(“about“))
model.about();
else?if(e.getSource()?instanceof?JComboBox){
JComboBox?cbo=(JComboBox)?e.getSource();
String?sltString=cbo.getSelectedItem().toString();
if(sltString.equals(“隨機(jī)“))
model.setLevel(0);
else
model.setLevel(Integer.parseInt(sltString));
}
}
@Override
public?void?mousePressed(MouseEvent?e)?{
object?src=e.getSource();
if(src?instanceof?GamePanel){
GamePanel?gp=(GamePanel)?src;
if(e.getButton()==MouseEvent.BUTTON3)
model.cancelSelect();
else
model.clickMatrix(gp.PointToMetrix(e.getPoint()));
}
}
public?void?windowActivated(WindowEvent?arg0)?{
//?TODO?Auto-generated?method?stub
}
public?void?windowClosed(WindowEvent?arg0)?{
//?TODO?Auto-generated?method?stub
}
public?void?windowClosing(WindowEvent?e)?{
//LoadAndSave.saveLevel(model.getLevel());
model.setframeLocation(e.getWindow().getLocation());
model.saveSet();
}
public?void?windowDeactivated(WindowEvent?arg0)?{
//?TODO?Auto-generated?method?stub
}
public?void?windowDeiconified(WindowEvent?arg0)?{
//?TODO?Auto-generated?method?stub
}
public?void?windowIconified(WindowEvent?arg0)?{
//?TODO?Auto-generated?method?stub
}
public?void?windowOpened(WindowEvent?arg0)?{
//?TODO?Auto-generated?method?stub
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????226??2016-03-29?16:39??基于JAVA的連連看游戲設(shè)計\kyodai\.classpath
?????文件????????382??2016-03-29?16:39??基于JAVA的連連看游戲設(shè)計\kyodai\.project
?????文件???????3264??2016-05-07?02:50??基于JAVA的連連看游戲設(shè)計\kyodai\control\Control.class
?????文件???????2434??2016-03-29?16:39??基于JAVA的連連看游戲設(shè)計\kyodai\control\Control.java
?????文件???????1417??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\1.gif
?????文件???????1502??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\10.gif
?????文件???????1606??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\11.gif
?????文件???????1316??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\12.gif
?????文件???????1240??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\13.gif
?????文件???????1180??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\14.gif
?????文件???????1300??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\15.gif
?????文件???????1375??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\16.gif
?????文件???????1112??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\17.gif
?????文件???????1397??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\18.gif
?????文件???????1388??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\19.gif
?????文件???????1072??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\2.gif
?????文件???????1381??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\20.gif
?????文件???????1284??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\21.gif
?????文件???????1551??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\22.gif
?????文件???????1072??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\23.gif
?????文件???????1279??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\24.gif
?????文件???????1401??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\25.gif
?????文件???????1382??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\26.gif
?????文件???????1199??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\27.gif
?????文件???????1667??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\28.gif
?????文件???????1662??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\29.gif
?????文件???????1279??2016-05-07?01:54??基于JAVA的連連看游戲設(shè)計\kyodai\images\3.gif
?????文件???????1086??2016-05-07?01:55??基于JAVA的連連看游戲設(shè)計\kyodai\images\30.gif
?????文件???????1766??2016-05-07?01:55??基于JAVA的連連看游戲設(shè)計\kyodai\images\31.gif
?????文件???????1873??2016-05-07?01:55??基于JAVA的連連看游戲設(shè)計\kyodai\images\32.gif
............此處省略143個文件信息
評論
共有 條評論