毕 业 设 计(论 文)
题 目: 支持蓝牙的手机游戏的分析与设计
学 院: 信息管理学院
专 业: 信息管理与信息系统
学生姓名: 刘勇 班级/学号
指导老师/督导老师:
起止时间:
年
月
日 至
年
月
日
摘要
摘 要
近年来,随着手机的普及,手机游戏市场得到了爆炸式的发展。现今,支持
、支持蓝牙几乎成了手机的标准配置,这也导致了蓝牙手机游戏的迅速出现。
本文以基于 平台的蓝牙手机游戏的功能开发为线索,在进行了相关理论研
究的基础上,实现了一款支持蓝牙的手机游戏。此游戏属于棋类游戏,可以满足玩家
的双方对战的需要,游戏分为两个阶段,第一阶段可以进行通过增加棋子来对战,第
二阶段在现有棋子的基础上通过走棋来对战。在本论文中详细地介绍了游戏的流程、
蓝牙应用模式、蓝牙通信、类的设计及界面重绘的设计;重点解决了游戏状态的表示、
蓝牙的连接通信及对游戏按键事件的处理。本课题选用了大部分手机支持的 做为
开发语言, 公司的 加入了移动开发包为开发工具来实现。
关键词: ; ; 蓝牙; 手机游戏; ;
Abstract
Abstract
In recent years, with the popularity of mobile phones, the mobile gaming market has had
explosive development. Today, supporting JAVA and Bluetooth has become mobile phone’s
standard layout nearly, which also leads to rapidly emerging of Bluetooth mobile phone
games.
this paper, with clues of function development of Bluetooth mobile phone games based
on the J2ME platform , bases on relevant theoretical research ,and achieves a mobile phone
game supporting Bluetooth. This game is a kind of chess games, it can meet needs of versus
for both sides. It is divided into two phases, in the first phase you can fight by increasing your
pawns , in the second phase you can fight by moving a pawn on the basis of your existing
pawns. In this paper, the game's flow bluetooth application mode, bluetooth
communications,class design and interface redrawing are introduced in detail.While it focuses
on solving condition presentation of the game, bluetooth connectivity and communication and
key events for the game. The topic chooses java as development language which the majority
of mobiles support , and SUN's NetBeans IDE as development tool (the mobile development
kit is join) to achieve the game.
Keywords: J2ME; JAVA ME; Bluetooth; Mobile phone games; NetBeans;
目录
目 录
毕 业 设 计(论 文)......................................................................46
摘 要........................................................................................... I
ABSTRACT.................................................................................II
第一章 引言..................................................................................1
1.1 国内外手机游戏的研究现状......................................................................................................................1
1.2 蓝牙应用的现状......................................................................................................................................... 1
1.3 手机游戏的技术分类..................................................................................................................................2
1.4 手机游戏应用现状..................................................................................................................................... 3
1.5 研究意义..................................................................................................................................................... 3
第二章 开发技术基础........................................................................5
2.1J2ME 平台简介............................................................................................................................................. 5
2.1.1
什么是
J2ME...........................................................................................................................................5
2.1.2 J2ME
平台体系结构
...............................................................................................................................5
2.1.3 KVM.........................................................................................................................................................6
2.1.4 CLDC........................................................................................................................................................6
2.1.5
移动信息设备描述
(MIDP).....................................................................................................................7
2.1.6 MIDP
应用程序
......................................................................................................................................7
2.1.7 MIDP UI
组件
..........................................................................................................................................8
2.2 手机游戏的画面......................................................................................................................................... 9
2.3 手机游戏中的按键.................................................................................................................................... 10
2.4 线程使用................................................................................................................................................... 11
2.5 手机硬件平台特点.................................................................................................................................... 11
2.6 手机游戏开发工具软件............................................................................................................................11
2.7J2ME 蓝牙...................................................................................................................................................12
2.8J2ME 蓝牙开发的基本原理.......................................................................................................................12
2.8.1 Java
蓝牙
API........................................................................................................................................12
2.8.2
堆栈初始化
..........................................................................................................................................12
2.8.3
设备管理
..............................................................................................................................................13
2.8.4
设备发现
..............................................................................................................................................13
2.8.5
服务发现
..............................................................................................................................................13
2.8.6
蓝牙通讯
..............................................................................................................................................13
第三章 游戏的分析.........................................................................14
3.1 游戏描述................................................................................................................................................... 14
3.2 可行性研究............................................................................................................................................... 14
3.3 游戏流程................................................................................................................................................... 14
3.4 游戏总体类图........................................................................................................................................... 16
3.5 线程模块图............................................................................................................................................... 16
第四章 游戏的设计.........................................................................18
4.1 蓝牙应用程序用例.................................................................................................................................... 18
4.2 蓝牙设备和服务发现................................................................................................................................ 19
4.2.1
设备发现
..............................................................................................................................................19
4.2.2
服务发现
..............................................................................................................................................20
目录
4.3 蓝牙通信................................................................................................................................................... 21
4.4 服务器与客户端的连接............................................................................................................................21
4.5 类的设计................................................................................................................................................... 21
4.6 游戏状态的设计....................................................................................................................................... 26
4.7 画布重绘的设计....................................................................................................................................... 26
第五章 游戏的实现.........................................................................27
5.1 开发平台................................................................................................................................................... 27
5.2 程序打包、下载安装与运行.................................................................................................................... 27
5.3 最后效果图及主要代码............................................................................................................................ 27
第六章 结束语..............................................................................35
参考文献....................................................................................36
评论1