aboutsummaryrefslogtreecommitdiffstats
path: root/src/player.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2017-07-30 11:02:39 -0400
committerClyne Sullivan <tullivan99@gmail.com>2017-07-30 11:02:39 -0400
commitb1f93a4f8a5a3e84db9f00d0b41749d4fb32ed26 (patch)
tree83016b80294f6b7681093ae46aa55840b6fb9ec1 /src/player.cpp
parent69768fdc5050bbe5877bf80108584400ea292a4f (diff)
event feature work; ozone bgm redone
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/player.cpp b/src/player.cpp
index 3606bc7..9611d0e 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -132,7 +132,7 @@ void PlayerSystem::update(entityx::EntityManager &en, entityx::EventManager &ev,
vel.x /= 2.0f;
}
-void PlayerSystem::receive(const KeyUpEvent &kue)
+bool PlayerSystem::receive(const KeyUpEvent &kue)
{
auto kc = kue.keycode;
@@ -145,9 +145,10 @@ void PlayerSystem::receive(const KeyUpEvent &kue)
} else if (kc == getControl(5)) {
// TODO ...?
}
+ return true;
}
-void PlayerSystem::receive(const KeyDownEvent &kde)
+bool PlayerSystem::receive(const KeyDownEvent &kde)
{
auto kc = kde.keycode;
auto& loc = *player.component<Position>().get();
@@ -192,6 +193,7 @@ void PlayerSystem::receive(const KeyDownEvent &kde)
} else if (kc == SDLK_t) {
game::time::tick(50);
}
+ return true;
}
vec2 PlayerSystem::getPosition(void)
@@ -211,7 +213,7 @@ float PlayerSystem::getWidth(void)
return width;
}
-void PlayerSystem::receive(const UseItemEvent& uie)
+bool PlayerSystem::receive(const UseItemEvent& uie)
{
static std::atomic_bool cool (true);
@@ -254,4 +256,5 @@ void PlayerSystem::receive(const UseItemEvent& uie)
cool.store(true);
}, uie.item->cooldown).detach();
}
+ return true;
}