📄 qiang.cpp
字号:
// Qiang.cpp: implementation of the Qiang class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "mqgGAME.h"
#include "Qiang.h"
#include "Zhuan.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Qiang::Qiang()
{
cr.left=5;
cr.top=25;
cr.right=555;
cr.bottom=125;
pZhuanx=new Zhuan;
}
Qiang::~Qiang()
{
}
void Qiang::IniQiang()
{
for(int i=0;i<4;i++)
for(int j=0;j<10;j++)
{
pZhuan[i][j]=new Zhuan(5+j*pZhuanx->w,25+i*pZhuanx->h);
pZhuan[i][j]->pBall=pGAME->pBall;
pZhuan[i][j]->pJFB=pGAME->pJFB;
pZhuan[i][j]->zt=1;
Zhuans.AddTail(*pZhuan[i][j]);
}
}
void Qiang::Draw(CDC *pDC)
{
if(Zhuans.IsEmpty()) return;
POSITION pos=Zhuans.GetHeadPosition();
while(pos!=NULL)
{
Zhuan l=Zhuans.GetNext(pos);
l.Draw(pDC);
}
}
void Qiang::IsZhuang()
{
if(Zhuans.IsEmpty()) return;
POSITION pos=Zhuans.GetHeadPosition();
POSITION pos_old=pos;
while(pos!=NULL)
{
Zhuan l=Zhuans.GetNext(pos);
l.IsZhuang();
if(l.zt==0)
{
/* Zhuan* z=new Zhuan;
z->zt=1;
z->pBall=pGAME->pBall;
z->pJFB=pGAME->pJFB;
z->cr.left=l.cr.left;
z->cr.top=l.cr.top;
z->cr.right=l.cr.right;
z->cr.bottom=l.cr.bottom;*/
Zhuans.RemoveAt(pos_old);
//Zhuans.AddTail(*z);
}
pos_old=pos;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -