基于JAVA的贪吃蛇手机游戏开发

以下是资料介绍,如需要完整的请充值下载. 本资料已审核过,确保内容和网页里介绍一致.  
无需注册登录,支付后按照提示操作即可获取该资料.
资料介绍:

基于JAVA的贪吃蛇手机游戏开发(8800字)
摘要:随着通信技术的发展和手机的普及,手机游戏的开发技术越来越为人们所关注。以J2ME为开发平台,利用JAVA提供强大工具,不但可以在手机上实现静态HTML技术所无法实现的计算处理、数据存储、与服务器的通信等功能,而且能够开发各种手机游戏。本文在介绍J2ME及其体系结构的基础上,以贪吃蛇游戏为实例,描述了借助J2ME的MIDlet类库开发手机游戏的过程。
关键词:手机游戏; MIDP应用程序; 永久性数据

Develops based on the J2ME handset game
Abstract: Along with communication development and handset popularization, people more and more pay attention to the handset game development technology. Develops the platform take J2ME, provides the powerful tool using JAVA, not only may realize the handset functions that static HTML technology be unable to realize, such as computation processing, data storage, and communication with server, but also can develop all kinds of handset games. On the basis of the technology and architecture of J2ME being introduced, the gluttonous snake game was taken as a example, the development process of handset game with the aid of the J2ME MIDlet class library is described in this article.
Key Words: Handset game; MIDP application pragram;  Permanent data

研究内容
本课题拟研究基于J2ME的手机游戏开发技术以及其特点,具体研究内容如下:
1、手机游戏开发以及J2ME的基本理论和J2ME类库的使用;
2、J2ME体系结构的研究;
3、MIDP移动信息设备简表的研究;
     (1)、MIDP的目标硬件环境;
(2)、MIDP应用程序;
     (3)、CLDC和MIDP库中的类。
4、J2ME API的研究;
  (1)MIDlet应用程序的研究;
  (2)MIDlet的类库研究;
  (3)各事件发生器的应用。

贪吃蛇游戏的规则简介
在贪吃蛇游戏中,玩家操作由小方块连接而成的蛇,去吃随机散落在画面内的小方块,每吃一块就增加一小方块长度,要是撞壁以及撞自己的尾,就属于失败,如无失败则直到通关为止。
屏幕的长度的行向为11单位,纵向为18单位。在这个范围内,玩家通过操作方向键来控制蛇的运动方向。该游戏的最大特色是屏幕自适应,无论各种手机,PDA的屏幕大小如何,该游戏总是能获得最佳的显示效果。

详细设计
本游戏的操作流程(如图3-1):用户在启动MIDlet后,即进入游戏主画面,屏幕开始显示为欢迎画面。用户按下[开始]按钮后,就可以开始玩游戏。当用户想暂停时,再次按一下[开始]按钮,游戏就暂停了,在暂停的情况下再按[开始]按钮,游戏继续运行。任何时候按[退出]按钮,游戏MIDlet都会终止。
 

基于JAVA的贪吃蛇手机游戏开发
基于JAVA的贪吃蛇手机游戏开发
基于JAVA的贪吃蛇手机游戏开发
基于JAVA的贪吃蛇手机游戏开发


目  录
第一章 绪论    1
1.1 研究背景    1
1.2 研究内容    1
第二章 J2ME及其体系结构概述    2
2.1 J2ME简介    2
2.2 J2ME 体系结构    2
2.3 移动信息设备简表概述    3
2.3.1 MIDP的目标硬件环境    3
2.3.2  MIDP应用程序    3
2.3.3  CLDC和MIDP库中的类    3
2.4 J2ME API简介    4
2.4.1  MIDP API概述    4
2.4.2  MIDlet应用程序    4
2.4.3 使用定时器    5
2.4.4  网络    6
2.4.5  使用Connector    7
2.4.6 使用HttpConnection    8
2.4.7 永久性数据(RMS)    9
2.4.8 存储集(Record Store)    10
2.4.9  记录    11
2.4.10 枚举    12
2.4.11  异常    13
2.5 用户界面(LCDUI    13
2.5.1 UI基础    13
2.5.2 高级UI    14
2.5.3  低级UI    15
第三章 手机游戏开发过程    16
3.1 贪吃蛇游戏的规则简介以及开发环境    16
3.1.1 贪吃蛇游戏的规则简介    16
3.1.2 开发环境    16
3.2  详细设计    16
3.2.1 代码设计    17
第四章 程序的调试与运行    22
4.1游戏的调试    22
4.2 游戏的运行环境    23
第五章  总结    24
致    谢    25
参考文献    25