摘 要
连连看是一种消除类益智游戏,核心要求是在规定的时间内,消除游戏界面中选中的两张相同的图案,直至完全消除所有图案。这款游戏操作简单(只需单击鼠标左键操作)、面向人群广泛,在限时操作的游戏要求下,吸引玩家自发地锻炼观察能力、判断能力和反应能力,故从推出至今颇受欢迎。消除类游戏如今也有很多类型,但连连看游戏因其操作简单依旧广受好评,该游戏不仅能调节精神状态,还能在游戏中锻炼我们的眼力视野和集中力,开发思维能力的同时培养面对困难时具备攻克困难的信心。
此次设计所使用的语言为Java语言,开发环境为JDK Version1.7.0,开发工具为Eclipse。主要应用Swing组件,Java小程序,事件及接口等。本系统主要是运用Swing组件和事件处理技术,进行界面的绘制,鼠标的操作,以及积分的显示和沙漏的计时的显示等功能。
关键词:游戏;连连看;二维游戏
Design and Implementation of Java-Based Link-Game
Abstract
Link-Game is a kind of tile-matching puzzle games,the core requirement is that within the prescribed period eliminating two selected pictures which clicked on the before and after and had the same pattern until completely eliminating all of the same two.There are numerous reasons why this game is popular since launch as follow.The operation of the game is simple (just need clicking the mouse left key)and facing the crowd is widespread.But also in the limited time,game players have to victory attracts people exercise spontaneously observation ability,judgment ability and the ability to respond to.Now this kind of puzzle games also has a lot of types,but Link-Game because of its simple operation is still popular,not only can the game adjust the mental state,but also exercise our eyesight and concentrated force by enjoying the game.Furthermore,it develops the thinking ability.Meanwhile,it cultivates the confidence to overcome difficulties when we face the difficulties.
This design uses Java language,and it’s development environment is the Version 1.7.0 JDK on eclipse,the development tool.This system mainly use Swing components,Java applet,event and interface.By using event handling technology and Swing technology realizes the GUI,the mouse operation,showing the game credits as well as the function that timing as the hourglass.
Keywords: Games; Link-Gamegame; tTwo-dimensional gameGame
目录
摘 要1
Abstract2
目录2
1.绪论1
1.1.课题背景1
1.2.Java游戏开发的现状1
1.2.1.Java日益趋向成熟1
1.2.2.Java极大的方便了游戏脚本的使用2
1.2.3.Java平台无关特性2
1.2.4.Java在手机游戏开发方面的优势2
1.2.5.Java在网络方面的良好表现2
1.2.6.游戏速度3
1.3.项目开发的目标3
1.4.项目开发的意义3
1.5.本文章节安排4
1.6.本章小结4
2.开发环境和相关技术简介5
2.1.开发环境5
2.1.1.Eclipse5
Java6
2.1.2.6
2.2.相关技术简介7
2.2.1.Eclipse的图形界面开发8
2.2.2.Java技术在游戏开发中的应用8
2.3.本章小结12
3.需求分析13
3.1.可行性分析13
3.1.1.技术可行性13
3.1.2.经济可行性13
3.1.3.社会可行性14
3.1.4.操作可行性14
3.2.连连看游戏需求描述及规则描述14
3.3.系统需求分析14
3.3.1.业务需求15
3.3.2.用户需求15
3.3.3.功能需求16
3.3.4.非功能需求17
3.4.本章小结18
4.概要设计19
4.1.模块设计19
4.1.1.连连看系统总体结构19
4.1.2.连连看系统模各模块介绍19
4.1.3.游戏界面模块20
4.1.4.处理模块20
4.2.确定类20
4.3.游戏素材22
4.3.1.背景图片22
4.3.2.游戏图片22
4.4.本章小结23
5.详细设计和实现24
5.1.界面设计24
5.1.1.界面实现24
5.1.2.倒计时沙漏的设计26
5.2.游戏执行的实现28
5.2.1.点击图片的实现及其部分代码29
5.2.2.记分、记关数的实现30
5.2.3.刷新功能的实现30
5.2.4.重新开始游戏功能的实现32
5.3.游戏的连接算法32
5.3.1.连连看连接方式的类型32
5.3.2.连连看连接方式的分析33
5.3.3.部分核心代码35
5.4.本章小结36
6.系统测试37
6.1.软件测试目的及意义37
6.1.1.测试目的37
6.1.2.测试意义38
6.2.测试方法分类38
6.3.测试步骤39
6.4.测试用例40
6.5.测试结果45
6.6.本章小结45
结 论46
致 谢47
参考文献48