⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 explode.cpp

📁 一个坦克大战的源码
💻 CPP
字号:
// Explode.cpp: implementation of the CExplode class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Explode.h"
#include "MainGame.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CExplode::CExplode(int px,int py,int n):CContainerObject(this)
{
	stage = 0;
	positionX=px;
	positionY=py;
	type=n;
	if(type<4)sndPlaySound("sound//bang.wav",SND_ASYNC|SND_NODEFAULT);
}

CExplode::~CExplode()
{

}

void CExplode::displayObject()
{
	CMainGame *pWnd=(CMainGame*)AfxGetMainWnd();
	CRect rt1(positionX,positionY,positionX+30,positionY+30);
	CRect rt2(32*(stage/5),0,32*(stage++/5+1),32);
	//1--11 2--12 3--13
	if(type==5)
		pWnd->BltBitMap(pWnd->lpBackBuffer,rt1,pWnd->lpBKGObject[10+1],rt2);
	else
		pWnd->BltBitMap(pWnd->lpBackBuffer,rt1,pWnd->lpBKGObject[10+type],rt2);
}

bool CExplode::ActiveObject()
{
	displayObject();
	if(stage>40)return false;
	else return true;
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -