c# 连连看 frmMain 代码

c# 连连看 frmMain 代码

ID:38580295

大小:66.50 KB

页数:11页

时间:2019-06-15

c# 连连看 frmMain 代码_第1页
c# 连连看 frmMain 代码_第2页
c# 连连看 frmMain 代码_第3页
c# 连连看 frmMain 代码_第4页
c# 连连看 frmMain 代码_第5页
资源描述:

《c# 连连看 frmMain 代码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Threading;usingSystem.Timers;namespaceLLKAN{publicpartialclassfrmMain:Form{GameMyGame=newG

2、ame();stdFuncMystdFunc=newstdFunc();MapSelectMyMapSelect=newMapSelect();stringappPath="";PlaySoundspEarse;PlaySoundspSelect;privateinttime=100;privateconstintVALUE=1;publicintpn;privateintscore;privateSystem.Windows.Forms.ProgressBarpBar;GameStategs=Gam

3、eState.Start;publicfrmMain(){InitializeComponent();StartPosition=FormStartPosition.CenterScreen;}privateenumGameState{Start,Play,End,Win}//开始游戏privatevoidGameStart_Click(objectsender,EventArgse){LineTime.Enabled=true;LineTime.Start();GraphicsMyDraw=Pic1

4、.CreateGraphics();MyGame.GameStart(pn);DrawGame(MyDraw);//在窗体内绘制游戏的图片MyMapSelect.Clear();//清除前面游戏的图片?if(LineTime.Enabled==true){progressBar1.Value=100;time=100;}score=0;label2.Text=score.ToString();}//开始/重新开始privatevoidbutton1_Click(objectsender,EventAr

5、gse){this.button1.Text="重新开始";LineTime.Enabled=true;LineTime.Start();GraphicsMyDraw=Pic1.CreateGraphics();if(comboBox1.Text=="天才级")pn=49;elseif(comboBox1.Text=="困难级")pn=30;elseif(comboBox1.Text=="普通级")pn=25;elseif(comboBox1.Text=="入门级")pn=10;elsepn=5;My

6、Game.GameStart(pn);MyMapSelect.Clear();//清除前面游戏的图片?DrawGame(MyDraw);//在窗体内绘制游戏的图片//if(LineTime.Enabled==true)//{//MessageBox.Show("确定重新开始吗","提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Information);//progressBar1.Value=100;time=100;//}score=0;label2.T

7、ext=score.ToString();}///

///在窗体内绘制游戏的图片//////privatevoidDrawGame(GraphicsMyDraw){if(MyGame.Playflag){for(inti=0;i

8、amePicList[i,j].Selected){MyDraw.DrawImage(IL2.Images[MyGame.GamePicList[i,j].PicIndex],MyGame.GamePicList[i,j].X,MyGame.GamePicList[i,j].Y);}else{MyDraw.DrawImage(IL1.Images[MyGame.GamePicList[i,j].PicIndex],MyGame.GamePicList[i

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。