VC++电脑游戏飞机大战的开发与设计(含源文件) 联系客服

发布时间 : 星期日 文章VC++电脑游戏飞机大战的开发与设计(含源文件)更新完毕开始阅读8e11ddefaf45b307e971974d

毕业设计(论文)

题 目:学 院:

飞机大战游戏的设计与开发

计算机科学学院

摘 要

飞机游戏是一款风靡全球的电视机游戏和掌上游戏机产品,曾几何时,它创造了一个无法企及的游戏巅峰,也曾影响了一代产业链。虽然它辉煌的业绩在历史的涡轮中渐渐远去,但这款游戏每每提及,总会令人爱不释手,魂牵梦绕。 这款游戏的名字叫做飞机大战,它是运行于Windows操作系统下的一款2D游戏,以C/C++为开发语言,构建于Microsoft Foundation Class Library(MFC)框架体系中,其中调用了部分的Win32API函数接口,在Visual Studio2010环境下开发的一款多媒体游戏。

随着硬件性能的不断提高,游戏的日益普及,使开发者不再需要过多的关注不同的硬件设备。本论文着眼于双缓冲绘图的运用,开发出仅用于理论研究的二维平面射击类游戏。

本文首先分析了电脑游戏的发展历史,然后分析了制作游戏的基本流程和游戏本身所要包含的几种元素以及游戏应具备的游戏层次。根据2D游戏的特点和游戏的角色,以及给用户呈现的游戏界面的特效,对2D图形技术,Windows 图形界面编程技术GDI,DirectDraw的显卡接口和DirectSound声卡接口以及MVC设计模式下的MFC框架等技术进行了比较仔细的研究。通过自定义一个游戏类CGame,封装了游戏元素的基本属性和行为,这样便于在用到游戏的行为操作是,只要轻松的产生CGame对象便可直接调用其方法,也有利于升级为双人游戏,乃至网络版时,只需要在该类中添加相应的行为便可。当我们向用户呈现游戏运行的界面时,通过Timer时钟控件,映射到相应的处理函数,使得游戏界面大约每2秒钟刷新一下界面,这样才能让一张位图背景图片具有动态效果。当使用DirectSound声卡接口时,我方和敌方相互射击所发出的声音,都是在时钟映射函数调用时处理的。

【关键词:】C/C++; VS 2010/MFC; 飞机大战游戏

I

ABSTRACT

Airplane game is a popular global TV game and handheld game products, once upon a time, it creates a game out of reach peak, have influenced a generation of industrial chain. Although it brilliant performance in the history of turbine faded away, but the game is often mentioned always miss.

The game's name is , it is running on Windows operating systems, a 2 d game, with C/C + + as development language, building on the Microsoft Foundation Class Library MFC framework, which invokes the part Win32API function interface, in the Visual Studio 2010 environment using DirectX software development kit SDK to develop a multimedia game.

With the constant improvement of the hardware performance, the rising popularity of the game, DirectX development kit update and perfect, make developers don't need too much attention to different hardware devices. The use of this thesis focus on DirectSound, DirectDraw, developed only due to the theoretical research of two-dimensional plane shooting game.

This article first analyzes the development history of computer games, and then analyze the basic process of making game and the game itself need to include what kind of elements and the game should have level. According to the characteristics of the 2 d game and game role, and to the user interface rendering effects, the technology of 2 d graphics, the graphics interface and DirectSound DirectDraw sound card interface and MFC framework of MVC design mode to compare the careful research. Through a custom game CGame class, encapsulates the basic attribute of game elements and behavior, so easy to use in the game operation, as long as easy to produce the CGame object can be directly to call its methods, but also to when upgraded to a double game, online version, just need to add the proper behavior in the class. When we present game operation interface to the user, by the Timer clock control that is mapped to the corresponding processing function, makes the game about every 2 seconds refresh interface, in this way can we make a bitmap background picture with dynamic effect. When using DirectSound sound card interface, we and the noise made by enemy fire, are on the clock whenprocessing the mapping function call.

KEY WORDS: C/C + +; VS 2010/MFC; plane war game

II

目 录

第1章 绪论........................................................ 1

1.1 系统研究的背景及意义........................................ 1 1.2 国内外的发展现状............................................ 1 1.4 本文的组织结构.............................................. 2 1.5 本章小结.................................................... 2 第2章 游戏的相关知识和系统开发平台的阐述........................... 3

2.1游戏基本流程概述 ............................................ 3 2.2游戏系统元素阐述 ............................................ 4 2.3开发环境和相关技术的概述 .................................... 5

2.3.1 开发环境.............................................. 5 2.3.2 相关技术.............................................. 5 2.4本章小结 ................................................... 10 第3章 游戏分析................................................... 11

3.1 用户功能需求分析........................................... 11 3.2 系统性能要求............................................... 12 3.3可行性分析 ................................................. 12 3.4本章小结 ................................................... 13 第4章 游戏设计................................................... 14

4.1游戏整体设计 ............................................... 14

4.1.1 整体结构............................................. 14 4.1.2 游戏对战规则......................................... 14 4.2游戏界面设计 ............................................... 15

4.2.1游戏起始界面设计 ..................................... 15 4.2.2游戏运行界面设计 ..................................... 17 4.2.3游戏结束界面设计 ..................................... 18 4.3游戏功能设计 ............................................... 19

4.3.1双缓冲绘图 ........................................... 19 4.3.2功能实现 ............................................. 19 4.4本章小结 ................................................... 26 第5章 系统测试................................................... 27

5.1软件测试基础理论 ........................................... 27

I