基于J2ME的手机五子棋游戏的设计与实现

摘  要:J2ME(Java 2 Micro Edition)是近年来随着各种不同设备,尤其是移动通信设备的飞速发展而诞生的一项开发技术。它因其“write once,run anywhere”的Java特性而提高了开发的效率。随着手机性能的不断提高,手机休闲娱乐应用将成为PC休闲娱乐应用之后又一重要业务增长点。棋类游戏规则单一,比较适合在手机等便携终端推广。

由于具有跨平台、易于移植、占用空间小的优势,J2ME成为移动应用开发平台的主流,并提供了很多用以支持移动应用软件的开发的API。现将该技术用于这次的手机游戏开发,可以实现游戏的快速开发,不但便于查看游戏运行过程中内存的占用量和程序的每一部分代码消耗了多少处理器时间,而且可以不断地优化代码,使代码具有高度的复用性、可扩展性、可维护性。

游戏的开发以J2ME为平台,利用Java技术,结合J2ME的MIDP技术,并对于程序设计思想,重要类、方法等展开讨论。在对弈部分,分析设计走棋算法,选择合适的方式组织成代码,实现基本的人工智能。过程中使用了J2ME中的CLDC/MIDP软件体系,主要运用了MID Profile的特定类的支持,来完成游戏的开发。

 

关键词:J2ME;CLDC;MIDP

 

 

 

Design and Implementation of Gobang Cell-phone Game

Based on J2ME

Abstract: J2ME is a kind of fast developing technology implemented on various devices especially mobile communication equipments. It improves the efficiency of the development process because of its “write once, run anywhere” nature. The development trend of the entertainment market based on the cell phone is very obvious because the handset performance enhances unceasingly. The entertainment market based on the cell phone will to be the new important business growth point follow the PC entertainment market. As the rules of a single chess game, it is more suitable for mobile phones and other portable terminal extension.

J2ME has been the preferred platform for development because of its platform independent and compatibility, and provides a lot of APIs to support the development of mobile application software. The technology for mobile game development, can achieve the rapid development of the game. It is not only easy to observe the memory consumption and processor consumed time during the operation of the game, but also can optimize the code, so that the code has a high degree of reusability, scalability, maintainability.

The game has designed by J2ME, the Java technology and the MIDP technology. I studied the procedure thought, the important class and the method. In the playing chess part, I have analyzed the algorithm, choosed the appropriate way to organize the code and realized the basic artificial intelligence. On the other hand, I learned software system of CLDC/MIDP and the specific class of the MID Profile to complete the game development.

 

Key words: J2ME;CLDC;MIDP

 

 

   

1 概述……………………………………………………….. 1

1.1 课题研究背景………………………………………………. 1

1.2 课题研究意义………………………………………………. 2

2 开发技术背景………………………………………………… 2

2.1 JAVA语言概述……………………………………………… 2

2.2 J2ME简介…………………………………………………. 3

2.3 J2ME的体系结构……………………………………………. 4

2.4 移动信息设备简表…………………………………………… 7

2.5 开发平台………………………………………………….. 8

3 系统分析及总体设计…………………………………………… 9

3.1 可行性分析………………………………………………… 9

3.2 需求分析………………………………………………….. 9

3.3 系统概要设计……………………………………………… 10

4 系统详细设计……………………………………………….. 13

4.1 界面设计…………………………………………………. 13

4.2 走棋算法…………………………………………………. 27

4.3 胜负判断…………………………………………………. 29

5 系统测试…………………………………………………… 30

5.1 测试方案…………………………………………………. 30

5.2 测试结果…………………………………………………. 30

6 结 束 语…………………………………………………… 35

参考文献…………………………………………………….. 36

致    谢…………………………………………………….. 37

附    录…………………………………………………….. 38

附录1 程序清单………………………………………………. 38

附录1.1 StartGame.java程序清单………………………………… 38

附录1.2 Chesses.java程序清单………………………………….. 39

附录1.3 Chessboard.java程序清单……………………………….. 44

附录1.4 其它程序清单…………………………………………. 49

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。

最常见的情况是下载不完整: 可对比下载完压缩包的与网盘上的容量,若小于网盘提示的容量则是这个原因。这是浏览器下载的bug,建议用百度网盘软件或迅雷下载。 若排除这种情况,可在对应资源底部留言,或联络我们。

对于会员专享、整站源码、程序插件、网站模板、网页模版等类型的素材,文章内用于介绍的图片通常并不包含在对应可供下载素材包内。这些相关商业图片需另外购买,且本站不负责(也没有办法)找到出处。 同样地一些字体文件也是这种情况,但部分素材会在素材包内有一份字体下载链接清单。

如果您已经成功付款但是网站没有弹出成功提示,请联系站长提供付款信息为您处理

源码素材属于虚拟商品,具有可复制性,可传播性,一旦授予,不接受任何形式的退款、换货要求。请您在购买获取之前确认好 是您所需要的资源