InputBag in a working state and getting used.
This commit is contained in:
parent
d9ccbede66
commit
597607366e
7 changed files with 112 additions and 9 deletions
|
@ -2,9 +2,19 @@
|
|||
#include "character.hpp"
|
||||
#include "moversine.hpp"
|
||||
#include "sdlmain.hpp"
|
||||
#include "inputbag.hpp"
|
||||
#include "key.hpp"
|
||||
#include <algorithm>
|
||||
#include <SDL2/SDL_scancode.h>
|
||||
|
||||
namespace cloonel {
|
||||
namespace {
|
||||
enum GameActionType {
|
||||
GameAction_Left,
|
||||
GameAction_Right
|
||||
};
|
||||
} //unnamed namespace
|
||||
|
||||
struct GameplaySceneClassic::LocalData {
|
||||
};
|
||||
|
||||
|
@ -14,6 +24,10 @@ namespace cloonel {
|
|||
GameplayScene(parSdlMain),
|
||||
m_local(new LocalData)
|
||||
{
|
||||
//TODO: replace the hardcoded bindings with something more customizable.
|
||||
InputBag& input = *InputBagObject();
|
||||
input.AddAction(GameAction_Left, Key(InputDevice_Keyboard, SDL_SCANCODE_LEFT), "Move left");
|
||||
input.AddAction(GameAction_Left, Key(InputDevice_Keyboard, SDL_SCANCODE_RIGHT), "Move right");
|
||||
}
|
||||
|
||||
///--------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue