项目报告
基于 Java 的飞机大战游戏的设计与实现
现如今,随着智能手机的兴起与普及,加上 4G(the 4th
Generation mobile communication ,第四代移动通信技术)网络的
深入,越来越多的 IT 行业开始向手机行业转移重心。而手机行业
中游戏方面的利润所占比重较大,并且手机游戏大多数则是由
Java 语言开发研制的。所以我想顺应时代发展,用学到的 Java 知
识对游戏进行一次深入的了解与创作。
Java 语言在我们大学学习中占了很大的比重,其优点甚多:
面向对象,可靠,安全,多平台可移植,高性能,多线程等。面
向对象是相对于 c 语言的面向过程来说的,在面向对象编程中,
我们用 Java 去新建一个对象,调用其方法就能实现我们的目标,
并不需要了解这个对象的方法的具体实现过程;Java 的可靠安全
特点体现 Java 不支持指针,禁止第三方访问,杜绝了外部风险。
所以使用 Java 开发游戏,是一个正确的选择。
大学学习即将结束,在毕业之际,我想用我 4 年里学习的知
识为自己编写一个属于自己的游戏——飞机大战游戏,为我的大
学生活画上圆满的句号。
关键词:Java 游戏;面向对象;可靠安全;多线程
Design And Implementation Of Airplane Wargame
Based On Java
Abstract
Nowadays, with the emergence and popularization of smart
phones, plus 4 g (the 4 th Generation mobile communication, the
fourth Generation mobile communication technology) the
development of the Internet, more and more in the IT industry began
to shift to the mobile phone industry center of gravity. Aspect of the
game of the mobile phone industry profits account for a large
proportion, and most mobile game is developed by Java language. So
I want to keep up with the development of The Times, use Java
knowledge for an in-depth understanding of the game and creation.
Java language learning in our universities accounted for a large
proportion of its many advantages: Object-oriented, reliable, secure,
multi-platform portable, high-performance, multi-threading.
Object-oriented process-oriented with respect to the terms of the c
language, object-oriented programming, specifically we use Java to
create a new object, call its methods will be able to achieve our goal,
we do not need to know the object's method of implementation ;
reliable safety features reflect Java Java does not support pointers to
prohibit third-party access, to eliminate the external risk. Therefore,
the use of Java development aircraft war game, is the right choice.
University coming to an end, on the occasion of the graduation, I
want to use my four years studying knowledge and made themselves
a game of their own - Aircraft war game for my college life painting
satisfactory conclusion.
Keywords: Java game; object oriented; reliable and secure;
multi thread
目 录
1 引言..............................................................................................................................1
1.1 项目背景..........................................................................................................1
1. 2 国内外研究现状..............................................................................................3
1.3 项目主要工作..................................................................................................4
1.4 本文组织结构..................................................................................................6
2 开发平台与开发技术..................................................................................................7
2. 1 IntelliJ IDEA 简介 ...........................................................................................7
2. 2 IntelliJ IDEA 与 Eclipse 、MyEclipse 的比较..............................................8
2. 3 Java.................................................................................................................10
3 可行性研究................................................................................................................13
3. 1 技术可行性....................................................................................................13
3. 2 经济可行性....................................................................................................13
3. 3 操作可行性....................................................................................................14
3. 4 用户使用可行性............................................................................................14
3. 5 法律可行性....................................................................................................14
4 需求分析....................................................................................................................15
4. 1 系统需求概述................................................................................................16
4. 2 功能模块设计................................................................................................17
4.2.1 游戏状态控制功能模块......................................................................17
4.2.2 游戏难度的调整模块..........................................................................17
4.2.3 游戏界面绘画功能模块......................................................................17
4.2.4 玩家游戏控制功能模块......................................................................17
4. 3 游戏难点分析................................................................................................18
4.3.1 绘图美化..............................................................................................18
4.3.2 多线程技术的实现..............................................................................18
4.3.3 防碰撞问题的解决..............................................................................18
4.3.4 动画的实现..........................................................................................18
5 飞机大战功能实现....................................................................................................19
5.1 模型图.............................................................................................................19
5.2 软件功能模块.................................................................................................19
5.3 游戏首页的实现.............................................................................................20
5.3.1 界面实现..............................................................................................20
5.3.2 流程图..................................................................................................21
5.3.3 核心代码..............................................................................................22