Game logic, and view organization

Started by
-1 comments, last by 3DModelerMan 12 years, 4 months ago
I'm trying to write a game that has logic and view separation (mvc architecture). My logic classes only contain game state, and I have the view drawing stuff based on events sent by the objects. The view also sends input events to the game logic, and plays sound effects and music. The game entity class is component based; so that I can implement gameplay in a modular way. My question has to do with organization: if I want to draw anything more than cubes and spheres based on collision shapes. Then I'm going to need some sort of data connected to a game entity. Should the entities have members telling the view how to draw them? Like each game entity would have a "rendering type" member? This seems like it would ruin the separation between logic and view. And also, should the game's level file store data for the view as well (model filenames, textures, sound effects)? And the game logic would load the levels, and send events telling the view how to draw the objects? That seems like it would ruin the separation too. I want to be able to make my editor like the Unity editor (how you can assign textures and models), but I want to use the logic/view architecture also. How should I organize my scene/level files so that this is possible?

This topic is closed to new replies.

Advertisement