I am creating a very simple game in AS3 as an exercise in pure MVC. The application will have 3 views: a start/replay screen, a score/time display and the actual game area.
There is an obvious separation between the start screen and the other two elements that are active during game time, so should there be two controllers, one to handle game events and one for out-of-game events? Or is it bad practise to have multiple controllers in a very small application?
Maybe what I'm really trying to get at is: if you were r开发者_运维百科eviewing this game as a prospective employer, would you look badly on there being a different controller for the different states of the application, or would you appreciate the seperation?
I think it's quite subjective but I tend to use only one Controller even for large applications. In AS3 I separate every action in a class called by my Controller. Eventually the Controller only contains a large switch instanciating different action classes depending on the received event. I hope this is clear enough :)
精彩评论