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

📄 fangkuaidlg.h

📁 EVC下的方块游戏程序源码
💻 H
字号:
// fangkuaiDlg.h : header file
//

#if !defined(AFX_FANGKUAIDLG_H__BA13DCFA_BDD1_4EEF_B3A2_8C5A41549601__INCLUDED_)
#define AFX_FANGKUAIDLG_H__BA13DCFA_BDD1_4EEF_B3A2_8C5A41549601__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(68,71,140)
#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

///////////////////////////////////数据成员//////////////////////////////////
	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();
	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 OnPause();
	afx_msg void OnUp();
	afx_msg void OnLeft();
	afx_msg void OnDown();
	afx_msg void OnRight();
	afx_msg void OnStaticNum();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnPaint();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_FANGKUAIDLG_H__BA13DCFA_BDD1_4EEF_B3A2_8C5A41549601__INCLUDED_)

⌨️ 快捷键说明

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