model view controller - Games: Who is responsible for display? -
What institutions should attract themselves? I have used this approach: it is easy and it works, but after learning MVC-pattern I feel uncomfortable about it. It is difficult to change the art style when all the display logic is buried in the model.
One can present a visible class, which takes level in the form of an argument and pulls it, but this will mean identifying the unit type and a "switch" - the statutory, which I learned It's too bad, too.
A place for drawing should be a place, in a way that is extensible, easy to change, clean and dry? /p>
There is nothing wrong with the abstract design method in your organizations, which allows them to decide how specifically Drew for small games, which probably will not grow much. I have used this method in a small number of projects and it works great.
Actually to use your game resources as a proxy for drawing operation. For example, an enemy unit can suspend all rendering via a resource object that represents the mesh; Just for texture / skin and effect.
I recently switched to the interface as a 'dumb' container to use its institutions, which defines their behavior. A player unit may include IMoveable, IControllable, IRenderable, and many other interfaces which, on the basis of that data, only apply special operations on that unit. The unit does not know much about it and all execution happens when the visual graph is run for reducing / rendering.
Comments
Post a Comment