aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/player.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/player.cpp b/src/player.cpp
index 5346a24..b914672 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -67,6 +67,13 @@ void PlayerSystem::receive(const KeyDownEvent& kue)
el.tryListener("MoveRightPressed",
e.component<Scripted>()->caller);
});
+ } else if (kue.sym == SDLK_SPACE) {
+ entities.each<EventListener>([&]([[maybe_unused]] entityx::Entity e,
+ EventListener& el)
+ {
+ el.tryListener("JumpKeyPressed",
+ e.component<Scripted>()->caller);
+ });
}
}
}
@@ -88,6 +95,13 @@ void PlayerSystem::receive(const KeyUpEvent& kue)
el.tryListener("MoveRightReleased",
e.component<Scripted>()->caller);
});
+ } else if (kue.sym == SDLK_SPACE) {
+ entities.each<EventListener>([&]([[maybe_unused]] entityx::Entity e,
+ EventListener& el)
+ {
+ el.tryListener("JumpKeyReleased",
+ e.component<Scripted>()->caller);
+ });
}
}
}