dEngine
Simple 2D C++ game engine
|
Gameobject component that asssists in adding additional functionality. More...
#include <Component.h>
Public Member Functions | |
Component (GameObject &parent) | |
Create a new component for a gameobject. More... | |
virtual void | NotifyCollision (GameObject &other) |
std::string | GetName () |
Returns the component's name. More... | |
virtual void | Start () |
Start the object To be called by the GameObject's Start method. This should be called at the beginning of instantiation. More... | |
virtual void | Update () |
virtual void | Render () |
Protected Attributes | |
GameObject & | parent |
std::string | name |
Gameobject component that asssists in adding additional functionality.
A component adds additional functionality to a Gameobject without being a defining factor of the object. This is an empty class and is meant to be extended upon depending upon the needs of the developer. For some examples see Sprite, SpriteSheet, or other preexisting components
Component::Component | ( | GameObject & | parent | ) |
Create a new component for a gameobject.
parent | The parent object that this component is on |
std::string Component::GetName | ( | ) |
Returns the component's name.
|
virtual |
Notify component that a collision has occurred
other | Reference to the object being collided with |
|
virtual |
Used for drawing to screen
Reimplemented in dengine::SpriteSheet, and dengine::Sprite.
|
virtual |
Start the object To be called by the GameObject's Start method. This should be called at the beginning of instantiation.
|
virtual |
Runs every frame performing any required logic
Reimplemented in dengine::InputController, and dengine::Collider.
|
protected |
|
protected |
Referenced by dengine::Sprite::Render(), dengine::SpriteSheet::Render(), and dengine::Collider::Update().