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

📄 gamesession.h

📁 基于引擎基础上开发的三维游戏实例“恐怖之战”游戏者可以自爱三维地形上漫游
💻 H
字号:
// GameSession.h: interface for the CGameSession class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_GAMESESSION_H__016E469D_4F18_46F3_B548_8AD3F68C3CB0__INCLUDED_)
#define AFX_GAMESESSION_H__016E469D_4F18_46F3_B548_8AD3F68C3CB0__INCLUDED_

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


#include "GameSection.h"
#include "GameIntro.h"
#include <vcg/Point3.h>
#include <list>
#include "Bullet.h"
#include "Ast.h"
#include "Ship.h"
#include "Stars.h"
#include "Utility.h"
#include "Audio.h"
#include "Extern.h"

using namespace vcg;
using namespace std;
class CGameSession : public CGameSection  
{
public:
	CGameSession();
	virtual ~CGameSession();
	enum {AstNum=8};
	list<CBullet *> ActiveBullet;
	list<CAst *> ActiveAst;
	list<CGameObj *> ActiveObj;
    CStars SB;
	CShip *S;
	CUtility m_Utility;
	void Update(int dt);
	int Draw();
	void Clip(Point3f &p)
	{
		if(p.x() > SpaceSize) p.x() -=2*SpaceSize; 
		if(p.y() > SpaceSize) p.y() -=2*SpaceSize; 
		if(p.x() <-SpaceSize) p.x() +=2*SpaceSize; 
		if(p.y() <-SpaceSize) p.y() +=2*SpaceSize; 
	};

	void Shoot();
	void KeyDown(UINT nChar);
	void KeyUp(UINT nChar);
	void Reshape(int w, int h);
	void Init(int _score=0, int _lives=3);
	// 暂停游戏
	void Pause ()
	{PauseFlag =! PauseFlag;}
	// 结束游戏
	void End();
	int SpaceSize;
	void AstShipCollision(CAst *a);
	void BulletAstCollision(CBullet *b);
	int deadpause;	
	int endlevelpause;
	// 是否暂停
	bool PauseFlag;
	// 当前积分
	int Score;
	// 当前的生命数
	int Lives	;
};

#endif // !defined(AFX_GAMESESSION_H__016E469D_4F18_46F3_B548_8AD3F68C3CB0__INCLUDED_)

⌨️ 快捷键说明

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