vc++微游戏

先上图:


使用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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

紫云的博客

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值