俄罗斯方块源代码
2001-12-23· ·jack_twb ··
没有 UI 部分,要修改玩家人数,方块数,颜色,键盘配置请看 CGameController 的 Start 函数,
请大家提提意见,我想做成像上海热线的俄罗斯方块,支持网络对战。
//head file Diamond.h
// Diamond.h: interface for the CDiamond class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DIAMOND_H__1B1DE2E7_A3B8_4D43_9079_AF2AC021F899__INCLUDED_)
#define AFX_DIAMOND_H__1B1DE2E7_A3B8_4D43_9079_AF2AC021F899__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class IGame; //inteface of game ,one mean a player
class IGameController; //inteface of game controller,control communication of players
typedef CTypedPtrList<CObList,IGame*> CGames; //all player in the game
class IGameController
{
//construction/destruction
public:
virtual ~IGameController(){};
//public interface
public:
virtual void OnEraseLines(IGame*,long) = 0 ; //when a player erase lines,call it
virtual void OnGameOver(IGame*) = 0 ; //when a player dies ,call it
};
//a block of a diamond
struct CBlock
{
long m_x ;
long m_y ;