noam-c/EDEn — Issue #10: Create input mapper for player input
Author: noam-c
Created: 2011-12-03 08:42:54+00:00
State: open

Currently, all keyboard controls are hardcoded, and this will cause issues if a player wishes to change the game's control scheme. There needs to be a class that can take key or mouse events, route them through the player's desired control scheme, and translate them to game-specific events that would be interpreted by the game states.

For instance, currently the "Up" key maps to moving the player character up. What if the player prefers the 'W' key instead? There must be a way to allow for this kind of change without needing to change the game state. The game state doesn't need to concern itself with the 'W' key or the 'Up' key or the gamepad D-pad if there is one. The only thing the game state needs to interpret is that the player requested that the player character move upward.