先上图:
使用vc++6.0开发
源码:http://download.csdn.net/detail/h1023417614/8501223
//view类的头文件
// game1View.h : interface of the CGame1View class
//
/
#if !defined(AFX_GAME1VIEW_H__C9459B4E_5B14_4A9E_8D36_0AC5CB7A3E58__INCLUDED_)
#define AFX_GAME1VIEW_H__C9459B4E_5B14_4A9E_8D36_0AC5CB7A3E58__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CGame1View : public CView
{
protected: // create from serialization only
CGame1View();
DECLARE_DYNCREATE(CGame1View)
// Attributes
public:
CGame1Doc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{
{AFX_VIRTUAL(CGame1View)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CGame1View();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{
{AFX_MSG(CGame1View)
afx_msg void OnTimer(UINT nIDEvent);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private://012色号代表红绿蓝
int background;//背景色号
int movecolor;//移动块色号
int movecolorselect;//移动块选择位置012代表左右下
int haveselect;//判断是否有按下方向键
int select;//玩家所选号
int kuan;//客户区的宽度
int leftku