重庆三峡学院毕业设计(论文)
题目:基于 J2ME 技术的手机游戏研究与实现
专 业:计算机科学与技术
年 级:2006 级
学 号:200606080123
作 者:霍小伟
指导老师:马伯骊
完成时间:2010 年 5 月
说 明
现在的移动电话是小型的计算机,暂时它的处理能力与台式机的标准处理能力相比很有限,
但是足够运行一个相对小型的游戏。同时它们还是网络计算机,能够高速发送和接收数字数据。
除了语音数据以外,它们还可以发送和接收其它类型的数据。
是一种针对移动电话和 这样的小型设备的 语言。大部分的手机厂商都迫切希
望 手机推广应用。尽管 与台式机中的 相比还是有很大的限制,但是它已经极大
的提高了移动电话支持游戏的能力。
本设计使用 设计了一个手机象棋游戏,使更了解 的特点, 的平台体系结构、
平台上各 的功能、 应用程序的生命周期和具体开发流程,以及 平台上的
蓝牙连接技术。我们采用团队协作,分工负责,成员具体承担的工作如下表所示:
序
号
学号 姓名 专业、班级 任务分配
霍小伟 软件工程
组长
游戏逻辑部分的实现
余莉
计算机科学
与技术
界面,整体布局的实现
吴金晶
信息与计算
科学
游戏通信的实现
目 录
1 引言...............................................................................................................................................................1
1.1 手机游戏背景及现状.......................................................................................................................1
1.1.1 手机游戏的特征....................................................................................................................1
1.1.2 手机游戏的类型....................................................................................................................2
1.2 行业动态与展望...............................................................................................................................2
1.3 论文结构...........................................................................................................................................2
2 J2ME 技术概述............................................................................................................................................3
2.1 J2ME 体系架构.................................................................................................................................3
2.2 配置概述...........................................................................................................................................4
2.3 简表概述...........................................................................................................................................4
2.4 J2ME 目标设备.................................................................................................................................5
2.5 J2ME,J2SE 与 J2EE 之间的比较..................................................................................................5
3 开发环境及相关工具介绍...........................................................................................................................8
3.1 开发环境...........................................................................................................................................8
3.2 Java 语言的特点...............................................................................................................................8
3.3 关于 J2ME wireless Toolkit..............................................................................................................8
3.4 关于 Eclipse.......................................................................................................................................9
3.5 Java Application Manager.................................................................................................................9
3.6 开发环境的搭建...............................................................................................................................9
4 详细设计与相关技术................................................................................................................................13
4.1 程序的流程和要解决的问题.........................................................................................................13
4.2 类结构设计.....................................................................................................................................14
4.3 MIDlet 的 生命周期........................................................................................................................17
4.4 深入了解 MIDP 规范......................................................................................................................19
4.5 蓝牙连接技术.................................................................................................................................19
4.6 游戏在不同手机上的兼容性问题.................................................................................................21
4.7 内存的优化.....................................................................................................................................21
4.8 内存监视器.....................................................................................................................................21
4.9 关于混淆器.....................................................................................................................................22
5 程序分析和具体实现................................................................................................................................23
5.1 棋局表示和走法规则的实现.........................................................................................................23
5.2 搜索算法..........................................................................................................................................26
5.3 棋局的评估和走法产生器.............................................................................................................30
5.4 实现人机对弈..................................................................................................................................35
6 结束语.........................................................................................................................................................35
致 谢..............................................................................................................................................................36
参考文献........................................................................................................................................................36
基于技术的手机游戏研究与实现
霍小伟
(重庆三峡学院数学与计算机科学学院软件工程专业 级 重庆万州 )
摘要:( ,微型平台)是!"#公司推出的为了解决
在不同移动终端上运行相同的$应用,也是被广泛使用在手机上的第一代智能开发平台。本系
统将通过设计开发一款蓝牙联网象棋游戏来学习和掌握基于技术的手机游戏软件开发,本毕
业设计将完成以下内容:
一、了解和掌握相关技术,包括的特点、的平台体系结构、平台上各
的功能、应用程序的生命周期和具体开发流程,以及平台上的蓝牙连接技术。
二、实现了象棋游戏的基本功能,包括棋子与棋盘的创建,选择和移动棋子等功能。
三、实现了蓝牙连接功能,通过创建服务端建立游戏,使客户端能搜索到游戏并加入游戏,在
游戏中保持服务端与客户端的通信。
四、精心设计了游戏的界面,实现了功能菜单的调用,为用户提供友好的提示信息,并为游戏
提供良好的异常处理,例如断线重连等功能。
关键词:技术;手机游戏; 蓝牙连接技术
Mobile games based on J2ME technology research and implementation
HUO Xiao-wei
(Grade 2006, Software Engineering, College of Mathematics and Computer Science,
Chongqing Three Gorges University ,Wanzhou, Chongqing 404000)
Abstract:J2ME is that Sun Microsystems promotes in order to solve in the different mobile device
running the same JAVA application, also is the first generation of intelligence develops the platform.
The graduation project will study and grasping based on the J2ME technology handset game software
development by designing to develop a section bluetooth networking Chinese chess game, the graduation
project process does the work to be as follows:
First, understood and grasps the J2ME related technology, including J2ME characteristic, J2ME
platform architecture, in J2ME platform each API function, MIDlets application procedure life cycle and
concrete development flow, as well as in J2ME platform bluetooth connection technology.
Second, has realized the Chinese chess game basic function, including chessman and chessboard
foundation, choice and motion chessman, and so on the functions.
Third, has realized the bluetooth connection function, through foundation service end establishment
game, enables the client side to search plays and joins the game, maintains the service end and the client
side correspondence in the game.
Fourth, has designed the game contact surface carefully, has realized the function menu transfer,
provides the friendly prompt information for the user, and provides the good exception handling for the
game, for example the broken line heavy company waits for the function.
Key words: J2ME Technology; handset games; Bluetooth connectivity