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

📄 player.h

📁 吃豆子游戏源码
💻 H
字号:
/**
 *	File	:	Player.h
 *  Author	:	Kevin Lynx
 *	Date	:	2007/7/30
 */
#ifndef	_PLAYER_H_
#define _PLAYER_H_

#include "Sprite.h"
#include "Singleton.h"

/**
 * Player class, implements our hero
 *
 */
class Player : public Singleton<Player>, public Sprite, public SpriteStatus
{
public:
	enum
	{
		INIT_LIFE = 5,
		INIT_MAX_FIRE = 2,
		B_4SIDES_FIRE_TIME = 30 // 30s
	};
public:
	/**
	 * Constructor
	 *
	 */
	Player();

	/**
	 * Destructor
	 *
	 */
	~Player();

	/**
	 * init , create meshes etc...
	 *
	 */
	bool	init( ISceneManager *smgr, IAnimatedMesh *mesh, ITexture *texture );
	void	update( float dt );
	
	void	reset( bool timeOut = false );
	/**
	 * kill
	 *
	 * kill the pacman, make its life -1
	 * @return when the life is 0, return true
	 */
	bool	kill();

	/**
	 * addScore
	 *
	 */
	void	addScore( int score );

	/**
	 * sendBonus
	 *
	 * the player got a bonus, BonusManager send that gift to the player
	 */
	void	sendBonus( int type );

	/// i want to make the aabb smller , so i overload it
	aabbox3df getWorldAABB();
	void	  setPosition( const vector3df &pos );
	/// when the player is dead, it will return a wrong array position
	void	  getArrayPos( int &ax, int &az );

public:
	int		mLife;
	int		mScore;
	int		mMaxFire;

	bool    m4SidesFire;
	f32	    m4SidesTime;

	/// god mod
	bool	mbGOD;
};

#endif // end _PLAYER_H_

⌨️ 快捷键说明

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