views:

36

answers:

1

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 less 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?

+4  A: 

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.

Delan Azabani
This is also mandatory if you want to render on a separate thread.
BigSandwich