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

📄 russiab.cpp

📁 俄罗斯方块
💻 CPP
字号:
// Russiab.cpp: implementation of the CRussiab class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "4_1.h"
#include "Russiab.h"

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

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

CRussiab::CRussiab()
{
	jiemian.LoadBitmap(IDB_BITMAP10);
}

CRussiab::~CRussiab()
{

}

void CRussiab::DrawJiemian(CDC *pDC)
{
	CDC Dc;
	if(Dc.CreateCompatibleDC(pDC)==FALSE)
		AfxMessageBox("Can't create DC");
	//画背景
    Dc.SelectObject(jiemian);
	pDC->BitBlt(0,0,500,600,&Dc,0,0,SRCCOPY);

    //画分数,速度,难度
    //设置字体颜色及其背景颜色
	CString str;
	pDC->SetTextColor(RGB(198,24,190));
	pDC->SetBkColor(RGB(255,255,0));
    //输出数字
	str.Format("%d",m_Level);
	if(m_Level>=0)
		pDC->TextOut(50,70,str);

	str.Format("%d",m_Speed);	
	if(m_Speed>=0)	
		pDC->TextOut(50,42,str);

	str.Format("%d",m_Score);	
	if(m_Score>=0)
		pDC->TextOut(50,12,str);

    //如果有方块,显示方块
	//游戏区
	for(int i=0;i<m_RowCount;i++)
		for(int j=0;j<m_ColCount;j++)
			if(Russia[i][j]==1)
			{
				Dc.SelectObject(fangkuai2);
				pDC->BitBlt(j*20,100+i*20,30,30,&Dc,0,0,SRCCOPY);
			}
    //预先图形
	for(int n=0;n<4;n++)
		for(int m=0;m<4;m++)
			if(Will[n][m]==1)
			{	
				Dc.SelectObject(fangkuai2);
				pDC->BitBlt( 120+m*20,10+n*20,30,30,&Dc,0,0,SRCCOPY);
			}
}

⌨️ 快捷键说明

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