📄 bomb.cpp
字号:
// Bomb.cpp: implementation of the CBomb class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "My.h"
#include "Bomb.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
// 炸弹类成员函数
// 炸弹类构造函数
CBomb::CBomb()
{
m_pointBomb.x = 0;
m_pointBomb.y = 80;
m_bmpBomb.LoadBitmap(IDB_BOMB);
BITMAP BM;
m_bmpBomb.GetBitmap(&BM);
m_nWidth = BM.bmWidth;
m_nHeight = BM.bmHeight;
}
// 显示炸弹
void CBomb::ShowBomb(CDC *pDC, CDC *pMemDC, CRect Client)
{
pMemDC->SelectObject(&m_bmpBomb);
pDC->BitBlt(m_pointBomb.x, m_pointBomb.y,
m_nWidth, m_nHeight, pMemDC, 0, 0, SRCAND);
}
// 改变位置
void CBomb::ChangePos(int x)
{
m_pointBomb.y += 20;
if(m_pointBomb.y>480)
m_pointBomb.y = 80;
m_pointBomb.x = x;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -