SDL SPOOKY PLATFORMER ENGINE  0.2.0
An implementation of a platformer using sdl, implemented using an entity component system and efficient collision management.
Public Member Functions | Public Attributes | Friends | List of all members
HealthComponent Class Reference

#include <HealthComponent.hpp>

Inheritance diagram for HealthComponent:
Component

Public Member Functions

 HealthComponent (unsigned int maxHealth)
 Creates a health component with the given maximumHealth. More...
 
 ~HealthComponent ()
 
void Update (float deltaTime)
 Update this component according to the deltaTime. More...
 
void HealthDown ()
 Reduces this component's health by one. If this reduces it to zero end the game. More...
 
- Public Member Functions inherited from Component
 Component ()
 
virtual void Render (SDL_Renderer *ren)
 Render this component in the screen if it can be rendered. More...
 
virtual ~Component ()
 

Public Attributes

bool invincible
 

Friends

class HealthUpdate
 

Additional Inherited Members

- Protected Attributes inherited from Component
GameObjectentity
 The entitity to which this component belongs to. More...
 

Constructor & Destructor Documentation

HealthComponent::HealthComponent ( unsigned int  maxHealth)

Creates a health component with the given maximumHealth.

HealthComponent::~HealthComponent ( )

Member Function Documentation

void HealthComponent::HealthDown ( )

Reduces this component's health by one. If this reduces it to zero end the game.

void HealthComponent::Update ( float  deltaTime)
virtual

Update this component according to the deltaTime.

Implements Component.

Friends And Related Function Documentation

friend class HealthUpdate
friend

Member Data Documentation

bool HealthComponent::invincible

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