summary refs log tree commit diff stats
path: root/src/systems/pondering.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-02-08 12:34:42 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-02-08 12:34:42 -0500
commitcefe66cdbb8786dc455657376e36f0ff8785d5bc (patch)
tree7e90536fad90f2954b3834dc4959f402883c32b3 /src/systems/pondering.cpp
parentcec0ed92c4035c4421d3cc2448f5423fcbb7f7d4 (diff)
downloadtherapy-cefe66cdbb8786dc455657376e36f0ff8785d5bc.tar.gz
therapy-cefe66cdbb8786dc455657376e36f0ff8785d5bc.tar.bz2
therapy-cefe66cdbb8786dc455657376e36f0ff8785d5bc.zip
Introduced animated sprites
Also restyled a lot of the code.
Diffstat (limited to 'src/systems/pondering.cpp')
-rw-r--r--src/systems/pondering.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/systems/pondering.cpp b/src/systems/pondering.cpp index 50a8bc8..e40db1d 100644 --- a/src/systems/pondering.cpp +++ b/src/systems/pondering.cpp
@@ -5,12 +5,14 @@
5 5
6void PonderingSystem::tick(double dt) 6void PonderingSystem::tick(double dt)
7{ 7{
8 auto entities = game.getEntityManager().getEntitiesWithComponents<PonderableComponent, TransformableComponent>(); 8 auto entities = game_.getEntityManager().getEntitiesWithComponents<
9 PonderableComponent,
10 TransformableComponent>();
9 11
10 for (auto entity : entities) 12 for (id_type entity : entities)
11 { 13 {
12 auto& transformable = game.getEntityManager().getComponent<TransformableComponent>(entity); 14 auto& transformable = game_.getEntityManager().getComponent<TransformableComponent>(entity);
13 auto& ponderable = game.getEntityManager().getComponent<PonderableComponent>(entity); 15 auto& ponderable = game_.getEntityManager().getComponent<PonderableComponent>(entity);
14 16
15 // Accelerate 17 // Accelerate
16 ponderable.setVelocityX(ponderable.getVelocityX() + ponderable.getAccelX() * dt); 18 ponderable.setVelocityX(ponderable.getVelocityX() + ponderable.getAccelX() * dt);