SDL SPOOKY PLATFORMER ENGINE  0.2.0
An implementation of a platformer using sdl, implemented using an entity component system and efficient collision management.
Component.hpp
Go to the documentation of this file.
1 #ifndef COMPONENT_HPP
2 #define COMPONENT_HPP
3 
4 #define FIXED_TIMESTEP 1
5 
6 #include "SDL2/SDL.h"
7 
8 class GameObject;
9 
10 /*
11  * The base class for all components.
12  */
13 class Component
14 {
15 public:
16 
17  Component();
19  virtual void Update(float deltaTime) = 0;
20 
22  virtual void Render(SDL_Renderer* ren);
23  virtual ~Component();
24  friend class GameObject;
25 
26 protected:
29 
30 private:
31 };
32 
33 #endif
GameObject * entity
The entitity to which this component belongs to.
Definition: Component.hpp:28
virtual ~Component()
Definition: Component.cpp:6
virtual void Render(SDL_Renderer *ren)
Render this component in the screen if it can be rendered.
Definition: Component.cpp:9
virtual void Update(float deltaTime) = 0
Update this component according to the deltaTime.
Component()
Definition: Component.cpp:3
Definition: Component.hpp:13
Definition: GameObject.hpp:12