Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
InputComponent.hpp
Go to the documentation of this file.
1
8#ifndef RTYPE_ECS_COMPONENTS_SERVER_INPUTCOMPONENT_HPP_
9 #define RTYPE_ECS_COMPONENTS_SERVER_INPUTCOMPONENT_HPP_
10
11 #include <cstdint>
12
18{
28 enum InputBits : uint8_t {
29 MoveUp = 1 << 0,
30 MoveDown = 1 << 1,
31 MoveLeft = 1 << 2,
32 MoveRight = 1 << 3,
33 Shoot = 1 << 4,
34 Reload = 1 << 5,
35 DebugPowerup = 1 << 6 // Press P to spawn a random powerup (debug only)
36 };
37 uint8_t mask = 0;
38 uint8_t lastMask = 0;
39 uint32_t lastProcessedTick = 0;
40 float chargeTime = 0.0f;
41 };
42} // namespace rtp::ecs::components::server
43
44#endif /* !RTYPE_ECS_COMPONENTS_SERVER_INPUTCOMPONENT_HPP_ */
File : InputComponent.hpp License: MIT Author : Elias Josué HAJJAR LLAUQUEN elias-josue....
Component to handle network input for server entities.
uint8_t mask
Input mask for filtering input types.
float chargeTime
Accumulated charge time for shoot.
uint8_t lastMask
Previous input mask for edge detection.
uint32_t lastProcessedTick
Last processed server tick for input.