• 大小: 7.34MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-06
  • 语言: 其他
  • 标签: 连连看  C++  游戏  

资源简介

用VS2010写的连连看小游戏,实现了大部分的游戏功能,供初学者使用

资源截图

代码片段和文件信息

#include “BufferDC.h“

CBufferDC::CBufferDC(HWND hWnd)
{
GetClientRect(hWnd&m_rect);
m_hDC=GetDC(hWnd);
m_iWidth=m_rect.right-m_rect.left;
m_iHeight=m_rect.bottom-m_rect.top;
m_hMemDC=CreateCompatibleDC(m_hDC);
m_hBackDC=CreateCompatibleDC(m_hDC);
m_hBmp=CreateCompatibleBitmap(m_hDCm_iWidthm_iHeight);
Selectobject(m_hMemDCm_hBmp);
}

CBufferDC::~CBufferDC()
{
Release();
}

void CBufferDC::Flush()
{
BitBlt(m_hDC00m_iWidthm_iHeightm_hMemDC00SRCCOPY);
}

HDC CBufferDC::GetMemdc()
{
return m_hMemDC;
}

HDC CBufferDC::GetBackdc()
{
return m_hBackDC;
}

void CBufferDC::Release()
{
if(m_hDC)
{
DeleteDC(m_hDC);
m_hDC=NULL;
}
if(m_hMemDC)
{
DeleteDC(m_hMemDC);
m_hMemDC=NULL;
}
if(m_hBackDC)
{
DeleteDC(m_hBackDC);
m_hBackDC=NULL;
}
if(m_hBmp)
{
Deleteobject(m_hBmp);
m_hBmp=NULL;
}
}

HDC CBufferDC::GetFrontdc()
{
return m_hDC;
}

void CBufferDC::ClearScreen()
{
Selectobject(m_hMemDCc_brushblack);
FillRect(m_hMemDC&m_rectc_brushblack);
}

void CBufferDC::Reserve(HWND hWnd)
{
Release();
GetClientRect(hWnd&m_rect);
m_hDC=GetDC(hWnd);
m_iWidth=m_rect.right-m_rect.left;
m_iHeight=m_rect.bottom-m_rect.top;
m_hMemDC=CreateCompatibleDC(m_hDC);
m_hBackDC=CreateCompatibleDC(m_hDC);
m_hBmp=CreateCompatibleBitmap(m_hDCm_iWidthm_iHeight);
Selectobject(m_hMemDCm_hBmp);
}

void CBufferDC::ChangeSize(HWND hWnd)
{
GetClientRect(hWnd&m_rect);
m_iWidth=m_rect.right-m_rect.left;
m_iHeight=m_rect.bottom-m_rect.top;
Deleteobject(m_hBmp);
m_hBmp=CreateCompatibleBitmap(m_hDCm_iWidthm_iHeight);
Selectobject(m_hMemDCm_hBmp);
}

RECT CBufferDC::GetBufRect()
{
return m_rect;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2010-12-08 22:06  连连看\
     目录           0  2010-12-08 22:05  连连看\连连看\
     文件    13478912  2010-11-13 22:44  连连看\连连看.ncb
     文件         894  2010-11-22 18:46  连连看\连连看.sln
     文件        1742  2010-03-23 02:44  连连看\连连看\BufferDC.cpp
     文件         444  2010-03-28 17:48  连连看\连连看\BufferDC.h
     目录           0  2010-12-08 22:05  连连看\连连看\data\
     目录           0  2010-12-08 22:05  连连看\连连看\data\image\
     文件     1440056  2010-03-30 02:32  连连看\连连看\data\image\bk.bmp
     文件       43456  2008-04-22 12:20  连连看\连连看\data\image\boom.bmp
     文件        2338  2010-03-31 14:10  连连看\连连看\data\image\choice.bmp
     文件        7658  2008-04-16 19:04  连连看\连连看\data\image\linesprite1.bmp
     文件       26096  2008-04-22 11:32  连连看\连连看\data\image\linesprite2.bmp
     文件        2264  2008-04-24 07:41  连连看\连连看\data\image\reset.bmp
     文件        8696  2010-03-30 00:58  连连看\连连看\data\image\start.bmp
     文件        8696  2010-03-30 00:32  连连看\连连看\data\image\starton.bmp
     文件      165414  2010-12-08 21:06  连连看\连连看\data\image\tiles.bmp
     文件       17424  2008-04-22 13:26  连连看\连连看\data\image\time.bmp
     目录           0  2010-12-08 22:05  连连看\连连看\data\map\
     文件         172  2010-03-29 14:13  连连看\连连看\data\map\map1.txt
     文件         172  2010-03-29 21:53  连连看\连连看\data\map\map2.txt
     文件         172  2010-04-01 20:14  连连看\连连看\data\map\map3.txt
     目录           0  2010-12-08 22:05  连连看\连连看\data\sound\
     文件     2203817  2005-08-10 12:22  连连看\连连看\data\sound\19001.mp3
     文件       33092  2004-11-10 11:54  连连看\连连看\data\sound\elec.wav
     文件       97928  2004-11-10 11:54  连连看\连连看\data\sound\end.wav
     文件      235208  2004-11-10 11:54  连连看\连连看\data\sound\flystar.wav
     文件        2878  2004-11-10 11:54  连连看\连连看\data\sound\sel.wav
     文件      133444  2004-11-10 11:54  连连看\连连看\data\sound\start.wav
     文件       24765  2010-04-16 04:32  连连看\连连看\Game.cpp
     文件        2669  2010-04-14 23:27  连连看\连连看\Game.h
............此处省略36个文件信息

评论

共有 条评论