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

📄 shootview.h

📁 射击小游戏
💻 H
字号:
// ShootView.h : interface of the CShootView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_SHOOTVIEW_H__DD4EA454_E52C_44D3_A7BB_933D7193C95A__INCLUDED_)
#define AFX_SHOOTVIEW_H__DD4EA454_E52C_44D3_A7BB_933D7193C95A__INCLUDED_

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


#include "Bitmap.h"//////////

#include "ShootDoc.h"//////////////
//#include "BaseObject.h"
#include "Bullet.h"
#include "BulletSystem.h"
#include "Player.h"
#include "Enemy.h"
#include "Collision.h"
#include "BaoSystem.h"
class CShootView : public CView
{
	
protected: // create from serialization only
	CShootView();
	DECLARE_DYNCREATE(CShootView)

// Attributes
public:
	CShootDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CShootView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CShootView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CShootView)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnReset();
	afx_msg void OnPause();
	afx_msg void OnUpdatePause(CCmdUI* pCmdUI);
	afx_msg void OnLastinfor();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
protected:
	int m_iFPS;//游戏每秒祯数
	CDC* mdc;//内存缓冲区的设备上下文
//	CDC* dc;
	Bitmap*m_pbmpbg,*m_pbmppic,*m_pbmpwelcome;//背景图,游戏主贴图,欢迎界面的位图指针	
	int m_iScroll_X,m_iScroll_V;//背景滚动贴图使用的变量:剪切坐标,滚动速度
	int m_iLevel;//游戏级别
	int m_iBufKey, m_iCurKey;//记录按键缓冲与当前按键
	int m_iClientWidth,m_iClientHeight;//屏幕的宽和高
	bool m_bIsPause;//是否处于暂停状态
	bool m_b_GAME_STATE;//是否处于欢迎界面
public:
	int GetFPS(){return m_iFPS;}//获得当前的画面刷新率
	int GetClientWidth(){return m_iClientWidth;}//获得屏幕宽
	int GetClientHeight(){return m_iClientHeight;}//获得屏幕高
	friend class BaseObject;//BaseObject可以调用主控程序类的成员函数
	void DrawObject(BaseObject*obj);//将一个对象画到内存缓冲区中去
	void DrawAllToScreen();//将所有内存缓冲区上的图像都拷贝到屏幕上去

	void Clear();//清屏函数
	void Over();//显示GameOver画面
	void ResetPlayer();//重置角色
	void PlayerFire(Player *pPlayer);//主角开火
	void EnermyFire(Enermy *pEnermy);//敌机开火
	void ShowInformation();//显示当前游戏信息(主角生命值,游戏级别等)
	int GetLevel(){return m_iLevel;}//获得当前游戏级别
//	bool playresource(LPSTR lpname);
	BulletSystem*m_pPlayerBulletSystem, *m_pEnermyBulletSystem;//维护玩家子弹系统和敌机子弹系统
	EnermySystem*m_pEnermySystem;//敌人战斗机系统
	Player*m_pPlayer;//玩家
//	Player*pPlayer2;
	CollisionSystem *m_pCollisionSystem;//碰撞检测系统
	BaoSystem *m_pBaoSys;//宝箱系统
//	CString m_strName;
	BOOL m_bFirstTime;
};

#ifndef _DEBUG  // debug version in ShootView.cpp
inline CShootDoc* CShootView::GetDocument()
   { return (CShootDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_SHOOTVIEW_H__DD4EA454_E52C_44D3_A7BB_933D7193C95A__INCLUDED_)

⌨️ 快捷键说明

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