飞机大战游戏 模块设计报告.docx
- 文档编号:894071
- 上传时间:2023-04-30
- 格式:DOCX
- 页数:12
- 大小:40.18KB
飞机大战游戏 模块设计报告.docx
《飞机大战游戏 模块设计报告.docx》由会员分享,可在线阅读,更多相关《飞机大战游戏 模块设计报告.docx(12页珍藏版)》请在冰点文库上搜索。
飞机大战游戏模块设计报告
飞机大战游戏
模块设计报告
0.文档介绍
0.1文档目的
指导模块编码人员编码。
0.2文档范围
模块功能介绍及实现要求
0.3读者对象
模块编码人员
0.4参考文献
0.5术语与缩写解释
缩写、术语
解释
1.模块命名规则
2.模块汇总
2.1模块汇总表
游戏规则子系统
模块名称
功能简述
人工智能
人机对战规则的实现
游戏子系统
模块名称
功能简述
应用程序对象
游戏程序的加载、游戏对象的绘制、游戏规则的调用、玩家的键盘事件获取
游戏对象
各个游戏对象的抽象父类
战机对象
战机类
敌机对象
敌机类
导弹对象
导弹类
炸弹对象
炸弹类
爆炸对象
爆炸类
文字对象
文字类
2.2UML活动图
2.3类体系
3.游戏规则子系统
模块名称
人工智能
功能描述
人机对战规则规则
接口与属性
voidAI(void);
数据结构
与算法
//随机产生敌机
//检测四个方向键,移动战机
//产生战机导弹、炸弹
//碰撞检测
补充说明
4.3游戏对象子系统
模块名称
应用程序对象
功能描述
游戏程序的加载、游戏对象的绘制、游戏规则的调用、玩家的键盘事件获取
接口与属性
CPlaneGameg_Game;
数据结构
与算法
classCPlaneGame
{
public:
virtualvoidOnDraw(CDC*pDC);//重写以绘制该视图
protected:
//内存DC
CDC*m_pMemDC;
//设备DC
CClientDC*m_pDC;
//内存位图
CBitmap*m_pMemBitmap;
protected:
//初始化游戏
BOOLInitGame();
//结束游戏
voidStopGame();
//刷新游戏的帧画面
voidUpdateFrame(CDC*pMemDC);
voidAI();
//获得键的状态1->down
intGetKey(intnVirtKey)
{
return(GetKeyState(nVirtKey)&0x8000)?
1:
0;
}
CMyPlane*m_pMe;
CObListm_ObjList[4];//用链表来管理游戏对象
};
补充说明
4.2游戏对象
模块名称
游戏对象
功能描述
各个游戏对象的抽象父类
接口与属性
数据结构
与算法
//游戏对象的父类
classCGameObject:
publicCObject
{
public:
CGameObject(intx=0,inty=0);
virtual~CGameObject();
//绘制对象
virtualBOOLDraw(CDC*pDC,BOOLbPause)=0;
//获得矩形区域
virtualCRectGetRect()=0;
//获得左上角坐标
CPointGetPoint()
{
returnm_ptPos;
}
protected:
//加载图像
staticBOOLLoadImage(CImageList&imgList,UINTbmpID,COLORREFcrMask,intcx,intcy,intnInitial);
protected:
//物体的位置
CPointm_ptPos;
};
补充说明
4.3战机对象
模块名称
战机对象
功能描述
战机类,战机图像加载、贴图、位置存储
接口与属性
CMyPlane*m_pMe;
数据结构
与算法
classCMyPlane:
publicCGameObject
{
public:
CMyPlane(void);
~CMyPlane(void);
BOOLDraw(CDC*pDC,BOOLbPause);
staticBOOLLoadImage();
voidSetHorMotion(intnMotion)
{
m_nHorMotion=nMotion;
}
intGetHorMotion()const
{
returnm_nHorMotion;
}
voidSetVerMotion(intnMotion)
{
m_nVerMotion=nMotion;
}
intGetVerMotion()const
{
returnm_nVerMotion;
}
CRectGetRect()
{
returnCRect(m_ptPos,CPoint(m_ptPos.x+PLANE_WIDTH,m_ptPos.y+PLANE_HEIGHT));
}
//是否可以开火发射导弹
BOOLFired();
public:
staticconstintPLANE_WIDTH=50;
staticconstintPLANE_HEIGHT=60;
private:
staticCImageListm_Images;
intm_nHorMotion;//飞机水平运行方向0->静止,1->右-1->左
intm_nVerMotion;//飞机垂直运行方向0->静止,1->上-1->下
intm_nWait;//发射延时
};
补充说明
4.4敌机对象
模块名称
敌机对象
功能描述
图像加载、贴图、位置存储
接口与属性
newCEnemy
数据结构
与算法
classCEnemy:
publicCGameObject
{
public:
CEnemy(void);
~CEnemy(void);
BOOLDraw(CDC*pDC,BOOLbPause);
staticBOOLLoadImage();
CRectGetRect()
{
returnCRect(m_ptPos,CPoint(m_ptPos.x+ENEMY_HEIGHT,m_ptPos.y+ENEMY_HEIGHT));
}
intGetMontion()const
{
returnm_nMotion;
}
//是否可以开火发射子弹
BOOLFired();
private:
staticconstintENEMY_HEIGHT=35;
staticCImageListm_Images;
intm_nMotion;//方向1->向下0->停止-1->向上
//图像索引
intm_nImgIndex;
//速度
intm_V;
intm_nWait;//发射延时
};
补充说明
4.5导弹对象
模块名称
导弹对象
功能描述
图像加载、贴图、位置存储
接口与属性
newCBomb
数据结构
与算法
classCBomb:
publicCGameObject
{
public:
CBomb(intx,inty);
~CBomb(void);
BOOLDraw(CDC*pDC,BOOLbPause);
staticBOOLLoadImage();
CRectGetRect()
{
returnCRect(m_ptPos,CPoint(m_ptPos.x+10,m_ptPos.y+BOMB_HEIGHT));
}
private:
staticconstintBOMB_HEIGHT=20;
staticCImageListm_Images;
};
补充说明
4.6炸弹对象
模块名称
炸弹对象
功能描述
图像加载、贴图、位置存储
接口与属性
newCBall;
数据结构
与算法
classCBall:
publicCGameObject
{
public:
CBall(intx,inty,intnMontion);
~CBall(void);
BOOLDraw(CDC*pDC,BOOLbPause);
staticBOOLLoadImage();
CRectGetRect()
{
returnCRect(m_ptPos,CPoint(m_ptPos.x+BALL_HEIGHT,m_ptPos.y+BALL_HEIGHT));
}
private:
staticconstintBALL_HEIGHT=8;
staticCImageListm_Images;
intm_nMotion;
};
补充说明
4.7爆炸对象
模块名称
爆炸对象
功能描述
图像加载、贴图、位置存储
接口与属性
newCExplosion;
数据结构
与算法
classCExplosion:
publicCGameObject
{
public:
CExplosion(intx,inty);
~CExplosion(void);
BOOLDraw(CDC*pDC,BOOLbPause);
staticBOOLLoadImage();
CRectGetRect()
{
returnCRect(m_ptPos,CPoint(m_ptPos.x+EXPLOSION_WIDTH,m_ptPos.y+EXPLOSION_WIDTH));
}
private:
//炸弹的图片列表
staticCImageListm_Images;
//图像索引的步进计数
intm_nProcess;
public:
staticconstintEXPLOSION_WIDTH=66;
};
补充说明
4.4文字对象
模块名称
文字对象
功能描述
图像加载、贴图、位置存储
接口与属性
newCText;
数据结构
与算法
classCText:
publicCGameObject
{
public:
CText(intx,inty);
~CText(void);
BOOLDraw(CDC*pDC,BOOLbPause);
CRectGetRect()
{
returnCRect(m_ptPos,CPoint(m_ptPos.x,m_ptPos.y));
}
};
补充说明
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 飞机大战游戏 模块设计报告 飞机 大战 游戏 模块 设计 报告