資源簡介
(c++源碼)中文版的黃金礦工小游戲,讓你對每種道具的作用更加了解。操作方法:方向鍵↓放出鉤子。每一關必須達到規定的金額才能進入下一關

代碼片段和文件信息
#include?“stdafx.h“
#include?“bitmaptool.h“
MYBITMAP::~MYBITMAP()
{
Deleteobject(hBm);
}
void?MYBITMAP::Init(HINSTANCE?hInstanceint?iResourceint?rowint?col)
{
BITMAP?bm;
inum=row;
jnum=col;
hBm=LoadBitmap(hInstanceMAKEINTRESOURCE(iResource));
Getobject(hBmsizeof(BITMAP)&bm);
width=bm.bmWidth/inum;
height=bm.bmHeight/jnum;
}
void?MYBITMAP::SetDC(HDC?hdestHDC?hsrc)
{
hdcdest=hdest;
hdcsrc=hsrc;
}
void?MYBITMAP::Show(int?xint?yint?iframe)
{
xpos=x;
ypos=y;
Selectobject(hdcsrchBm);
BitBlt(hdcdestxposyposwidthheighthdcsrciframe*width0SRCCOPY);
}
void?MYBITMAP::ShowCenter(int?yint?iframe)
{
xpos=(screenwidth-width)/2;
ypos=y;
Selectobject(hdcsrchBm);
BitBlt(hdcdestxposyposwidthheighthdcsrciframe*width0SRCCOPY);
}
void?MYBITMAP::ShowCenter(int?y)
{
xpos=(screenwidth-width)/2;
ypos=y;
Selectobject(hdcsrchBm);
BitBlt(hdcdestxposyposwidthheighthdcsrcframenow*width0SRCCOPY);
}
void?MYBITMAP::ShowLoop(int?leftint?topint?rightint?bottomint?iframe)
{
int?ij;
Selectobject(hdcsrchBm);
for(j=top;j {
for(i=left;i {
BitBlt(hdcdestijwidthheighthdcsrciframe*width0SRCCOPY);
}
}
}
void?MYBITMAP::ShowNoBack(int?xint?yint?iframe)
{
xpos=x;
ypos=y;
Selectobject(hdcsrchBm);
BitBlt(hdcdestxposyposwidthheight/2hdcsrciframe*widthheight/2SRCAND);
BitBlt(hdcdestxposyposwidthheight/2hdcsrciframe*width0SRCPAINT);
}
void?MYBITMAP::ShowNoBackLoop(int?xint?yint?iframeint?iNum)
{
int?i;
xpos=x;
ypos=y;
Selectobject(hdcsrchBm);
for(i=0;i {
BitBlt(hdcdestxpos+i*widthyposwidthheight/2hdcsrciframe*widthheight/2SRCAND);
BitBlt(hdcdestxpos+i*widthyposwidthheight/2hdcsrciframe*width0SRCPAINT);
}
}
int?MYBITMAP::MouseOut(int?xint?y)
{
if(x(xpos+width)?||?y(ypos+height))
framenow=0;
return?1;
}
int?MYBITMAP::MouseOver(int?xint?y)
{
if(x(xpos+width)?||?y(ypos+height))
return?0;
framenow=1;
return?1;
}
int?MYBITMAP::DetectMouseMove(int?xint?y)
{
MouseOver(xy);
MouseOut(xy);
return?0;
}
int?MYBITMAP::DetectMouseUp(int?xint?y)
{
if(x(xpos+width)?||?y(ypos+height))
return?0;
return?1;
}
void?MYBITMAP::ShowAni()
{
if(!iStartAni)
return;
Selectobject(hdcsrchBm);
BitBlt(hdcdestxposyposwidthheight/2hdcsrcframenow*widthheight/2SRCAND);
BitBlt(hdcdestxposyposwidthheight/2hdcsrcframenow*width0SRCPAINT);
framenow++;
//播放結束
if(framenow>=inum)
iStartAni=0;
}
void?MYBITMAP::SetAni(int?xint?y)
{
xpos=x;
ypos=y;
framenow=0;
iStartAni=1;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????153718??2008-04-13?20:40??挖金礦\bitmap1.bmp
?????文件???????2804??2008-04-12?17:23??挖金礦\bitmaptool.cpp
?????文件???????1151??2008-04-13?20:22??挖金礦\bitmaptool.h
?????文件??????98358??2008-04-12?17:31??挖金礦\bomb.bmp
?????文件???????2872??2008-04-13?20:22??挖金礦\catch.cpp
?????文件????????621??2008-04-07?17:15??挖金礦\catch.h
?????文件??????16248??2012-07-14?10:30??挖金礦\Debug\bitmaptool.obj
?????文件??????21638??2012-07-14?10:30??挖金礦\Debug\BuildLog.htm
?????文件??????16286??2012-07-14?10:30??挖金礦\Debug\catch.obj
?????文件???????7332??2012-07-14?10:30??挖金礦\Debug\filereport.obj
?????文件????1085440??2012-07-14?10:30??挖金礦\Debug\gamegold.exe
?????文件????????406??2012-07-14?10:30??挖金礦\Debug\gamegold.exe.em
?????文件????????472??2012-07-14?10:30??挖金礦\Debug\gamegold.exe.em
?????文件????????381??2012-07-14?10:30??挖金礦\Debug\gamegold.exe.intermediate.manifest
?????文件??????49407??2012-07-14?10:30??挖金礦\Debug\gamegold.obj
?????文件????2550784??2012-07-14?10:30??挖金礦\Debug\gamegold.pdb
?????文件?????647816??2008-04-13?20:40??挖金礦\Debug\gamegold.res
?????文件??????29781??2012-07-14?10:30??挖金礦\Debug\gamemap.obj
?????文件????????297??2008-04-07?10:38??挖金礦\Debug\ini\match.txt
?????文件?????????67??2012-07-14?10:30??挖金礦\Debug\mt.dep
?????文件??????10369??2012-07-14?10:30??挖金礦\Debug\mybutton.obj
?????文件???????9678??2012-07-14?10:30??挖金礦\Debug\myequip.obj
?????文件?????110607??2012-07-14?10:30??挖金礦\Debug\StdAfx.obj
?????文件?????184320??2008-04-13?20:39??挖金礦\Debug\vc60.pdb
?????文件?????380928??2012-07-14?10:30??挖金礦\Debug\vc90.pdb
?????文件??????73782??2008-04-07?16:44??挖金礦\equip.bmp
?????文件????????517??2008-03-30?12:05??挖金礦\filereport.cpp
?????文件????????225??2008-03-30?12:06??挖金礦\filereport.h
?????文件???????6198??2008-04-12?16:53??挖金礦\fire.bmp
?????文件?????651632??2008-04-13?20:37??挖金礦\gamegold.aps
............此處省略37個文件信息
評論
共有 條評論