Game Development Reference
In-Depth Information
_isTriggered = false;
for (auto trigger : _triggers)
{
_isTriggered = trigger->IsTriggered(input);
if (_isTriggered)
break;
}
}
InputManager
This is a lot to work on, but once implemented you'll have a pretty useful input system
that with only minor extensions could be used in other games.
typedef enum
{
Released,
Pressed,
JustReleased
} KeyState;
class InputManager
{
private:
static InputManager *_inst;
InputManager();
~InputManager();
std::vector<Action*> _actions;
bool _keyStatus[166]; // There are 166
VirtualKeys
bool _pointerDown;
float _pointerX;
float _pointerY;
XINPUT_STATE _padState[XUSER_MAX_COUNT];
Search WWH ::




Custom Search