Reading an artile on gamasutra had me thinking of how should the controller in an MVC game be designed as:
Option 1: The controller should act on the model,
Eg: whenever a key is pressed controller calls model:
On KeyPress Left
SuperMario.StartWalking(Left)
On KeyRelease -Left or Right-
SuperMario.StopWalking()
Option 2 : The model queries the controller about what to do
Eg: each update tick model calls GetDesiredXSpeed():
On KeyPress Left
speedX = -SuperMario.MaxSpeed();
On KeyRelease -Left or Right-
speedX = 0;
int GetDesiredXSpeed()
return speedX;
Which of the two designs for controller provides the most benefits in terms of being able to change the controller to support for alternative input methods Eg, Joystick or mouse, network player or even AI? What should I preffer over the other. If you have personal expirience in game design please give me your 2 cents on this.