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

📄 tcsgamedlg.h

📁 贪吃蛇游戏的原代码
💻 H
字号:
// TcsGameDlg.h : header file
//

#if !defined(AFX_TCSGAMEDLG_H__0200D401_A993_4AFD_9D31_E7F6DEBFED99__INCLUDED_)
#define AFX_TCSGAMEDLG_H__0200D401_A993_4AFD_9D31_E7F6DEBFED99__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "TcsDefines.h"
/////////////////////////////////////////////////////////////////////////////
// CTcsGameDlg dialog

class CTcsGameDlg : public CDialog
{
// Construction
public:
	void DrawInfoText();
	void DrawWait(int nWaitType,int nWaitCount);
	void SetLevel_00();
	CImageList m_ilTB;
	CToolBar m_wndToolBar;
	BOOL m_bCanThrough;
	int m_nMaxLevel;
	BOOL m_bEnableSound;
	unsigned int m_nTimeInterval;
	void SetAnyLevel(int nLevel);
	void ReDoLevel();
	void DrawLifeCount(int nCount,int initX,int initY);
	void DoNextLevel();
	void DrawARNumber(int nNum,int initX,int initY);
	BOOL m_bSnakeDied;
	void SetStone(int indexX, int indexY);
	void DrawStone(int ix,int iy);
	void DrawFood(int indexX,int indexY,int nFoodType=TYPE_FOOD);
	BOOL CheckDie();
	void CreateNewFood(int nFoodType=TYPE_FOOD);
	BOOL CheckCanEat();
	void ClearArray();
	void MoveSnake(int nDir);
	void AddSnakeLen(int indexX,int indexY);
	void DrawBlock(int ix,int iy,BOOL bErase,BOOL bDie=FALSE);
	void DrawGame();
	CTcsGameDlg(CWnd* pParent = NULL);	// standard constructor

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

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTcsGameDlg)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
	//}}AFX_VIRTUAL

// Implementation
protected:
	int m_nWaitCount;
	int m_nWaitType;
	CRect m_rcWait;
	void SetLevel_09();
	void SetLevel_08();
	void SetLevel_07();
	void SetLevel_06();
	int m_nCurDirTemp;
	int m_nTotalScore;
	int m_nSnakeLife;
	CBitmap pNumBmp[11];
	void SetLevel_05();
	void SetLevel_04();
	void SetLevel_03();
	void SetLevel_02();
	void SetLevel_01();
	int m_nLevel;
	BOOL m_bPause;
	CStatusBarCtrl m_wndStatusBar;
	int m_nArray[20][15];
	int m_nCurDir;
	CPoint m_ptSnake[25];
	int m_nSnakeLen;
	int m_nInitY;
	int m_nInitX;
	int m_nBlockLen;
	int m_nLenY;
	int m_nLenX;
	CRect m_rcGame;
	HICON m_hIcon;
	CPoint m_ptDisplay;

	// Generated message map functions
	//{{AFX_MSG(CTcsGameDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnStart();
	afx_msg void OnExit();
	afx_msg void OnAbout();
	afx_msg void OnPause();
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg void OnSound();
	afx_msg void OnThrough();
	afx_msg void OnStop();
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_TCSGAMEDLG_H__0200D401_A993_4AFD_9D31_E7F6DEBFED99__INCLUDED_)

⌨️ 快捷键说明

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