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

📄 rectangledoc.cpp

📁 VC++制作的方块小游戏 游戏方法有点儿像祖马宝石方块
💻 CPP
字号:
// RectangleDoc.cpp : implementation of the CRectangleDoc class
//

#include "stdafx.h"
#include "Rectangle.h"

#include "RectangleDoc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CRectangleDoc

IMPLEMENT_DYNCREATE(CRectangleDoc, CDocument)

BEGIN_MESSAGE_MAP(CRectangleDoc, CDocument)
	//{{AFX_MSG_MAP(CRectangleDoc)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CRectangleDoc construction/destruction

CRectangleDoc::CRectangleDoc()
{

	BITMAP BM;

	rect.LoadBitmap(IDB_RECT);  
	rect.GetBitmap(&BM);
	width[RECT] = BM.bmWidth;
    height[RECT] = BM.bmHeight;

	bomb.LoadBitmap(IDB_BOMB);  
	bomb.GetBitmap(&BM);
	width[BOMB] = BM.bmWidth;
    height[BOMB] = BM.bmHeight;

	frame.LoadBitmap(IDB_FRAME);  
	frame.GetBitmap(&BM);
	width[FRAME] = BM.bmWidth;
    height[FRAME] = BM.bmHeight;

	nextbar.LoadBitmap(IDB_NEXTBAR);  
	nextbar.GetBitmap(&BM);
	width[NEXT] = BM.bmWidth;
    height[NEXT] = BM.bmHeight;

	score.LoadBitmap(IDB_SCORE);  
	score.GetBitmap(&BM);
	width[SCORE] = BM.bmWidth;
    height[SCORE] = BM.bmHeight;

	gameover.LoadBitmap(IDB_GAMEOVER);  
	gameover.GetBitmap(&BM);
	width[GAMEOVER] = BM.bmWidth;
    height[GAMEOVER] = BM.bmHeight;

	start.LoadBitmap(IDB_START);  
	start.GetBitmap(&BM);
	width[START] = BM.bmWidth;
    height[START] = BM.bmHeight;

	board.LoadBitmap(IDB_BOARD);  
	board.GetBitmap(&BM);
	width[BOARD] = BM.bmWidth;
    height[BOARD] = BM.bmHeight;

	number.LoadBitmap(IDB_NUMBER);  
	number.GetBitmap(&BM);
	width[NUMBER] = BM.bmWidth;
    height[NUMBER] = BM.bmHeight;

	combo.LoadBitmap(IDB_COMBO);  
	combo.GetBitmap(&BM);
	width[COMBO] = BM.bmWidth;
    height[COMBO] = BM.bmHeight;

	levelup.LoadBitmap(IDB_LEVELUP);  
	levelup.GetBitmap(&BM);
	width[LEVELUP] = BM.bmWidth;
    height[LEVELUP] = BM.bmHeight;

	item.LoadBitmap(IDB_ITEM);  
	item.GetBitmap(&BM);
	width[ITEM] = BM.bmWidth;
    height[ITEM] = BM.bmHeight;
}

CRectangleDoc::~CRectangleDoc()
{
}

BOOL CRectangleDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)

	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CRectangleDoc serialization

void CRectangleDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}

/////////////////////////////////////////////////////////////////////////////
// CRectangleDoc diagnostics

#ifdef _DEBUG
void CRectangleDoc::AssertValid() const
{
	CDocument::AssertValid();
}

void CRectangleDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CRectangleDoc commands

⌨️ 快捷键说明

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