Simple C++ Game
|
A system that uses player input to drive a paddle. More...
#include <PlayerInputSystem.hpp>
Public Member Functions | |
PlayerInputSystem () | |
Construct a new PlayerInputSystem. | |
![]() | |
IteratingSystem () | |
Construct a new IteratingSystem with the default EntitySystem constructor. More... | |
IteratingSystem (const std::shared_ptr< EntityFamily > &family) | |
Construct a new IteratingSystem with the EntityFamily EntitySystem constructor. More... | |
void | update (const sf::Time deltaTime) |
Iterates through each element in the system to perform updates. More... | |
![]() | |
EntitySystem () | |
Construct a new default EntitySystem. More... | |
EntitySystem (const std::shared_ptr< EntityFamily > &family) | |
Construct a new EntitySystem that acts on a specified family. More... | |
virtual void | engineEntityAdded (const std::shared_ptr< Entity > &entity) |
Performs any operations required after an entity has been added to an EntityEngine the system is a part of. More... | |
Protected Member Functions | |
void | process (std::shared_ptr< Entity > &entity, sf::Time deltaTime) |
Updates the behavior of a player paddle based on the current keyboard inputs. More... | |
![]() | |
virtual std::map< int, std::shared_ptr< Entity > > | getEntities () const |
Get the Entities in the system. More... | |
A system that uses player input to drive a paddle.
It acts on entities with a LocationComponent, VelocityComponent, and PlayerComponent.
|
protectedvirtual |
Updates the behavior of a player paddle based on the current keyboard inputs.
The paddle moves up if W or Up are pressed and down if S or Down are pressed.
entity | The current player being processed |
deltaTime | The time that has passed since process() was last called on this entity. |
Implements IteratingSystem.