开发者

Separating Model from View in game development

As an application developer by day, I spend a lot of my time worrying about separating business logic from the user interface / view. But I've noticed that in game development, this seems to be l开发者_JS百科ess of a concern. I'll often see View/Screen/Scene classes filled with game logic, or Player/SpaceShip/etc. classes containing Draw methods.

From a purist point of view, the behavior and properties of a spaceship would be separate from the object responsible for rendering this ship on screen (unless I'm mistaken).

I'm very interested to hear people's thoughts on this. How much do you adhere to these guidelines in your games, and what is your approach either way?


Definitely separate draw code from logic, models and the rest. It helps especially when you are writing a different engines for other operating systems, as it's virtually only possible to do this if the draw code is not mangled with other code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜