⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fangkuaidlg.h

📁 WindowsCE.Net程序设计-EVC程序源代码,希望对大家有帮助
💻 H
字号:
// brickDlg.h : header file
//

#if !defined(AFX_BRICKDLG_H__8F782CE1_7832_4364_86DE_2A60573808AE__INCLUDED_)
#define AFX_BRICKDLG_H__8F782CE1_7832_4364_86DE_2A60573808AE__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

///////////自定义常量///////////////
#define LEFTMARGIN 10
#define TOPMARGIN 5
#define	HIGHLIGHTCOLOR RGB(0,128,128)
//#define BTNSHADOWCOLOR RGB(0,57,57)
#define	ColorOfCurrentBrick RGB(255,255,0)//方块颜色
//#define clrTopLeft RGB(0, 0, 0)x
#define STOP 1
#define RUNNING 2
#define PAUSED 3
struct Brick
{
	int x;
	int y;
};
/////////////////////////////////////

	
/////////////////////////////////////////////////////////////////////////////
// CFangkuaiDlg dialog

class CFangkuaiDlg : public CDialog
{
// Construction
public:
	CFangkuaiDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CFangkuaiDlg)
	enum { IDD = IDD_FANGKUAI_DIALOG };
		// NOTE: the ClassWizard will add data members here
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CFangkuaiDlg)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

///////////自定义成员/////////////////	
protected:

///////////数据成员///////////////////
	COLORREF ColorOfMatrixOfBricks[20][10];
	BOOL EraseALine,BrickAtBottom;
	int MatrixOfBricks[20][10];
	int GameState;
	Brick CurrentBrick[5],LastPositionOfBrick[4];
	int TimerInterval;	// 定时器间隔
	int Level;
    
	int WIDTHOFBRICKS;
	int HEIGHTOFBRICKS;
	CFont StaticFont;
////////////////////////////////////////

///////////函数成员/////////////////////
	void myDraw(void);	// 绘制新图
	void GenerateABrick();	// 启动游戏,调用myDraw()刷新
	void CanEraseALine();	//
	void IsGameOver();
	int Isbottom();	//
	int IsOutOfRect(int w);	//
	void RotateBrick(void);	//
	void RefreshBricks(void);	//
	void InitBricks();
	void RefreshAll(void);
	//void PutMessage(int GameLevel);
	void Stop(void);
	void Pause(void);
	void Start(void);
	void Exit(void);
    void OnKey(UINT nChar);//处理输入信息的函数控制方块的运动
    void CreateNumber();//获取随机的数据
    void DrawNextBrick();//绘制下一个方块以提示


///////////////////////////////////////

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CFangkuaiDlg)
	virtual BOOL OnInitDialog();
    afx_msg void OnGameOver();
    afx_msg void OnGameStart();
	afx_msg void OnUp();
	afx_msg void OnDown();
	afx_msg void OnLeft();
	afx_msg void OnRight();
	afx_msg void OnPause();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnPaint();
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg void OnStaticNum();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_BRICKDLG_H__8F782CE1_7832_4364_86DE_2A60573808AE__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -