Commit c1fa510f authored by CjhGm's avatar CjhGm
Browse files

small fix

parent 9989a700
......@@ -211,14 +211,11 @@ void CAircraftBattleView::OnTimer(UINT_PTR nIDEvent)
const int space = 30, off = 180;
cdc.TextOutW(rect.right / 2 - off, 210 + space, _T("方向控制:方向键、ASDW、鼠标"));
cdc.TextOutW(rect.right / 2 - off, 210 + 2 * space, _T("射击:空格键、鼠标左键"));
cdc.TextOutW(rect.right / 2 - off, 210 + 3 * space, _T("暂停:Z键"));
cdc.TextOutW(rect.right / 2 - off, 210 + 4 * space, _T("大招:X键"));
cdc.TextOutW(rect.right / 2 - off, 210 + 5 * space, _T("防护罩:C键"));
cdc.TextOutW(rect.right / 2 - off, 210 + 6 * space, _T("战机升级:V键"));
cdc.TextOutW(rect.right / 2 - off, 210 + 7 * space, _T("无敌模式:Y键"));
cdc.TextOutW(rect.right / 2 - off, 210 + 8 * space, _T("初始生命值:10"));
cdc.TextOutW(rect.right / 2 - off, 210 + 9 * space, _T("初始魔法值:0"));
cdc.TextOutW(rect.right / 2 - off, 210 + 10 * space, _T("敌机生命值:2"));
cdc.TextOutW(rect.right / 2 - off, 210 + 3 * space, _T("暂停:Q键"));
cdc.TextOutW(rect.right / 2 - off, 210 + 4 * space, _T("战机升级:V键"));
cdc.TextOutW(rect.right / 2 - off, 210 + 5 * space, _T("无敌模式:Y键"));
cdc.TextOutW(rect.right / 2 - off, 210 + 6 * space, _T("初始生命值:10"));
cdc.TextOutW(rect.right / 2 - off, 210 + 7 * space, _T("敌机生命值:2"));
cdc.TextOutW(rect.right / 2 - off, 210 + 11 * space, _T("消灭一个敌机加1分,如果分数达到要求即可进入Boss模式,打赢Boss即可进入下一关。"));
cdc.TextOutW(rect.right / 2 - off, 210 + 12 * space, _T("魔法值随着游戏进程增加,可通过使用魔法值使用防护罩、战机升级、战机大招的使用。"));
cdc.TextOutW(rect.right / 2 - off, 210 + 13 * space, _T("游戏过程中会有一定程度的血包出现以恢复生命值。"));
......
#include "StdAfx.h"
#include "Scene.h"
//场景类实现
CScene::CScene(void)
{
}
CScene::~CScene(void)
{
}
//初始化场景
bool CScene::InitScene()
{
bool CScene::InitScene() {
//加载开始图片
this->images[0].Load(_T("image\\start.bmp"));
CString str;
......@@ -24,7 +15,7 @@ bool CScene::InitScene()
}
//开始为真, 背景起始坐标为0
this->isStart = TRUE;
this->isStart = true;
this->beginY = 0;
//播放背景音乐
......@@ -34,8 +25,7 @@ bool CScene::InitScene()
}
//绘制场景
void CScene::StickScene(CDC* pDC,int index, CRect rClient)
{
void CScene::StickScene(CDC* pDC, int index, CRect rClient) {
if (index == -1)
index = 0;
else
......@@ -44,12 +34,9 @@ void CScene::StickScene(CDC* pDC,int index, CRect rClient)
pDC->SetStretchBltMode(COLORONCOLOR);
//如果到了下边界, 回到起点
if (beginY >= rClient.Height())
{
if (beginY >= rClient.Height()) {
beginY = 0;
if (isStart)
isStart = FALSE;
isStart = false;
}
//客户区高度
......@@ -59,13 +46,11 @@ void CScene::StickScene(CDC* pDC,int index, CRect rClient)
rClient.top = beginY;
//如果是开始就绘制起始背景
if (isStart)
{
if (isStart) {
this->images[index].StretchBlt(*pDC, rClient, SRCCOPY);
}
//将下一张背景作为起始背景
else
{
else {
this->images[index].StretchBlt(*pDC, rClient, SRCCOPY);
}
......@@ -76,16 +61,14 @@ void CScene::StickScene(CDC* pDC,int index, CRect rClient)
}
//移动背景
void CScene::MoveBg()
{
void CScene::MoveBg() {
//移动背景
beginY += 1;
}
//释放内存资源
void CScene::ReleaseScene()
{
for (int i = 0; i <8; i++)
void CScene::ReleaseScene() {
for (int i = 0; i < 8; i++)
if (!images[i].IsNull())
images[i].Destroy();
......
......@@ -11,7 +11,7 @@ private:
CImage images[8];//滚动背景,0位为开始图片,1-7为七张不同的背景
int beginY;//背景的Y坐标
BOOL isStart;//是否开始
bool isStart;//是否开始
//成员函数
public:
......@@ -21,10 +21,6 @@ public:
void StickScene(CDC* pDC, int index, CRect rClient);//传入index-1表示输出开始图片
void ReleaseScene();//释放内存资源
//构造与析构
public:
CScene(void);
~CScene(void);
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment