#include <crosshair.h>
Inheritance diagram for Crosshair:
Public Methods | |
Crosshair (ObjectManager &) | |
~Crosshair () | |
double | GetRadius () const |
int | SetPosition (double x, double y) |
Sets the position of the sprite in Subworld-Space. | |
void | think () |
int | Recenter () |
Recenter the object based on the subworld. | |
virtual Rect | draw (Graphics &GD) |
draws onto a given Graphics Device | |
virtual Rect | draw (Surface *s) |
Draws onto a given Surface. | |
virtual void | animate () |
Calls the animate sprite function. | |
Sprite * | getSprite () const |
Returns a pointer to the sprite object. | |
string | getName () const |
Returns a string that defines the name of this object. | |
void | SetDead (bool b) |
If this field is true, the object manager will remove this object from its list. | |
bool | IsDead () const |
Returns the status of dead. | |
Rect | GetBoundingRect () |
Get the bounding rectangle of the object. | |
bool | IsCollidable () |
Returns the status of collision. | |
void | SetCollidable (bool b) |
Sets the collision status of this object. | |
bool | IsDamagable () const |
Returns the damagable status of this object. | |
void | SetDamagable (bool b) |
Sets the damagable status of this object. | |
int | GetXint () const |
Returns the X position rounded to an integer. | |
int | GetYint () const |
Returns the Y position rounded to an integer. | |
double | GetX () const |
Returns the actual X position as a double. | |
double | GetY () const |
Returns the actual Y position as a double. | |
int | GetLayer () const |
Returns the layer of the object. | |
void | SetLayer (int l) |
Sets the layer of the object. | |
void | Damage (double howmuch=1) |
Damages the object. | |
void | SetDamage (double howhigh=1) |
Sets how much damage an object can take. | |
Protected Attributes | |
Sprite * | sprite |
Access this only when necessary. | |
double | Xpos |
X/Y positions for object. | |
double | Ypos |
X/Y positions for object. | |
int | Xposi |
X/Y positions as rounded integers. | |
int | Yposi |
X/Y positions as rounded integers. | |
ObjectManager & | OM |
Reference to the ObjMgr. | |
Private Attributes | |
double | radius |
|
Definition at line 8 of file crosshair.cpp. References CROSSHAIR_IMG_FILE, radius, Sprite::SetFrame(), GameObject::SetLayer(), GameObject::sprite, and Util_parseImage(). |
|
Definition at line 20 of file crosshair.cpp. |
|
Calls the animate sprite function. Calls the animation function of a sprite if the object has a sprite.
|
|
Damages the object. Damages the object with a default power of 1
Definition at line 98 of file object.cpp. References GameObject::damage, GameObject::IsDamagable(), and GameObject::SetDead(). Referenced by ExplodeObject::think(). |
|
Draws onto a given Surface. Draws the sprite of the current object if it has one.
|
|
draws onto a given Graphics Device Draws the sprite of the current object if it has one.
|
|
Get the bounding rectangle of the object. If the object has a sprite, this returns bounding box that describes the current frame of the sprite. Otherwise, returns Rect(0,0,0,0). NOTE: the rect that is returned is in SubWorld space.
Definition at line 51 of file object.cpp. References Sprite::GetHeight(), ObjectManager::GetSubWorld(), Sprite::GetWidth(), Sprite::GetX(), Sprite::GetY(), GameObject::OM, Rect, SubWorld::ScreenToSubWorld(), GameObject::sprite, and Util_BuildRect(). |
|
Returns the layer of the object.
Definition at line 88 of file object.cpp. References GameObject::layer. Referenced by ObjectManager::AddToAnyObjectList(), and ObjectManager::think(). |
|
Returns a string that defines the name of this object.
|
|
Definition at line 17 of file crosshair.h. References radius. |
|
Returns a pointer to the sprite object.
Definition at line 96 of file object.h. Referenced by MainChar::FireWeapon(). |
|
Returns the actual X position as a double.
Definition at line 68 of file object.cpp. References GameObject::Xpos. Referenced by MainChar::FireWeapon(), Game::GameLoop(), Recenter(), MainChar::think(), think(), and Bear::think(). |
|
Returns the X position rounded to an integer.
Definition at line 78 of file object.cpp. References GameObject::Xposi. Referenced by Game::GameLoop(), MainChar::think(), and ExplodeObject::think(). |
|
Returns the actual Y position as a double.
Definition at line 73 of file object.cpp. References GameObject::Ypos. Referenced by ObjectManager::AddToAnyObjectList(), MainChar::FireWeapon(), Game::GameLoop(), Recenter(), Bear::setWalk(), ObjectManager::think(), MainChar::think(), think(), and Bear::think(). |
|
Returns the Y position rounded to an integer.
Definition at line 83 of file object.cpp. References GameObject::Yposi. Referenced by Game::GameLoop(), MainChar::think(), and ExplodeObject::think(). |
|
Returns the status of collision.
|
|
Returns the damagable status of this object.
Definition at line 148 of file object.h. Referenced by GameObject::Damage(), and ExplodeObject::think(). |
|
Returns the status of dead.
Definition at line 119 of file object.h. Referenced by ExplodeObject::think(). |
|
Recenter the object based on the subworld. Will relocate the Sprite (if our object has one) to the correct location based on the SubWorld's background location. Reimplemented from GameObject. Definition at line 151 of file crosshair.cpp. References Sprite::GetHeight(), Sprite::GetWidth(), GameObject::GetX(), GameObject::GetY(), GameObject::Recenter(), Sprite::SetPosition(), and GameObject::sprite. |
|
Sets the collision status of this object.
Definition at line 142 of file object.h. Referenced by Bear::Bear(), and UFO::UFO(). |
|
Sets the damagable status of this object.
Definition at line 154 of file object.h. Referenced by Bear::Bear(), MainChar::MainChar(), and UFO::UFO(). |
|
Sets how much damage an object can take. Determines the amount of damage an object can take before SetDead(true) is called.
Definition at line 110 of file object.cpp. References GameObject::damage. Referenced by Bear::Bear(), MainChar::MainChar(), and UFO::UFO(). |
|
If this field is true, the object manager will remove this object from its list. If the object is dead, the ObjectManager should remove this object from memory.
Definition at line 113 of file object.h. Referenced by GameObject::Damage(), and ExplodeObject::think(). |
|
Sets the layer of the object.
Definition at line 93 of file object.cpp. References GameObject::layer. Referenced by Crosshair(). |
|
Sets the position of the sprite in Subworld-Space.
Reimplemented from GameObject. Definition at line 24 of file crosshair.cpp. References Sprite::GetFrame(), GameObject::SetPosition(), GameObject::sprite, GameObject::Xpos, and GameObject::Ypos. Referenced by Game::GameLoop(). |
|
Reimplemented from GameObject. Definition at line 41 of file crosshair.cpp. References Sprite::CountFrames(), Sprite::GetFrame(), GameObject::GetX(), GameObject::GetY(), nnctime::msecs, nnctime::secs, GameObject::sprite, NNCMath::SRoot(), Util_DiffTime(), Util_GetTime(), and Util_TimePassed(). |
|
Reference to the ObjMgr.
Definition at line 223 of file object.h. Referenced by MainChar::FireWeapon(), GameObject::GetBoundingRect(), GameObject::Recenter(), MainChar::Recenter(), MainChar::think(), ExplodeObject::think(), BearSpawnPoint::think(), and Bear::think(). |
|
Definition at line 22 of file crosshair.h. Referenced by Crosshair(), and GetRadius(). |
|
Access this only when necessary.
Definition at line 214 of file object.h. Referenced by Bear::Bear(), MainChar::ChangeDirection(), Crosshair(), ExplodeObject::ExplodeObject(), GameObject::GameObject(), GameObject::GetBoundingRect(), MainChar::MainChar(), GameObject::Recenter(), MainChar::Recenter(), Recenter(), MainChar::setLook(), SetPosition(), UFO::SetupDirection(), Bear::setWalk(), MainChar::setWalking(), think(), UFO::UFO(), and GameObject::~GameObject(). |
|
X/Y positions for object.
Definition at line 217 of file object.h. Referenced by GameObject::GameObject(), GameObject::GetX(), GameObject::SetPosition(), SetPosition(), BearSpawnPoint::think(), and Bear::think(). |
|
X/Y positions as rounded integers.
Definition at line 220 of file object.h. Referenced by GameObject::GetXint(), and GameObject::SetPosition(). |
|
X/Y positions for object.
Definition at line 217 of file object.h. Referenced by GameObject::GameObject(), GameObject::GetY(), GameObject::Recenter(), GameObject::SetPosition(), SetPosition(), BearSpawnPoint::think(), and Bear::think(). |
|
X/Y positions as rounded integers.
Definition at line 220 of file object.h. Referenced by GameObject::GetYint(), and GameObject::SetPosition(). |