C#编程结课设计说明书

上传人:re****.1 文档编号:477350694 上传时间:2023-11-11 格式:DOC 页数:24 大小:436KB
返回 下载 相关 举报
C#编程结课设计说明书_第1页
第1页 / 共24页
C#编程结课设计说明书_第2页
第2页 / 共24页
C#编程结课设计说明书_第3页
第3页 / 共24页
C#编程结课设计说明书_第4页
第4页 / 共24页
C#编程结课设计说明书_第5页
第5页 / 共24页
点击查看更多>>
资源描述

《C#编程结课设计说明书》由会员分享,可在线阅读,更多相关《C#编程结课设计说明书(24页珍藏版)》请在金锄头文库上搜索。

1、荆楚理工学院结课设计说明书学生姓名:姚元美 梁贵波 杨爽学 号:10EN404010261 2008404010248 2008404010238专 业:计算机科学与技术班 级:计算机08-2任课教师:游明坤251. 游戏编程1.1. 概述1.1.1. 完成任务(1) 程序运行界面如图1.1所示:图1.1 计算机信息查看器主界面1.2. 分析1.2.1. 功能分析新局:单击左侧会出现连连看游戏运行界面,进入游戏。提示:用户可以在找不到一样的图案的时候点击提示,会出现两个可以撤销的类似图案。重排:左边图案会重新编排一次。配置:用户可以对游戏的相关选项进行设置。退出:退出游戏。1.2.2. 界面分

2、析运行界面如下:如图1.1所示,程序主体界面可分为三部分:第一部分是以执行游戏的部分,第二部分是以游戏设置以及帮助的部分,第三部分就是游戏在运行时所剩时间提示。第一部分含1个控件:11个列表视图(list view)。第二部分含8个控件:6个按钮(button)2个标签(label)。在2个label中,2个用于显示提示,1个复选项,分别用于显示相应的“详细信息”。第三部分含3个控件:1个label,1个显示提示,还有一个。界面的详细布局如图1.1所示。1.2.3. 程序分析本程序的核心是游戏执行部分,所有的操作都围绕着该数据进行的。游戏分为三关:简单、一般和难。为了用户在规定时间完成一关,设

3、计了提示和重排。其中新局是开始游戏的意思,退出也就意味着结束游戏。1.3. 实现步骤1.3.1. 建立工程建立C# Windows窗体应用程序Game项目。1.3.2. 界面设计根据图1.1的样式,设计出查看器的窗体布局。1.3.3. 主程序功能实现 (1)定义主程序类对象GameMain。 (2)加载数据。使用ComputerManager的Load方法从文件中加载信息,如果存在文件,则将文件中的计算机对象填充到ListView。 如果不存在,则创建不同类型的计算机,并添加到泛型集合中,填充到ListView中。 (3)窗体设计器生成的代码中的数据到Dispose:private void

4、EndGame(),private void WinGame()。时间触发private void timeOutTimer_Tick(object sender, EventArgs e)。(4)初始化集合泛型数据:private void InitGame()。如果从本地文件加载泛型集合数据失败,则由程序初始化数据,填充到泛型集合。(5)给下压式按钮添加事件处理。1.4. 核心代码using System;using System.Collections;using System.ComponentModel;using System.Drawing;using System.IO;usi

5、ng System.Windows.Forms;using LLK.ACTION;using LLK.UI;namespace LLKpublic class GameMain : Formprivate IContainer components;private CheckBox AutoClear;private Timer lineTimer;private Button btnReset;private Button btnInfo;private Button btnRePlay;private Label lbP;private Label lbInfoCount;private

6、Label label3;private Button btnExit;private ProgressBar pBar;private Timer timeOutTimer;private Label lbTimeOut;private PictureBox pictureBox1;private Label label1;private Label lbCaption;private CheckBox AutoReset;private Button btnAbout;private Button btnConfig;private ScreenDraw SD = null;private

7、 Line search_p1 = null;private Line search_p2 = null;private bool isSearch = false;private int PointCount = 0;private int InfoCount = 5;private const int GameTimeSec = 60;private GameState gs = GameState.Start;private Map oMap = null;private LineManager LM = null;private ScreenCursor cursor = null;p

8、rivate GameOption.Options options = new GameOption.Options();private ScreenObject SO = null;private BombPoint bp1 = new BombPoint();private BombPoint bp2 = new BombPoint();private SoundPlayList spl = new SoundPlayList();private string appPath = ;private SoundPlayer spBg;private SoundPlayer spBomb;pr

9、ivate SoundPlayer spEarse;private SoundPlayer spRefresh;private SoundPlayer spSelect;private SoundPlayer spHint;private int, L = new int3,3 28, 22, 16, 34, 28, 22, 39, 34, 28;private Timer SplashTimer;private GameLoading GL = null;private enum GameStateStart,Play,End,Winpublic GameMain(GameLoading g

10、ameLoading)InitializeComponent();this.GL = gameLoading;protected override void Dispose(bool disposing)if (disposing)if (components != null)components.Dispose();base.Dispose(disposing);#region Windows 窗体设计器生成的代码private void InitializeComponent()ponents = new Container();this.btnReset = new Button();t

11、his.btnInfo = new Button();this.AutoClear = new CheckBox();this.lineTimer = new Timer(ponents);this.btnRePlay = new Button();this.label1 = new Label();this.lbP = new Label();this.lbInfoCount = new Label();this.label3 = new Label();this.btnExit = new Button();this.pBar = new ProgressBar();this.lbTime

12、Out = new Label();this.timeOutTimer = new Timer(ponents);this.pictureBox1 = new PictureBox();this.lbCaption = new Label();this.AutoReset = new CheckBox();this.btnAbout = new Button();this.btnConfig = new Button();this.SplashTimer = new Timer(ponents);this.SuspendLayout();this.btnReset.ForeColor = Co

13、lor.FromArgb(Byte) (192), (Byte) (255), (Byte) (255);this.btnReset.Location = new Point(672, 100);this.btnReset.Name = btnReset;this.btnReset.TabIndex = 1;this.btnReset.Text = 重排;this.btnReset.Click += new EventHandler(this.btnReset_Click);this.btnInfo.ForeColor = Color.FromArgb(Byte) (192), (Byte)

14、(255), (Byte) (255);this.btnInfo.Location = new Point(672, 68);this.btnInfo.Name = btnInfo;this.btnInfo.TabIndex = 2;this.btnInfo.Text = 提示;this.btnInfo.Click += new EventHandler(this.btnInfo_Click);this.AutoClear.ForeColor = Color.Goldenrod;this.AutoClear.Location = new Point(672, 136);this.AutoClear.Name = AutoClear;this.AutoCl

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 大杂烩/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号