资源简介

感谢大家对上一个版本的支持,这个版本增加了地图、水管、攻击种类和更多的敌人,支持窗口大小的调整。用VC6制作,包含整个工程。

资源截图

代码片段和文件信息

#include “stdafx.h“
#include “bitmaptool.h“
#include “gamemap.h“

extern GAMEMAP gamemap;

extern FILEREPORT f1;

MYBITMAP::MYBITMAP()
{

}

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::SetDevice(HDC hdestHDC hsrcint wwinint hwin)
{
hdcdest=hdest;
hdcsrc=hsrc;
screenwidth=wwin;
screenheight=hwin;
}

void MYBITMAP::Show(int xint y)
{
xpos=x;
ypos=y;
Selectobject(hdcsrchBm);
BitBlt(hdcdestxposyposwidthheighthdcsrc00SRCCOPY);
}

void MYBITMAP::ShowCenter(int y)
{
xpos=(screenwidth-width)/2;
ypos=y;

Selectobject(hdcsrchBm);
BitBlt(hdcdestxposyposwidthheighthdcsrc00SRCCOPY);
}

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);
}
}

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;
*/
}


void MYBITMAP::SetPos(int istyleint xint y)
{
switch(istyle)
{
case BM_CENTER:
xpos=(screenwidth-width)/2;
ypos=y;
break;
case BM_USER:
xpos=x;
ypos=y;
break;
}
}

void MYBITMAP::Draw(DWORD dwRop)
{
Selectobject(hdcsrchBm);
BitBlt(hdcdestxposyposwidthheighthdcsrc00dwRop);
}

void MYBITMAP::Stretch(int xint y)
{
Selectobject(hdcsrchBm);
StretchBlt(hdcdestxposyposwidth*xheight*y
hdcsrc00widthheight
SRCCOPY);
}

void MYBITMAP::Stretch(int xint yint id)
{
Selectobject(hdcsrchBm);
StretchBlt(hdcdestxposyposwidth*xheight*y
hdcsrc0id*height
widthheight
SRCCOPY);
}


///////////////////////// bitmap object animation//////////////////
MYBKSKY

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2731  2008-08-23 17:01  增强版源码\Debug\map\map1.txt

     文件       2731  2008-08-23 17:01  增强版源码\map\map1.txt

     文件      30774  2008-06-15 12:28  增强版源码\pic\role.bmp

     文件     657462  2008-08-20 18:08  增强版源码\pic\ani.bmp

     文件     331830  2008-08-17 10:02  增强版源码\pic\mapbk.bmp

     文件     344454  2008-08-17 15:32  增强版源码\pic\map.bmp

     文件     589880  2008-08-06 15:21  增强版源码\pic\mapsky.bmp

     文件     589878  2008-08-21 19:27  增强版源码\pic\animagic.bmp

     文件     737334  2008-08-23 16:37  增强版源码\pic\pre1.bmp

     文件      10531  2008-08-23 17:08  增强版源码\bitmaptool.cpp

     文件       2942  2008-08-23 17:14  增强版源码\bitmaptool.h

     文件       1234  2008-06-08 09:48  增强版源码\filereport.cpp

     文件        500  2008-06-08 09:47  增强版源码\filereport.h

     文件      21473  2008-08-24 10:04  增强版源码\gamemap.cpp

     文件       2410  2008-08-21 17:46  增强版源码\gamemap.h

     文件    3288636  2008-08-24 10:08  增强版源码\mario01.aps

     文件      12372  2008-08-24 10:04  增强版源码\mario01.cpp

     文件       5597  2008-07-29 19:50  增强版源码\mario01.dsp

     文件        520  2008-06-07 14:39  增强版源码\mario01.dsw

     文件        329  2008-06-07 14:39  增强版源码\mario01.h

     文件       1078  2008-08-24 10:07  增强版源码\mario01.ICO

     文件     115712  2008-08-24 10:27  增强版源码\mario01.ncb

     文件      57856  2008-08-24 10:27  增强版源码\mario01.opt

     文件        248  2008-08-24 10:27  增强版源码\mario01.plg

     文件       5088  2008-08-24 10:08  增强版源码\mario01.rc

     文件       1538  2008-06-14 20:13  增强版源码\myclock.h

     文件       2075  2008-06-07 14:39  增强版源码\ReadMe.txt

     文件       1263  2008-07-29 18:50  增强版源码\resource.h

     文件        318  2008-08-24 10:08  增强版源码\SMALL.ICO

     文件        294  2008-06-07 14:39  增强版源码\StdAfx.cpp

............此处省略16个文件信息

评论

共有 条评论