很值得学习的,大家多多探讨啊!
public class saolei extends JFrame implements ActionListener,MouseListener,Runnable{
JFrame frame = new JFrame("扫雷游戏");
int x=1; //是否启动线程
int flagcount=0;//标记数量
int wanchenglei=0;//成功标记雷数
String dengji;//等级
JButton start;
int width=50;
int height=50;
int flag=0;//完成雷数
int N=5;//雷数
Graphics g;
Boolean Gaming=false; //游戏是否开始
int weibu=0; //布雷变量
int totalscore;//得分
int totaltime=200;//时间
Thread t=new Thread(this);//第二线程
int A[][]=new int[10][10];//雷的标记
int B[][]=new int[10][10];//标记该格子是否已经点过
int C[][]=new int[10][10];
JLabel score=new JLabel("总分:0");
JLabel time=new JLabel("时间:0");
JLabel leishu=new JLabel("雷数:");
Image im,qi; //两个图片
JMenuBar jb=new JMenuBar(); //菜单条
JMenu jm=new JMenu("选择难度");
JMenuItem cainiao,zhongdeng,gaoshou,paihang;
AudioClip au,aau,aaau; //声音变量
URL backurl,xiaziurl,baozhaurl;//声音路径
- 1
- 2
前往页