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

📄 gameengine.h

📁 一个symbian上成熟的小游戏源码
💻 H
字号:
/*
============================================================================
 Name        : GameEngine.h
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : CGameEngine declaration
============================================================================
*/

#ifndef MAZEENGINE_H
#define MAZEENGINE_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include <COECNTRL.H>//For CCoeControl

#include "ImageFactory.h"
#include "GcBuffer.h"
using namespace gamespace;

#include "Hero.h"

namespace mygame
{

class CGameEngine : public CBase,public MImageFactoryObserver
{
public: // Constructors and destructor
	~CGameEngine();
	static CGameEngine* NewL(const TRect& aRect,CCoeControl* iControl);
	static CGameEngine* NewLC(const TRect& aRect,CCoeControl* iControl);

private:
	CGameEngine(const TRect& aRect,CCoeControl* iControl);
	void ConstructL();

public://From Base
	void ConvertCompleted(TInt aCurrent,TInt aCount);
	void ConvertFail(TInt aCurrent,TInt aCount,const TDesC& aDes);

public://New Function
	void Draw(CWindowGc& aGc) const;

private://New Function
	static TInt CallBack(TAny* aAny);

private:
	CImageFactory* iImageFactory;
	TBool iBLoadImageOK;

	//=====视窗定义=======vw视窗//
	TInt iVwX;//可视窗口的坐上角坐标
	TInt iVwY;
	TInt iVwWidth;//可视窗口的宽高
	TInt iVwHeight;

	//======精灵定义===========//
	
	enum TDirection
	{
		ELeft,
		ERight,
		EUp,
		EDown
	};

	TDirection iDirection;//移动方向
	TInt iCarX;//坐标
	TInt iCarY;
	
	CHero* iHero;//精灵层
	CGcBuffer* iBuffer;
	CTiledLayer* iBgLayer;//草地层
	CTiledLayer* iCollidLayer;//墙层
	//CLayer*	iTopLayer;

	CPeriodic* iTimer;
	//容器窗口
	CCoeControl* iControl;
};

}
#endif // MAZEENGINE_H

⌨️ 快捷键说明

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