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

InputComponent class used to change velocity due to keyboard input. More...

#include <InputComponent.hpp>

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

Public Member Functions

 InputComponent ()
 Constuctor for InputComponent. More...
 
 ~InputComponent ()
 Destructor for InputComponent. More...
 
void StartUp ()
 Initializes attributes for InputComponent. More...
 
void Update (GameEntity &entity)
 Updates the GameEntity upon keypress. More...
 
void HandleEvent (GameEntity &entity)
 Handles the event for GameEntity. More...
 
- Public Member Functions inherited from Component
 Component ()=default
 Constuctor for Component class. More...
 
virtual void ShutDown ()
 To destroy and free attributes for children classes. More...
 
virtual void Render (GameEntity &entity)
 To render objects for children classes. More...
 
virtual void LoadImage (std::string filepath, SDL_Renderer *ren)
 To initalize loadImages for children classes. More...
 

Detailed Description

InputComponent class used to change velocity due to keyboard input.

Constructor & Destructor Documentation

◆ InputComponent()

InputComponent::InputComponent ( )

Constuctor for InputComponent.

◆ ~InputComponent()

InputComponent::~InputComponent ( )

Destructor for InputComponent.

Member Function Documentation

◆ HandleEvent()

void InputComponent::HandleEvent ( GameEntity entity)
virtual

Handles the event for GameEntity.

Changes GameEntity's velocity depending on key hit.

Parameters
entityGameEntity object
GameEntity&entity

Reimplemented from Component.

◆ StartUp()

void InputComponent::StartUp ( )
virtual

Initializes attributes for InputComponent.

Reimplemented from Component.

◆ Update()

void InputComponent::Update ( GameEntity entity)
virtual

Updates the GameEntity upon keypress.

Parameters
entityGameEntity object

Implements Component.


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