www.pudn.com > MyGame.rar > GameSession.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#include #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
ActiveBullet; list ActiveAst; list 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_)