Bullet Class Reference

#include <Bullet.h>

Inheritance diagram for Bullet:

Object List of all members.

Public Member Functions

 Bullet (Person *shooter, int bulletSpeed, xDirection xDir, yDirection yDir)
virtual void draw ()
virtual void update ()
virtual void collide (Object *o)
int getDamage ()

Protected Attributes

Person_shooter
Sprite_sprite
int _xVelocity
int _yVelocity
int _damage
xDirection _xDirection
yDirection _yDirection

Detailed Description

Definition at line 8 of file Bullet.h.


Constructor & Destructor Documentation

Bullet::Bullet Person shooter,
int  bulletSpeed,
xDirection  xDir,
yDirection  yDir
 

Definition at line 11 of file Bullet.cpp.

References Object::_box, _shooter, _sprite, Object::_type, _xDirection, _xVelocity, _yDirection, _yVelocity, BULLET, DOWN, Object::getBox(), Sprite::height(), LEFT, Sprite::loadSprite(), MIDDLE, Sprite::setDirection(), UP, and Sprite::width().


Member Function Documentation

void Bullet::collide Object o  )  [virtual]
 

Reimplemented from Object.

Definition at line 91 of file Bullet.cpp.

References Object::_collidable, _damage, _shooter, BULLET, ENEMY, Object::getType(), Level::instance(), PLAYER, and Level::scheduleDelete().

void Bullet::draw  )  [virtual]
 

Implements Object.

Definition at line 70 of file Bullet.cpp.

References Object::_box, _sprite, _xDirection, Sprite::draw(), and Sprite::setDirection().

int Bullet::getDamage  )  [inline]
 

Definition at line 15 of file Bullet.h.

References _damage.

void Bullet::update  )  [virtual]
 

Reimplemented from Object.

Definition at line 76 of file Bullet.cpp.

References Object::_box, _xVelocity, _yVelocity, CollisionHandler::checkCollision(), Screen::FRAMERATE, Screen::getScreenRect(), Level::instance(), Screen::instance(), CollisionHandler::instance(), glfuncs::intersect(), and Level::scheduleDelete().


Member Data Documentation

int Bullet::_damage [protected]
 

Definition at line 23 of file Bullet.h.

Referenced by collide(), and getDamage().

Person* Bullet::_shooter [protected]
 

Definition at line 15 of file Bullet.h.

Referenced by Bullet(), and collide().

Sprite* Bullet::_sprite [protected]
 

Definition at line 19 of file Bullet.h.

Referenced by Bullet(), and draw().

xDirection Bullet::_xDirection [protected]
 

Definition at line 24 of file Bullet.h.

Referenced by Bullet(), and draw().

int Bullet::_xVelocity [protected]
 

Definition at line 21 of file Bullet.h.

Referenced by Bullet(), and update().

yDirection Bullet::_yDirection [protected]
 

Definition at line 25 of file Bullet.h.

Referenced by Bullet().

int Bullet::_yVelocity [protected]
 

Definition at line 22 of file Bullet.h.

Referenced by Bullet(), 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