|
Arcade Shooter
|
Base class for all objects that will be updated and rendered on a GameplayScreen. More...
#include <GameObject.h>
Public Member Functions | |
| virtual void | SetDeactivateCallback (OnDeactivate callback) |
| Sets the callback function for when the menu item is selected. More... | |
| virtual void | Update (const GameTime *pGameTime) |
| Updates the game object. More... | |
| virtual void | Draw (SpriteBatch *pSpriteBatch)=0 |
| Renders the game object. More... | |
| virtual bool | IsActive () const |
| Determines if the game object is active. More... | |
| virtual void | Activate () |
| Activates the game object. | |
| virtual void | Deactivate () |
| Deactivates the game object. | |
| virtual Vector2 & | GetPosition () |
| Gets the position of the game object. More... | |
| virtual Vector2 & | GetPreviousPosition () |
| Gets the previous position of the game object. More... | |
| virtual std::string | ToString () const =0 |
| Gets a string representation of the game object. More... | |
| virtual Vector2 | GetHalfDimensions () const |
| Gets the half dimensions of the game object. More... | |
| virtual uint32_t | GetIndex () const |
| Gets the index of the game object. More... | |
| virtual CollisionType | GetCollisionType () const =0 |
| Gets the collision type mask. More... | |
| virtual float | GetCollisionRadius () const |
| Gets the collision radius. More... | |
| virtual void | Hit (const float damage) |
| Hits the object, dealing damage to it. More... | |
| virtual bool | HasMask (CollisionType mask) const |
| Determines if the object contains part of a collision bit-mask. More... | |
| virtual bool | IsMask (CollisionType mask) const |
| Determines if the object matches a collision bit-mask. More... | |
| virtual bool | IsDrawnByLevel () const |
| Determines if the level should draw the game object. More... | |
Static Public Member Functions | |
| static void | SetCurrentLevel (Level *pLevel) |
| Sets the current game level. More... | |
| static Level * | GetCurrentLevel () |
| Gets the current level. More... | |
Protected Member Functions | |
| virtual void | SetCollisionRadius (const int radius) |
| Sets the collision radius for the object. More... | |
| virtual void | SetPosition (const float x, const float y) |
| Sets the screen position of the object. More... | |
| virtual void | SetPosition (const Vector2 &position) |
| Sets the screen position of the object. More... | |
| virtual void | TranslatePosition (const float x, const float y) |
| Offsets the current screen position of the object. More... | |
| virtual void | TranslatePosition (const Vector2 &offset) |
| Offsets the current screen position of the object. More... | |
| virtual bool | IsOnScreen () const |
| Determines if the game object is on the screen. More... | |
Friends | |
| class | Game |
Base class for all objects that will be updated and rendered on a GameplayScreen.
|
pure virtual |
Renders the game object.
| pSpriteBatch | The game's sprite batch, used for rendering. |
|
inlinevirtual |
Gets the collision radius.
|
pure virtual |
Gets the collision type mask.
Implemented in ShooterLibrary::PlayerShip, ShooterLibrary::Ship, ShooterLibrary::EnemyShip, ShooterLibrary::Projectile, and Sample::PowerUp.
|
inlinestatic |
Gets the current level.
|
virtual |
Gets the half dimensions of the game object.
Reimplemented in Sample::PlayerShip, and ShooterLibrary::PlayerShip.
|
inlinevirtual |
Gets the index of the game object.
|
inlinevirtual |
Gets the position of the game object.
|
inlinevirtual |
Gets the previous position of the game object.
|
inlinevirtual |
Determines if the object contains part of a collision bit-mask.
| mask | The mask to test. |
|
inlinevirtual |
Hits the object, dealing damage to it.
| damage | The amount of damage to inflict. |
Reimplemented in Sample::PlayerShip, ShooterLibrary::EnemyShip, Sample::BioEnemyShip, and ShooterLibrary::Ship.
|
inlinevirtual |
Determines if the game object is active.
|
inlinevirtual |
Determines if the level should draw the game object.
Reimplemented in ShooterLibrary::Projectile.
|
inlinevirtual |
Determines if the object matches a collision bit-mask.
| mask | The mask to test. |
|
protectedvirtual |
Determines if the game object is on the screen.
|
inlineprotectedvirtual |
Sets the collision radius for the object.
| radius | The collision radius. |
|
inlinestatic |
Sets the current game level.
| pLevel | A pointer to the current level. |
|
inlinevirtual |
Sets the callback function for when the menu item is selected.
| callback | The callback function. |
|
protectedvirtual |
Sets the screen position of the object.
| x | The horizontal position. |
| y | The vertical position. |
|
protectedvirtual |
Sets the screen position of the object.
| position | The new position. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
pure virtual |
Gets a string representation of the game object.
Implemented in Sample::PowerUp, ShooterLibrary::Ship, ShooterLibrary::EnemyShip, ShooterLibrary::Projectile, ShooterLibrary::PlayerShip, and Sample::Missile.
|
protectedvirtual |
Offsets the current screen position of the object.
| x | The horizontal distance to offset. |
| y | The vertical distance to offset. |
|
protectedvirtual |
Offsets the current screen position of the object.
| offset | The offset. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
virtual |
Updates the game object.
| pGameTime | Timing values including time since last update. |
1.8.13