嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 4 元微信扫码支付:4 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
这是一款VC6.0 下的网络象棋源码,涉及到TCP、IP通信,GUI界面绘制等知识要点,
有爱好象棋者可以下载
void CGameFrame::ShowChess(CDC *pDC)
{
//显示背景
ShowBKG(pDC);
//显示棋子
if(m_GameState == RUNNING || m_GameState == WIN || m_GameState == LOST)
ShowPieces(pDC);
//显示自己方的选中框
if(m_pSelectedPiece != NULL)
{
CPoint pt;
pt.x = m_pSelectedPiece->m_Pos.x PieceWidth/2;
pt.y = m_pSelectedPiece->m_Pos.y PieceWidth/2;
ShowSelectedRect(pDC,pt);
}
//对方的选中框
if(m_OppChessInfo.MoveIndex != -1 && m_IsMyTurn == TRUE)
{
int Mid = ToTop (int)(UnitWdith*4.5) PieceWidth/2;
CPoint point;
point.x = m_OppChessInfo.StartPt.x PieceWidth/2;
point.y = Mid (Mid - m_OppChessInfo.StartPt.y) - PieceWidth PieceWidth/2;
ShowSelectedRect(pDC,point);
point.x = m_OppChessInfo.EndPt.x PieceWidth/2;
point.y = Mid (Mid - m_OppChessInfo.EndPt.y) - PieceWidth PieceWidth/2;
ShowSelectedRect(pDC,point);
}
//显示游戏结果
ShowGameResult(pDC);
}