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

📄 例子view.h

📁 c++编写的一个迷宫小游戏
💻 H
字号:
// 例子View.h : interface of the CMyView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_VIEW_H__B088B334_DC5B_467C_85D4_BE1F2A88CD52__INCLUDED_)
#define AFX_VIEW_H__B088B334_DC5B_467C_85D4_BE1F2A88CD52__INCLUDED_

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


class CMyView : public CView
{
protected: // create from serialization only
	CMyView();
	DECLARE_DYNCREATE(CMyView)

// Attributes
public:
	CMyDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMyView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	bool stop;
	CBitmap m_bitmap[10];
	HCURSOR hcursor[5];
	int cur_flag;
	int xstart;//保存起始位置/用于初始化及NewGame
	int ystart;
	int xnow;//精灵的当前位置(起始位置)
	int ynow;
	int xend;//终点位置
	int yend;
	void InitGame();
	bool Over();
	int arry[60][60];
	int m;//数组的实际下标
	int n;
	int x_start;//迷宫在视口的起始位置
	int y_start;
	int m_time;

	virtual ~CMyView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CMyView)
	afx_msg void OnGameNew();
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnFileOpen();
	afx_msg void OnFileSave();
	afx_msg void OnMapNew();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnMENUstart();
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	afx_msg void OnMENUend();
	afx_msg void OnMENUcachu();
	afx_msg void OnMENUqiang();
	afx_msg void OnMENUcancel();
	afx_msg void OnMENUplay();
	afx_msg void OnMENUstop();
	afx_msg void Ontime1000();
	afx_msg void OnUpdatetime1000(CCmdUI* pCmdUI);
	afx_msg void Ontime700();
	afx_msg void OnUpdatetime700(CCmdUI* pCmdUI);
	afx_msg void Ontime400();
	afx_msg void OnUpdatetime400(CCmdUI* pCmdUI);
	afx_msg void Ontime200();
	afx_msg void OnUpdatetime200(CCmdUI* pCmdUI);
	afx_msg void Ontime100();
	afx_msg void OnUpdatetime100(CCmdUI* pCmdUI);
	afx_msg void Ontime50();
	afx_msg void OnUpdatetime50(CCmdUI* pCmdUI);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in 例子View.cpp
inline CMyDoc* CMyView::GetDocument()
   { return (CMyDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_VIEW_H__B088B334_DC5B_467C_85D4_BE1F2A88CD52__INCLUDED_)

⌨️ 快捷键说明

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