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

📄 1dlg.h

📁 很好的一个游戏源代码
💻 H
字号:
// 1Dlg.h : header file
//

#if !defined(AFX_1DLG_H__8E600DBB_D5C7_425A_B6C8_ED29AFB27063__INCLUDED_)
#define AFX_1DLG_H__8E600DBB_D5C7_425A_B6C8_ED29AFB27063__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CMy1Dlg dialog
#define MAX_LINE 25
#define MAX_COW  10
#define PREVIEW   6
struct shaperect
{
	CRect rect;
	int   active;//判断小方块是否能移动,active=1能移动,为0则不能移动
	int   hrect;//判断小方块处是否已经填充了,为1已填充,为0则没有填充
};

class CMy1Dlg : public CDialog
{
// Construction
public:
	void GameOver();
	void OnGenerateShape();
	void OnScore();
	BOOL AttachBoard(char cs);
	CMy1Dlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CMy1Dlg)
	enum { IDD = IDD_MY1_DIALOG };
	CStatic	m_gamepreview;
	CStatic	m_gameboard;
	int		m_lines;
	int		m_level;
	int		m_score;
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;
	CBitmap m_stone;
	int m_BitWidth;//位图的宽
	int m_BitHeight;//位图的高
	struct shaperect shape[MAX_LINE][MAX_COW];//全平面分为10X25个小方块
	CSize  m_size;//小方块的高和宽
	BOOL   Start;//是否开始
	CSize  m_pvsize;//预览区的小方块的高和宽
	struct shaperect shapepreview[PREVIEW][PREVIEW];//预览区分为6X6个小方块
	int m_time;//设置速度

	// Generated message map functions
	//{{AFX_MSG(CMy1Dlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnStart();
	afx_msg void OnRotate();
	afx_msg void OnPause();
	afx_msg void OnMoveleft();
	afx_msg void OnMoveright();
	virtual void OnCancel();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnDown();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_1DLG_H__8E600DBB_D5C7_425A_B6C8_ED29AFB27063__INCLUDED_)

⌨️ 快捷键说明

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