您的当前位置:首页正文

课程设计报告书格式(VFP)

来源:九壹网
打字小游戏系统

课程设计报告书

打字小游戏

班 级: 学 号: 姓 名: 指导老师:

石家庄铁道大学四方学院

2011年 月 日

第1页 共14页

打字小游戏系统

1.选择题目

打字小游戏

2.内容摘要

摘要:当今世界,使用电脑的人越来越多,可是打字快的人却不多,为了给大家一个提高打字速度的机会,使大家在娱乐中提高打字速度,我选择了制作本系统——打字小游戏。本文介绍课程设计课题的选题意义,说明了本系统提供的主要功能,并画出功能框图,对设计思路、数据表设计、研究开发的过程、实现细节、开发工作进行了比较完整的综述,最后给出了作者在小学期设计过程的体会。

3.索引关键字

关键词:数据表,游戏主界面,功能框图

第2页 共14页

打字小游戏系统

4.目录

1. 2. 3. 4. 5. 6. 7. 8.

题目要求---------------------------------4 设计思想---------------------------------4 系统完成功能及框图-----------------------5 界面设计---------------------------------6 核心算法及说明---------------------------7 结论-------------------------------------13 后记-------------------------------------13 参考资料----------------------------------14

第3页 共14页

打字小游戏系统

5.正文

5.1课程设计题目要求

5.1.1内容要求

屏幕中单向出现一个字母或单词或汉字,在它移动到屏幕另一端消失之前,在输入位置正确输入它并按回车键即可得分,否则不得分。当丢失字母达到10个时,游戏结束,计算得分。

5.1.2设计要求

1.设计一个系统封面。

2.建立一个项目,将完成本题目创建的所有文件添加到项目中; 3.独立完成;

4.请根据编程需要选择适当的数据结构,如采用数据表、数组等,以降低编程难度; 5.主程序可以使用表单或菜单。

6.将完成的全部内容连编成一个.exe文件。

7.所有的界面及打印的报表请尽可能设计的直观、漂亮一些。

5.2设计思想

在设计时考虑以下几个方面:

操作简单。因为使用者多为非计算机专业人员,所以该系统要求设计的界面美观,操作方便。要充分考软件界面友好和操作方便,便愈使用人员快速上手。

易于维护。一个软件的好坏,关键在于产品的可靠,稳定,便于维护。

第4页 共14页

打字小游戏系统

易于升级。随着社会的发展,对系统的要求会越来越高。要求系统具有更高的安全性;更丰富的功能以及更快的操作速度。所以在设计时要考虑到到以后的升级问题。

2.开发语言的选择

针对世界上流行的大量软件和开发工具,经过认真分析其优缺点,结合目前的软硬件开发环境,选用微软WINDOWS平台下的VISUAL FOXPRO 6.0作为软件开发工具。选用工具有几下几方面优点:

Vfp 6.0是比较好的关系数据库管理系统开发软件。它提供了可视化的开发平台和面向对象的程序设计方法。大量的控件的提供节省了开发的工作量,提高了开发的效率。

Vfp6.0提供了很多设计器,诸多如“数据库设计器”“表单设计器”“菜单设计器”等。 另外还开发了一些“向导工具”、利用这些设计器和向导工具,不用编写大量的程序代码,因而开发工作变得比较轻松。

VFP本身就是一个数据库开发软件系统。使用它开发数据库系统效率更高,稳定性好。

综上所述,VFP6.0可以满足制作打字小游戏的要求,所以用来开发该系统是非常合适的。

5.3系统完成功能及功能框图

本系统主要包括封面模块、游戏首页模块、成绩查询与打印模块、打字类型和难度选择模块、游戏主界面

模块、高分记录模块和游戏结束模块等。

第5页 共14页

打字小游戏系统

由于本软件主要是为个人开发的。我们经过反复论证,最终确定了打字小游戏系统的设计方案,主要功能如图5-1所示:

游戏封面 成绩查询与打印 游戏首页 打字类型和难度选择 字母打字 单词打字 汉字打字 是否是高分 高分界面 结束界面 图5-1 系统功能图

游戏封面:欢迎界面。

游戏首页:开始游戏、高分查询、帮助和退出。

打字类型和难度选择:包括字母、单词和汉字三种类型,四个难度等级。 结束界面:高分结束与非高分结束。

用到的数据表是:字母表、单词表、汉字表和高分记录表。

5.4界面设计

本系统针对游戏封面、游戏首页、打字类型和难度选择、游戏主界面、结束界面分别设计了几个界面,下面举例说明一些功能界面的设计。

第6页 共14页

打字小游戏系统

5.4.4游戏主界面

建立一个表单界面设计如下图所示:

5.5核心算法及说明

5.5.1数据表

该软件由下述四张数据表组成: 1、 用户表

用户表

2.文字表

字段名 姓名 密码 得分a B c d e

类型 字符型 字符型 字符型 字符型 字符型 字符型 字符型

宽度 10 10 10 10 10 10 10

文字表 字段名 汉字 3、字母表

字母表

字段名 字母 4、单词表

单词表

字段名 单词 5、高分记录表

第7页 共14页

类型 字符型 宽度 10 类型 字符型 宽度 10 类型 字符型 宽度 10 打字小游戏系统

高分记录表

字段名 姓名 高分 类型 字符型 字符型 宽度 10 10 5.5.2游戏主界面表单的添加代码

编写form1的init事件: parameter cprompt,x

thisform.text2.value=cprompt use 文字

thisform.text1.readonly=.t

thisform.container1.babel1.bisible=.f.. thisform.container1.image1.visible=.f. thisform.timer1.enabled=.f.

thisform.container1.timer1.enabled=.f.

5.5.3游戏主界面表单的各个控件设计及代码

Command1(开始按钮) click事件:

thisform.text1.readonly=.f.

thisform.container1.label1.visible=.t. thisform.container1.image1.visible=.t. thisform.timer1.enabled=.t.

thisform.container1.timer1.enabled=.t. do case

case thisform.text2.value=1

thisform.container1.timer1.interval=70 case thisform.text2.value=2

thisform.container1.timer1.interval=40 case thisform.text2.value=3

thisform.container1.timer1.interval=20 case thisform.text2.value=4

thisform.container1.timer1.interval=10 endcase

thisform.command2.click this.enabled=.f.

command3(返回按钮):click事件: do form 开始菜单

第8页 共14页

打字小游戏系统

thisform.release

command2(控制随机指定汉字)click事件: a=int((52+1-1)*rand())+1

go a

thisform.txt汉字.setfocus

txt汉字(刷新汉字并将焦点给text1)gotfocus事件:

this.refresh

thisform.text1.setfocus

text1(用户输入控件,同时控制汉字改变和记分)key press事件: LPARAMETERS nKeyCode, nShiftAltCtrl

if nkeycode=13 if alltrim(thisform.text1.value)=alltrim(thisform.txt汉字.value) thisform.container1.timer1.enabled=.f. thisform.container1.label1.enabled=.f. thisform.command2.click thisform.container1.label1.caption=alltrim(thisform.txt汉字.value) thisform.container1.label1.left=thisform.container1.label2.left thisform.container1.image1.left=thisform.container1.label2.left-75 thisform.container1.timer1.enabled=.t. thisform.container1.label1.enabled=.t. thisform.label1.caption=alltrim(str(val(thisform.label1.caption)+10)) &&ji fen endif

endif

container1.timer1(控制container1.label1和container1.image1的移动)timer事件: this.parent.label1.caption=thisform.TXT汉字.value

if this.parent.label1.left+this.parent.label1.width>0 this.parent.label1.left=this.parent.label1.left+3 this.parent.image1.left=this.parent.image1.left+3

else this.parent.label1.left=this.parent.label1.width

endif

timer1(控制血条和结束)timer事件:

if thisform.container1.label1.left>thisform.container1.label3.left thisform.container1.timer1.enabled=.f. if thisform.container11.visible=.T. &&10 thisform.container11.visible=.f.

第9页 共14页

打字小游戏系统

thisform.command2.click

thisform.container1.label1.caption=thisform.txt汉字.value thisform.container1.label1.left=thisform.container1.label2.left thisform.container1.image1.left=thisform.container1.label2.left-75 thisform.container1.timer1.enabled=.t. thisform.container1.label1.enabled=.t. else if thisform.container10.visible=.T. &&9 thisform.container10.visible=.f. thisform.command2.click thisform.container1.label1.caption=thisform.txt汉字.value thisform.container1.label1.left=thisform.container1.label2.left thisform.container1.image1.left=thisform.container1.label2.left-75 thisform.container1.timer1.enabled=.t. thisform.container1.label1.enabled=.t. else if thisform.container9.visible=.T. &&8 thisform.container9.visible=.f. thisform.command2.click thisform.container1.label1.caption=thisform.txt汉字.value thisform.container1.label1.left=thisform.container1.label2.left thisform.container1.image1.left=thisform.container1.label2.left-75 thisform.container1.timer1.enabled=.t. thisform.container1.label1.enabled=.t. else if thisform.container8.visible=.T. &&7 thisform.container8.visible=.f. thisform.command2.click thisform.container1.label1.caption=thisform.txt汉字.value thisform.container1.label1.left=thisform.container1.label2.left thisform.container1.image1.left=thisform.container1.label2.left-75 thisform.container1.timer1.enabled=.t. thisform.container1.label1.enabled=.t. else if thisform.container7.visible=.T. &&6 thisform.container7.visible=.f. thisform.command2.click

第10页 共14页

打字小游戏系统

thisform.container1.label1.caption=thisform.txt汉字.value thisform.container1.label1.left=thisform.container1.label2.left thisform.container1.image1.left=thisform.container1.label2.left-75 thisform.container1.timer1.enabled=.t. thisform.container1.label1.enabled=.t. else if thisform.container6.visible=.T. &&5 thisform.container6.visible=.f. thisform.command2.click thisform.container1.label1.caption=thisform.txt汉字.value thisform.container1.label1.left=thisform.container1.label2.left thisform.container1.image1.left=thisform.container1.label2.left-75 thisform.container1.timer1.enabled=.t. thisform.container1.label1.enabled=.t. else if thisform.container5.visible=.T. &&4 thisform.container5.visible=.f. thisform.command2.click thisform.container1.label1.caption=thisform.txt汉字.value thisform.container1.label1.left=thisform.container1.label2.left thisform.container1.image1.left=thisform.container1.label2.left-75 thisform.container1.timer1.enabled=.t. thisform.container1.label1.enabled=.t. else if thisform.container4.visible=.T. &&3 thisform.container4.visible=.f. thisform.command2.click thisform.container1.label1.caption=thisform.txt汉字.value thisform.container1.label1.left=thisform.container1.label2.left thisform.container1.image1.left=thisform.container1.label2.left-75 thisform.container1.timer1.enabled=.t. thisform.container1.label1.enabled=.t. else if thisform.container3.visible=.T. &&2 thisform.container3.visible=.f. thisform.command2.click

第11页 共14页

打字小游戏系统

thisform.container1.label1.caption=thisform.txt汉字.value thisform.container1.label1.left=thisform.container1.label2.left thisform.container1.image1.left=thisform.container1.label2.left-75 thisform.container1.timer1.enabled=.t. thisform.container1.label1.enabled=.t. else if thisform.container2.visible=.T. &&1 thisform.container2.visible=.f. this.enabled=.f. thisform.container1.timer1.enabled=.f. if

val(thisform.label1.caption)>val(thisform.txt分.value) &&记录高分 thisform.txt分.value=thisform.label1.caption do form 结束高分 thisform.release else do form 结束提示 thisform.release endif endif endif endif endif endif endif endif

endif endif endif endif

5.5.4主程序的编制

代码如下:

第12页 共14页

打字小游戏系统

Set safety off Set talk off Set deleted on Close all

do form 封面 read event

5.6结论

现代社会是竞争的社会,要想在竞争的社会中立足就要讲求工作效率。在使用电脑时,如果打字速度慢,将浪费使用者不少时间,因此提高打字速度是相当有必要的,因为几乎用电脑做任何事都离不开打字。

在以往职工的知识、参考课外资料和寻求老师的帮助下终于完成了一个简单的软件。这个软件功能非常简单,因而我想,在实际运用中,还有些不足。因为知识和能力的不足,我们还无法做出满足实际需求的优秀软件,许多功能还欠缺和不完善,如表单的设计上出现了一些缺陷。

由于我的知识浅薄,经验不足及阅历颇浅,因此,在该系统的设计方面还有很多不

足,比如功能过少,界面不醒目等问题,我会在工作的使用过程中,根据工作的具体要求不断的修改、完善,争取使系统慢慢趋于完美。

6.后记

在这次实践中我们职工到了以前在课本上无法理解和没有见到过的知识,提高自身的知识面和实践能力,收获颇丰。这样的项目对我们学过的数据结构,程序设计,数据库,软件工程,等课程是一个综合性很高的实践。经历这一段时间的实践,我们对原来学习的知识有了更深刻的认识,也学习到了大量的新知识,提高了实际应用的能力。

另外我还充分体会了从事软件开发工作需要特别谨慎认真地态度和作风,一点都不能马虎。每个细微的细节都必须十分注意,如果考不认真思考决策,就会出现或大或小的错误。如果早期的错误隐藏下来,对后面的工作影响就会很大,有时候会弄的满盘皆输的后果。我们不得不对软件的每一步进行检查,给我们的信心带来了打击,非常劳累

第13页 共14页

打字小游戏系统

和痛苦。由于自己的经验及各方面的能力的不足,所以进展的速度非常的缓慢,遇到了好多棘手的问题,不得不去翻阅课本和大量的课外素材,最后自己无法解决的情况下向老师进行请教。

在我们的辛勤努力下,终于作出一个简单的软件,虽然这个软件功能非常简单,而且有很多不足,离实际应用还有很大的距离,但是我们在发现问题的过程中步断去完善自己制作的软件,力求把它作到趋于完美。

在我们制作软件的过程中,老师和同学们都给与了我们很大的帮助,帮助我们查阅

资料寻找知识点,指出我们的软件的错误和不足,在我们遇到困难时给我们鼓励和帮助,在这里,我向这些无私帮助我的人表示由衷的谢意。

7.参考文献

[1] 郑砚 周青 李华杰.《visual foxpro 8.0基础教程》,清华大学出版社,2004-5-1 [2] 刘瑞新 汪远征.《visual foxpro程序设计教程》,电子工业出版社,2007-12-1 [3] 徐健平,赵永.《Visual Foxpro基础教程,机械工业出版社 出版日期:2000-5-1 [4] 张鲁《.Visual Foxpro 6.0编程技巧与实例分析》,水利水电出版社 出版日期:1999-10-1 [5] 张磊等. 《Visual Foxpro 6使用详解》,机械工业出版社 出版日期:1999-7-1

第14页 共14页

因篇幅问题不能全部显示,请点此查看更多更全内容

Top