资源简介
一个c++编写的斗地主游戏源码,编译通过可以运行,希望对大家有所帮助。

代码片段和文件信息
// Client_Game.cpp: implementation of the CClientGame class.
//
//////////////////////////////////////////////////////////////////////
#include “stdafx.h“
#include “斗地主.h“
#include “Game.h“
#include “link.h“
#include “My_DirectInput.h“
#include “my_directdraw.h“
#include “Playing_Cards.h“
#include “Draw_Item_Engine.h“
#include “Draw_Cards_Engine.h“
#include “Client_Game.h“
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CClientGame::CClientGame()
{
}
CClientGame::~CClientGame()
{
}
//左边玩家(电脑)思考,并决定要出的牌;
int CClientGame::LeftDoing()
{
if( m_nLordLock == 0 )
{
if( m_nRoundCounter == 3 ) //说明已经出了牌;
{
//把已经出的牌回退;
if(pLeftCards->m_nDiscardingCounter != 0)
pDrawCards->LeftBacking();
if(pCenterCards->m_nDiscardingCounter != 0)
pDrawCards->CenterBacking();
if(pRightCards->m_nDiscardingCounter != 0)
pDrawCards->RightBacking();
m_nRoundCounter = 0; //新的一圈;
}
m_nRoundCounter++;
return -1;
}
if( pRightCards->m_cDiscardingType.m_nTypeNum == 0 &&
pCenterCards->m_cDiscardingType.m_nTypeNum == 0 )
{
m_nLordLock = -1;
}
//补丁调整出牌显示;
int Temp_Discarding_Counter = 0; //刚出的牌的数量;
CCard Temp_Discarding[20]; //刚出的牌;
pClientlink->Recv(Temp_Discardingsizeof(CCard)*20);
pClientlink->Recv(&Temp_Discarding_Countersizeof(int));
pClientlink->Recv(&pLeftCards->m_cDiscardingTypesizeof(CCardsType));
if( m_nRoundCounter == 3 ) //说明已经出了牌;
{
//把已经出的牌回退;
if(pLeftCards->m_nDiscardingCounter != 0)
pDrawCards->LeftBacking();
if(pCenterCards->m_nDiscardingCounter != 0)
pDrawCards->CenterBacking();
if(pRightCards->m_nDiscardingCounter != 0)
pDrawCards->RightBacking();
m_nRoundCounter = 0; //新的一圈;
}
m_nRoundCounter++;
for(int i=0;i<20;i++)
{
pLeftCards->m_cDiscarding[i] = Temp_Discarding[i];
}
pLeftCards->m_nDiscardingCounter = Temp_Discarding_Counter;
//如果出牌数大于0;
if( pLeftCards->m_cDiscardingType.m_nTypeNum == 4 )
{
m_nBombCounter++;//加分;
}
if( pLeftCards->m_cDiscardingType.m_nTypeNum != 0 )
{
pDrawCards->LeftDiscarding();
::RedrawGame();
if( pLeftCards->m_nCardsCounter == 0 )
{
//打印结束信息;
AccountScore(0);
::SetTimer(hWnd00NULL); //开始游戏;
return 0;
}
}
else
{
//打印左边玩家不要信息;
pDraw->TextGDI(“过牌!-“250200RGB(25500)400“华文新魏“lpddsprimary);
if( m_nCurrentLord == 0 )
{
m_nLordLock = 0;
}
Sleep(300);
}
return 1;
}
//中间(本机)玩家出牌;
int CClientGame::CenterDoing()
{
if( m_nLordLock == 1 )
{
if( m_nRoundCounter == 3 ) //说明已经出了牌;
{
//把已经出的牌回退;
if(pCenterCards->m_nDiscardingCounter != 0)
pDrawCards->CenterBacking();
if(pRightCards->m_nDiscardin
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2004-06-02 15:47 斗地主\
目录 0 2004-06-10 23:41 斗地主\bmp\
目录 0 2004-06-10 23:41 斗地主\bmp\cards\
文件 112232 2004-04-17 23:04 斗地主\bmp\cards\10.bmp
文件 112232 2004-04-17 23:02 斗地主\bmp\cards\2.bmp
文件 112232 2004-04-17 23:05 斗地主\bmp\cards\3.bmp
文件 112232 2004-04-17 23:21 斗地主\bmp\cards\4.bmp
文件 112232 2004-04-17 23:24 斗地主\bmp\cards\5.bmp
文件 112232 2004-04-17 23:19 斗地主\bmp\cards\6.bmp
文件 112232 2004-04-17 23:34 斗地主\bmp\cards\7.bmp
文件 112232 2004-04-17 23:28 斗地主\bmp\cards\8.bmp
文件 112232 2004-04-17 23:31 斗地主\bmp\cards\9.bmp
文件 112232 2004-04-17 23:03 斗地主\bmp\cards\A.bmp
文件 28328 2004-06-10 15:06 斗地主\bmp\cards\card_back1.bmp
文件 112232 2004-04-21 18:02 斗地主\bmp\cards\J.bmp
文件 56144 2004-04-22 11:35 斗地主\bmp\cards\Jokers.bmp
文件 112232 2004-04-21 17:54 斗地主\bmp\cards\K.bmp
文件 112232 2004-04-17 23:08 斗地主\bmp\cards\Q.bmp
文件 111104 2004-06-10 20:31 斗地主\bmp\cards\Thumbs.db
目录 0 2004-06-10 23:41 斗地主\bmp\faces\
文件 14896 2004-05-08 19:24 斗地主\bmp\faces\face0.bmp
文件 14896 2004-05-08 20:18 斗地主\bmp\faces\face1.bmp
文件 14896 2004-05-08 20:18 斗地主\bmp\faces\face2.bmp
文件 14896 2004-05-08 20:18 斗地主\bmp\faces\face3.bmp
文件 24064 2004-08-20 13:15 斗地主\bmp\faces\Thumbs.db
文件 3145784 2004-06-10 23:37 斗地主\bmp\Game_Back.bmp
目录 0 2004-06-10 23:41 斗地主\bmp\item\
文件 135056 2004-05-14 19:42 斗地主\bmp\item\bring_lord.bmp
文件 48056 2004-05-16 17:11 斗地主\bmp\item\choose_lord.bmp
文件 17384 2004-05-14 19:47 斗地主\bmp\item\lord_fr
文件 7256 2004-05-15 02:16 斗地主\bmp\item\Ok_Button.bmp
............此处省略67个文件信息
- 上一篇:新手C语言MP3播放器
- 下一篇:基于C语言的数字图像处理
相关资源
- 猜数字游戏 c语言代码
- 移木块游戏,可以自编自玩,vc6.0编写
- C++纯文字DOS超小RPG游戏
- LINUX下命令行界面的C语言细胞游戏
- VC++MFC小游戏实例教程(实例)+MFC类库
- 用C语言实现的一个打字游戏
- C语言版3D魔方游戏源代码
- 打飞机小游戏57466
- 俄罗斯方块游戏源码(Tetris)
- c++ 猜拳小游戏
- 扫雷游戏.cpp
- 杨中科游戏开发引擎
- 智商超高的中国象棋游戏源码(C++版
- c++ 扫雷游戏源码(控制台)
- C++跑跑卡丁车
- C++“倒忌时”小游戏
- XX游戏客户端源码
- c++小游戏源码.doc
- 基于ege图形的推箱子游戏
- C语言ege贪吃蛇游戏
- C++小游戏4款(源码)
- 推箱子小游戏源码
- 五子棋游戏源码(控制台)
- 猜数字游戏.sb3
- C++贪吃蛇控制台小游戏代码
- 扫雷游戏.cpp(较简单)
- MFC五子棋游戏
- VC++ 大富翁4_大富翁游戏源码
- c++常用游戏算法及数据结构设计
- c++的飞行鸟游戏
评论
共有 条评论