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

📄 entity.h

📁 “恐怖之战”游戏源码
💻 H
字号:
#ifndef __ENTITY_H
#define __ENTITY_H

#include <stdlib.h>
#include <time.h>
#include <typeinfo.h>

#include "md2.h"
#include "object.h"
#include "camera.h"
#include "audiosystem.h"
#include "terrain.h"

class CEntity : public CMD2Model
{
protected:
	void OnAnimate(float deltaTime);
	void OnDraw(CCamera *camera);
	void OnCollision(CObject *collisionObject);
	void OnPrepare();

	void PlaySound() { audioSys->Play(entitySound, 1); }

public:
	float direction;		// angle the entity is facing (in degrees)
	CAudio *entitySound;	// the sound the entity makes
						// currently only supports one sound
						// per entity
	CAudioSystem *audioSys;	// a pointer to the audio system


	CEntity();
	~CEntity();

	int stateStart, stateEnd;	// state keyframe start/end
	float deltaT;
	float animSpeed;

	void LoadAudio(CAudioSystem *audioSystem, char *filename, bool is3DSound);
	void SetAudioSystem(CAudioSystem *asys) { audioSys = asys; }
};

#endif

⌨️ 快捷键说明

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