Person Class Reference

#include <Person.h>

Inheritance diagram for Person:

Object Enemy Player List of all members.

Public Member Functions

 Person (List *personInfo, int x, int y)
void draw ()
void collide (Object *o)
virtual void update ()
void jump (xDirection xDir)
void jumpReset ()
void crouch ()
void uncrouch ()
void shoot ()
void load (List *personInfo)
void setVelocity (int x, int y)
int getHealth ()
void addHealth (int dHealth)
void incrVelocity (int xVel, int yVel)
void setXDirection (xDirection xDir)
int getAccel ()
void aim (yDirection direction)

Protected Member Functions

virtual void die ()
bool touchingAbove ()
bool touchingBelow ()
bool touchingLeft ()
bool touchingRight ()

Protected Attributes

int _xVelocity
int _yVelocity
int _maxXVel
int _maxYVel
int _maxFallRate
int _previousX
int _previousY
xDirection _xDirection
xDirection _prevXDirection
yDirection _yDirection
State _state
bool _crouching
int _health
int _gravity
int _accel
int _airAccel
double _groundDrag
double _airDrag
int _waitShoot
int _framesSinceShoot
int _jumpTimer
int _maxJumpTime
bool _jumpReset
bool _wallJumpReset
int _bulletSpeed
Sprite_sprite

Detailed Description

Definition at line 10 of file Person.h.


Constructor & Destructor Documentation

Person::Person List personInfo,
int  x,
int  y
 

Definition at line 44 of file Person.cpp.

References Object::_box, Object::_collidable, _previousX, _previousY, and load().


Member Function Documentation

void Person::addHealth int  dHealth  )  [inline]
 

Definition at line 30 of file Person.h.

References _health.

Referenced by AddHealthCommand::execute().

void Person::aim yDirection  direction  )  [inline]
 

Definition at line 42 of file Person.h.

References _yDirection.

Referenced by AimCommand::execute().

void Person::collide Object o  )  [virtual]
 

Reimplemented from Object.

Definition at line 132 of file Person.cpp.

References Object::_box, _previousX, _previousY, Object::_type, _xVelocity, _yVelocity, DOOR, ENEMY, Object::getBox(), Object::getType(), glfuncs::intersectX(), glfuncs::intersectY(), PLAYER, and TILE.

void Person::crouch  ) 
 

Make the person crouch

Definition at line 352 of file Person.cpp.

References Object::_box, _crouching, _sprite, and Sprite::setHeight().

Referenced by CrouchCommand::execute().

void Person::die  )  [protected, virtual]
 

Schedules the calling object for deletion.

Reimplemented in Enemy.

Definition at line 376 of file Person.cpp.

References Object::_collidable, Level::instance(), and Level::scheduleDelete().

Referenced by Enemy::die(), and update().

void Person::draw  )  [virtual]
 

Implements Object.

Definition at line 169 of file Person.cpp.

References Object::_box, _sprite, _state, _xDirection, ShowOneSprite::draw(), FALLING, JUMPING, RUNNING, Sprite::setDirection(), ShowOneSprite::show(), and STANDING.

int Person::getAccel  ) 
 

Definition at line 270 of file Person.cpp.

References _accel, _airAccel, and touchingBelow().

Referenced by MoveCommand::execute().

int Person::getHealth  )  [inline]
 

Definition at line 29 of file Person.h.

References _health.

Referenced by Level::drawHUD().

void Person::incrVelocity int  xVel,
int  yVel
 

Definition at line 256 of file Person.cpp.

References _maxFallRate, _maxXVel, _xVelocity, and _yVelocity.

Referenced by MoveCommand::execute(), and update().

void Person::jump xDirection  xDir  ) 
 

Definition at line 278 of file Person.cpp.

References _jumpReset, _jumpTimer, _maxJumpTime, _maxXVel, _maxYVel, _prevXDirection, _wallJumpReset, _xDirection, _xVelocity, _yVelocity, LEFT, RIGHT, touchingBelow(), touchingLeft(), and touchingRight().

Referenced by JumpCommand::execute().

void Person::jumpReset  ) 
 

Definition at line 332 of file Person.cpp.

References _jumpReset, _jumpTimer, _maxJumpTime, and _wallJumpReset.

Referenced by JumpResetCommand::execute().

void Person::load List personInfo  )  [virtual]
 

Reimplemented from Object.

Reimplemented in Enemy.

Definition at line 80 of file Person.cpp.

References _accel, _airAccel, _airDrag, _bulletSpeed, _gravity, _groundDrag, _health, _maxFallRate, _maxJumpTime, _maxXVel, _maxYVel, _sprite, _waitShoot, List::empty(), List::firstList(), Sprite::loadSprite(), and List::rest().

Referenced by Person().

void Person::setVelocity int  x,
int  y
[inline]
 

Definition at line 27 of file Person.h.

References _xVelocity, and _yVelocity.

Referenced by StopPersonCommand::execute().

void Person::setXDirection xDirection  xDir  )  [inline]
 

Definition at line 38 of file Person.h.

References _prevXDirection, and _xDirection.

Referenced by TurnCommand::execute(), and MoveCommand::execute().

void Person::shoot  ) 
 

Definition at line 339 of file Person.cpp.

References _bulletSpeed, _framesSinceShoot, _waitShoot, _xDirection, _yDirection, Level::instance(), and Level::registerObject().

Referenced by ShootCommand::execute().

bool Person::touchingAbove  )  [protected]
 

Definition at line 383 of file Person.cpp.

References Object::_box, and CollisionHandler::ObjsColliding().

Referenced by uncrouch().

bool Person::touchingBelow  )  [protected]
 

Definition at line 390 of file Person.cpp.

References Object::_box, and CollisionHandler::ObjsColliding().

Referenced by getAccel(), jump(), and update().

bool Person::touchingLeft  )  [protected]
 

Definition at line 397 of file Person.cpp.

References Object::_box, and CollisionHandler::ObjsColliding().

Referenced by jump().

bool Person::touchingRight  )  [protected]
 

Definition at line 404 of file Person.cpp.

References Object::_box, and CollisionHandler::ObjsColliding().

Referenced by jump().

void Person::uncrouch  ) 
 

Uncrouches the person

Definition at line 362 of file Person.cpp.

References Object::_box, _crouching, _sprite, Sprite::setHeight(), and touchingAbove().

Referenced by CrouchCommand::execute().

void Person::update  )  [virtual]
 

Reimplemented from Object.

Reimplemented in Enemy.

Definition at line 195 of file Person.cpp.

References _airDrag, Object::_box, _framesSinceShoot, _gravity, _groundDrag, _health, _previousX, _previousY, _state, _xVelocity, _yVelocity, CollisionHandler::checkCollision(), die(), FALLING, Screen::FRAMERATE, incrVelocity(), CollisionHandler::instance(), JUMPING, STANDING, and touchingBelow().

Referenced by Enemy::update().


Member Data Documentation

int Person::_accel [protected]
 

Definition at line 81 of file Person.h.

Referenced by getAccel(), and load().

int Person::_airAccel [protected]
 

Definition at line 82 of file Person.h.

Referenced by getAccel(), and load().

double Person::_airDrag [protected]
 

Definition at line 84 of file Person.h.

Referenced by load(), and update().

int Person::_bulletSpeed [protected]
 

Definition at line 94 of file Person.h.

Referenced by load(), and shoot().

bool Person::_crouching [protected]
 

Definition at line 66 of file Person.h.

Referenced by Player::control(), crouch(), and uncrouch().

int Person::_framesSinceShoot [protected]
 

Definition at line 87 of file Person.h.

Referenced by shoot(), and update().

int Person::_gravity [protected]
 

Definition at line 80 of file Person.h.

Referenced by load(), and update().

double Person::_groundDrag [protected]
 

Definition at line 83 of file Person.h.

Referenced by load(), and update().

int Person::_health [protected]
 

Definition at line 78 of file Person.h.

Referenced by addHealth(), getHealth(), load(), and update().

bool Person::_jumpReset [protected]
 

Definition at line 91 of file Person.h.

Referenced by jump(), and jumpReset().

int Person::_jumpTimer [protected]
 

Definition at line 89 of file Person.h.

Referenced by jump(), and jumpReset().

int Person::_maxFallRate [protected]
 

Definition at line 56 of file Person.h.

Referenced by incrVelocity(), and load().

int Person::_maxJumpTime [protected]
 

Definition at line 90 of file Person.h.

Referenced by jump(), jumpReset(), and load().

int Person::_maxXVel [protected]
 

Definition at line 54 of file Person.h.

Referenced by incrVelocity(), jump(), and load().

int Person::_maxYVel [protected]
 

Definition at line 55 of file Person.h.

Referenced by jump(), and load().

int Person::_previousX [protected]
 

Definition at line 58 of file Person.h.

Referenced by collide(), Person(), and update().

int Person::_previousY [protected]
 

Definition at line 59 of file Person.h.

Referenced by collide(), Person(), and update().

xDirection Person::_prevXDirection [protected]
 

Definition at line 62 of file Person.h.

Referenced by jump(), and setXDirection().

Sprite* Person::_sprite [protected]
 

Definition at line 96 of file Person.h.

Referenced by crouch(), draw(), load(), and uncrouch().

State Person::_state [protected]
 

Definition at line 64 of file Person.h.

Referenced by Player::control(), draw(), and update().

int Person::_waitShoot [protected]
 

Definition at line 86 of file Person.h.

Referenced by load(), and shoot().

bool Person::_wallJumpReset [protected]
 

Definition at line 92 of file Person.h.

Referenced by jump(), and jumpReset().

xDirection Person::_xDirection [protected]
 

Definition at line 61 of file Person.h.

Referenced by Player::control(), draw(), jump(), setXDirection(), and shoot().

int Person::_xVelocity [protected]
 

Definition at line 52 of file Person.h.

Referenced by collide(), incrVelocity(), jump(), setVelocity(), and update().

yDirection Person::_yDirection [protected]
 

Definition at line 63 of file Person.h.

Referenced by aim(), and shoot().

int Person::_yVelocity [protected]
 

Definition at line 53 of file Person.h.

Referenced by collide(), incrVelocity(), jump(), setVelocity(), and update().


The documentation for this class was generated from the following files:
Generated on Sat Apr 22 15:05:21 2006 for ProjectX by  doxygen 1.4.6-NO