Game Development Reference
In-Depth Information
What Makes a Dude a Dude?
We now turn our attention to CDude and CDudeCollection . There really isn't a lot
to CDude in our implementation. As we did with the weapons, we define an enu-
merated type for the three different types of Dudes.
typedef enum {
BAD_DUDE,
EVIL_DUDE,
ARCH_DUDE
} DUDE_TYPE;
The header file contains the usual suspects. The constructor takes the arguments
that set all the member variables. (Again, I have snipped the accessor functions.)
class CDude
{
public:
///////////////////
// Ctor/Dtor
///////////////////
CDude( DUDE_TYPE Type,
char* Name,
USHORT Health,
USHORT Location,
USHORT DistToGoal,
CWeapon* pWeapon );
virtual ~CDude();
//[Accessors snipped for spaceā€¦]
void SetAccAdjust();
private:
///////////////////
// Member Variables
///////////////////
Search WWH ::




Custom Search