我是靠谱客的博主 暴躁荔枝,最近开发中收集的这篇文章主要介绍c++语言游戏源代码,RPG游戏源代码(原创,vc++实现),觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

DispatchMessage(&msg);

}

}

void DrawInCheckEvent(void)

{

int x;

int y;

int x1;

int y1;

x=4*Bmp_Width;

y=3*Bmp_Width;

x1=Role_Act*Bmp_Width+1;

y1=Role_Status*Bmp_Height+1;

ClearScr();

BitBlt(memDC,Map_x,Map_y,(Map[Scene].Width+1)*32 ,(Map[Scene].Height+1)*32,TmpSceneDC,0,0,SRCCOPY);

BitBlt(memDC,x,y,Bmp_Width,Bmp_Height,MainRoleDC,x1,y1,SRCAND);

BitBlt(memDC,x,y,Bmp_Width,Bmp_Height,MainRoleDC,x1+Bmp_Width*3,y1,SRCPAINT);

Draw();

}

void DrawInTalkText(void)

{

int x;

int y;

int x1;

int y1;

x=4*Bmp_Width;

y=3*Bmp_Width;

x1=Role_Act*Bmp_Width+1;

y1=Role_Status*Bmp_Height+1;

ClearScr();

BitBlt(memDC,Map_x,Map_y,(Map[Scene].Width+1)*32 ,(Map[Scene].Height+1)*32,TmpSceneDC,0,0,SRCCOPY);

BitBlt(memDC,x,y,Bmp_Width,Bmp_Height,MainRoleDC,x1,y1,SRCAND);

BitBlt(memDC,x,y,Bmp_Width,Bmp_Height,MainRoleDC,x1+Bmp_Width*3,y1,SRCPAINT);

BitBlt(memDC,0,236,320,42,msgboxDC,1,1,SRCAND);

BitBlt(memDC,0,236,320,42,msgboxDC,1,43,SRCPAINT);

TextOut(memDC,1,1, Map[Scene].name  ,strlen(Map[Scene].name));

BitBlt(windowDC,0,0,325,320,memDC,0,0,SRCCOPY);

}

void DrawTmpScene(int Old_Scene)

{

int k;

int j;

k=Map[Old_Scene].Height;

j=Map[Old_Scene].Width;

rect.left =0;

rect.top =0;

rect.right =j*32;

rect.bottom = k*32;

FillRect(TmpSceneDC, &rect, (HBRUSH)GetStockObject(BLACK_BRUSH));

BitBlt(TmpSceneDC,0,0,(Map[Scene].Width+1)*32,(Map[Scene].Height+1)*32,TmpMapDC,0,0,SRCCOPY);

for (int i=0;i

{

int TmpNPC_x=NPC[Scene].NPCs.Pos_x*32;

int TmpNPC_y=(NPC[Scene].NPCs.Pos_y)*32;

int Tmp_y1=NPC[Scene].NPCs.NPC_Status*Bmp_Height+1;

int Tmp_name=NPC[Scene].NPCs.name;

int cansee=NPC[Scene].NPCs.seeable;

if (cansee==1)

{

BitBlt(TmpSceneDC,TmpNPC_x ,TmpNPC_y,32,64,NameToDC(Tmp_name),1,Tmp_y1,SRCAND);

BitBlt(TmpSceneDC,TmpNPC_x ,TmpNPC_y,32,64,NameToDC(Tmp_name),97,Tmp_y1,SRCPAINT);

}

}

}

HDC const NameToDC(int tempint)

{

switch (tempint){

case 1:

return Boy1DC;

break;

case 2:

return Boy2DC;

break;

case 3:

return Girl1DC;

break;

case 4:

return Girl2DC;

}

}

void Enter_Scene(char * chr)

{

BitBlt(memDC,45,126,230,40,DiagDC,0,0,SRCCOPY);

TextOut(memDC,66,136,chr,strlen(chr));

Draw();

Delay(1000);

while(GetAsyncKeyState(VK_UP))

{CheckSysMsg();}

while(GetAsyncKeyState(VK_SPACE))

{CheckSysMsg();}

ClearScr();

DrawInCheckEvent();

Draw();

}

void ReleaseObjs(void)

{

for( int i=0; i

{    delete[] NPC.NPCs;

for (int j=0;j

{

delete []Map.Data[j];

}

}

//释放

ReleaseDC(hwnd,MainRoleDC);

ReleaseDC(hwnd,windowDC);

ReleaseDC(hwnd,memDC);

ReleaseDC(hwnd,msgboxDC);

ReleaseDC(hwnd,MapDC);

ReleaseDC(hwnd,TmpMapDC);

ReleaseDC(hwnd,FaceDC);

ReleaseDC(hwnd,TmpSceneDC);

ReleaseDC(hwnd,Boy1DC);

ReleaseDC(hwnd,Boy2DC);

ReleaseDC(hwnd,Girl1DC);

ReleaseDC(hwnd,Girl2DC);

ReleaseDC(hwnd,DiagDC);

DeleteObject(MainRoleBMP);

DeleteObject(memBMP);

DeleteObject(msgboxBMP);

DeleteObject(MapBMP);

DeleteObject(Font);

DeleteObject(TmpMapBMP);

DeleteObject(TmpSceneBMP);

DeleteObject(Boy1BMP);

DeleteObject(Boy2BMP);

DeleteObject(Girl1BMP);

DeleteObject(Girl2BMP);

DeleteObject(DiagBMP);

}

最后

以上就是暴躁荔枝为你收集整理的c++语言游戏源代码,RPG游戏源代码(原创,vc++实现)的全部内容,希望文章能够帮你解决c++语言游戏源代码,RPG游戏源代码(原创,vc++实现)所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(33)

评论列表共有 0 条评论

立即
投稿
返回
顶部