Game Engine 2D Platformer
Public Member Functions | Public Attributes | List of all members
LifeDisplayComponent Class Reference

LifeDisplayComponent class used to show character's HP. More...

#include <LifeDisplayComponent.hpp>

Inheritance diagram for LifeDisplayComponent:
Inheritance graph
[legend]
Collaboration diagram for LifeDisplayComponent:
Collaboration graph
[legend]

Public Member Functions

 LifeDisplayComponent (SDL_Renderer *ren, std::string path)
 Constuctor for LifeDisplayComponent. More...
 
 ~LifeDisplayComponent ()
 Destructor for LifeDisplayComponent. More...
 
void StartUp ()
 Initializes the attributes for LifeDisplayComponent. More...
 
void ShutDown ()
 Destroys and frees attributes for LifeDisplayComponent. More...
 
void Update (GameEntity &entity)
 Updates the LifeDisplayComponent. More...
 
void Render (GameEntity &entity)
 Renders the LifeDisplayComponent. More...
 
- Public Member Functions inherited from Component
 Component ()=default
 Constuctor for Component class. More...
 
virtual void LoadImage (std::string filepath, SDL_Renderer *ren)
 To initalize loadImages for children classes. More...
 
virtual void HandleEvent (GameEntity &entity)
 Handle the events of GameEntity object for children classes. More...
 

Public Attributes

SDL_Rect rect1
 
SDL_Rect rect2
 
SDL_Rect rect3
 

Detailed Description

LifeDisplayComponent class used to show character's HP.

Constructor & Destructor Documentation

◆ LifeDisplayComponent()

LifeDisplayComponent::LifeDisplayComponent ( SDL_Renderer *  ren,
std::string  path 
)

Constuctor for LifeDisplayComponent.

Parameters
renRenderer of the Main Game Loop
pathPath to the texture to be loaded

◆ ~LifeDisplayComponent()

LifeDisplayComponent::~LifeDisplayComponent ( )

Destructor for LifeDisplayComponent.

Member Function Documentation

◆ Render()

void LifeDisplayComponent::Render ( GameEntity entity)
virtual

Renders the LifeDisplayComponent.

Renders lives left, based on the number of lives a GameEntity has.

Parameters
entityGameEntity Object
GameEntity&entity

Reimplemented from Component.

◆ ShutDown()

void LifeDisplayComponent::ShutDown ( )
virtual

Destroys and frees attributes for LifeDisplayComponent.

Reimplemented from Component.

◆ StartUp()

void LifeDisplayComponent::StartUp ( )
virtual

Initializes the attributes for LifeDisplayComponent.

Reimplemented from Component.

◆ Update()

void LifeDisplayComponent::Update ( GameEntity entity)
virtual

Updates the LifeDisplayComponent.

Parameters
entityGameEntity Object

Implements Component.

Member Data Documentation

◆ rect1

SDL_Rect LifeDisplayComponent::rect1

◆ rect2

SDL_Rect LifeDisplayComponent::rect2

◆ rect3

SDL_Rect LifeDisplayComponent::rect3

The documentation for this class was generated from the following files: