tbadguy.h
来自「symbian 的一个 二维飞行游戏 源码 及相关技术文章」· C头文件 代码 · 共 61 行
H
61 行
// Copyright 2002 Kenneth Guy,
//
// TBadGuy.h
#ifndef _TBADGUY_H_
#define _TBADGUY_H_
/** \file TBadGuy.h
defines class TBadGuy */
#include "TSprite32x24.h"
#include "TBadGuyFlags.h"
class TPlayersShip;
class TBullet;
class CGame;
/** Handles game objects.
All objects in the game except the players ship and bullets are handled
by this class. This includes bonus collectables so maybe TBadGuy wasn't
such a good name.
*/
class TBadGuy : public TSprite32x24 {
public:
TBadGuy();
void Move(TInt aPlayerX, TInt aPlayerY,const TInt16 *aPaths,CGame &aGame);
void Init(TInt16 aType,const TInt16 aArgs[]);
TInt16 Id();
void HitBullet(TBullet& aBullet, CGame &aGame);
void HitShip(TPlayersShip &aShip, CGame &aGame);
void Damage(TInt aHealth, CGame &aGame);
private:
void Die(CGame &aGame);
void SimpleMove(TInt16 aPlayerX, TInt16 aPlayerY);
void PathMove(TInt16 aPlayerX, TInt16 aPlayerY,
const TInt16 *aPaths, CGame &aGame);
private:
TInt16 iXVel; ///< Used for simple movement, or for speed of X homing
TInt16 iYVel; ///< Used for simple movement, or for speed of X homing
TUint16 iFlags; ///< Flags defined by TBadGuyFlags
TInt16 iHealth; ///< Health of bad guy if health <=0 bad guy dies
TInt16 iId; ///< Id of ground BadGuy belongs to (iId=0 if no group)
TInt16 iPath; ///< next path command to execute, used by path following badguys
TInt16 iScore; ///< Points awarded to player if bad guy is shot
TInt16 iCounter; ///< Variable for use by path commands
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?