@@ -8,7 +8,8 @@ struct input_listener_component {
UP,
DOWN,
LEFT,
- RIGHT
+ RIGHT,
+ STOP
};
type command{type::NONE};
@@ -20,10 +20,14 @@ void command_system(entt::registry ®istry) {
case input_listener_component::type::RIGHT:
vel.dx = 1.0f;
break;
- case input_listener_component::type::NONE:
+ case input_listener_component::type::STOP:
vel.dx = vel.dy = 0.0f;
+ default:
+ break;
}
+
+ input.command = input_listener_component::type::NONE;
@@ -38,7 +38,7 @@ void input_system(entt::registry ®istry, const SDL_Event &event, bool &quit)
internal::update_listeners(registry, input_listener_component::type::RIGHT);
case SDLK_SPACE:
- internal::update_listeners(registry, input_listener_component::type::NONE);
+ internal::update_listeners(registry, input_listener_component::type::STOP);