?? plane.cpp
字號:
// Plane.cpp: implementation of the CPlane class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "My.h"
#include "Plane.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
// 飛機類的成員函數
// 構造函數
CPlane::CPlane()
{
m_pointPlane = CPoint(0, 50);
m_bmpPlane.LoadBitmap(IDB_PLANE);
BITMAP BM;
m_bmpPlane.GetBitmap(&BM);
m_nWidth = BM.bmWidth;
m_nHeight = BM.bmHeight;
}
// 顯示飛機
void CPlane::ShowPlane(CDC *pDC, CDC *pMemDC, CRect Client)
{
pMemDC->SelectObject(&m_bmpPlane);
pDC->BitBlt(m_pointPlane.x, m_pointPlane.y,
m_nWidth, m_nHeight, pMemDC,0,0,SRCAND);
}
// 改變飛機位置
void CPlane::ChangePos()
{
if(m_pointPlane.x>788)
m_pointPlane.x = 0;
else
m_pointPlane.x += 10;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -