Represents a game object in the game. This is the base class for all objects that can be updated, rendered, and checked for collisions.
More...
#include <GameObject.h>
Represents a game object in the game. This is the base class for all objects that can be updated, rendered, and checked for collisions.
Definition at line 14 of file GameObject.h.
◆ GameObject()
| GameObject::GameObject |
( |
| ) |
|
◆ ~GameObject()
| virtual GameObject::~GameObject |
( |
| ) |
|
|
inlinevirtual |
◆ Activate()
| virtual void GameObject::Activate |
( |
| ) |
|
|
inlinevirtual |
◆ Deactivate()
| virtual void GameObject::Deactivate |
( |
| ) |
|
|
inlinevirtual |
◆ Draw()
| virtual void GameObject::Draw |
( |
SpriteBatch & | spriteBatch | ) |
|
|
pure virtual |
◆ GetCollisionRadius()
| virtual float GameObject::GetCollisionRadius |
( |
| ) |
const |
|
inlinevirtual |
Get the collision radius of the object.
- Returns
- The collision radius of the object.
Definition at line 80 of file GameObject.h.
◆ GetCollisionType()
◆ GetCurrentLevel()
| static Level * GameObject::GetCurrentLevel |
( |
| ) |
|
|
inlinestatic |
Get the current level.
- Returns
- A pointer to the current level.
Definition at line 30 of file GameObject.h.
◆ GetHalfDimensions()
| Vector2 GameObject::GetHalfDimensions |
( |
| ) |
const |
|
virtual |
◆ GetIndex()
| virtual uint32_t GameObject::GetIndex |
( |
| ) |
const |
|
inlinevirtual |
Get the index of the object. Each object is assigned a unique ID when created, starting at 0.
- Returns
- The index of the object.
Definition at line 72 of file GameObject.h.
◆ GetPosition()
| virtual Vector2 & GameObject::GetPosition |
( |
| ) |
|
|
inlinevirtual |
Get the position of the object.
- Returns
- The position of the object.
Definition at line 52 of file GameObject.h.
◆ GetPreviousPosition()
| virtual Vector2 & GameObject::GetPreviousPosition |
( |
| ) |
|
|
inlinevirtual |
Get the position of the object during the previous frame.
- Returns
- The previous position of the object.
Definition at line 56 of file GameObject.h.
◆ HasMask()
Check if the object has a specific collision bit-mask.
- Parameters
-
| mask | The bit-mask to check. |
- Returns
- True if the object has the specified bit-mask.
Definition at line 89 of file GameObject.h.
◆ Hit()
| virtual void GameObject::Hit |
( |
const float | damage | ) |
|
|
inlinevirtual |
Hits the object with a specified amount of damage.
- Parameters
-
| damage | The amount of damage to apply. |
Reimplemented in EnemyShip, and Ship.
Definition at line 84 of file GameObject.h.
◆ IsActive()
| virtual bool GameObject::IsActive |
( |
| ) |
const |
|
inlinevirtual |
Flag to determine if the object is active.
- Returns
- True if the object is active.
Definition at line 42 of file GameObject.h.
◆ IsDrawnByLevel()
| virtual bool GameObject::IsDrawnByLevel |
( |
| ) |
const |
|
inlinevirtual |
◆ IsMask()
◆ IsOnScreen()
| bool GameObject::IsOnScreen |
( |
| ) |
const |
|
protectedvirtual |
◆ SetCollisionRadius()
| virtual void GameObject::SetCollisionRadius |
( |
const int | radius | ) |
|
|
inlineprotectedvirtual |
◆ SetCurrentLevel()
| static void GameObject::SetCurrentLevel |
( |
Level * | pLevel | ) |
|
|
inlinestatic |
Set the current level.
- Parameters
-
| pLevel | A pointer to the current level. |
Definition at line 26 of file GameObject.h.
◆ SetPosition() [1/2]
| void GameObject::SetPosition |
( |
const float | x, |
|
|
const float | y ) |
|
protectedvirtual |
◆ SetPosition() [2/2]
| void GameObject::SetPosition |
( |
const Vector2 & | position | ) |
|
|
protectedvirtual |
◆ ToString()
| virtual std::string GameObject::ToString |
( |
| ) |
const |
|
pure virtual |
◆ TranslatePosition() [1/2]
| void GameObject::TranslatePosition |
( |
const float | x, |
|
|
const float | y ) |
|
protectedvirtual |
◆ TranslatePosition() [2/2]
| void GameObject::TranslatePosition |
( |
const Vector2 & | offset | ) |
|
|
protectedvirtual |
◆ Update()
| void GameObject::Update |
( |
const GameTime & | gameTime | ) |
|
|
virtual |
The documentation for this class was generated from the following files: