?? fangkuaidlg.h
字號(hào):
// 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:
///////////數(shù)據(jù)成員///////////////////
COLORREF ColorOfMatrixOfBricks[20][10];
BOOL EraseALine,BrickAtBottom;
int MatrixOfBricks[20][10];
int GameState;
Brick CurrentBrick[5],LastPositionOfBrick[4];
int TimerInterval; // 定時(shí)器間隔
int Level;
int WIDTHOFBRICKS;
int HEIGHTOFBRICKS;
CFont StaticFont;
////////////////////////////////////////
///////////函數(shù)成員/////////////////////
void myDraw(void); // 繪制新圖
void GenerateABrick(); // 啟動(dòng)游戲,調(diào)用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);//處理輸入信息的函數(shù)控制方塊的運(yùn)動(dòng)
void CreateNumber();//獲取隨機(jī)的數(shù)據(jù)
void DrawNextBrick();//繪制下一個(gè)方塊以提示
///////////////////////////////////////
// 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_)
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -