0
\$\begingroup\$

Im,working on a project where the classes are organized by subject like gameplay, menus, utilities etc... Basically this 3 packages.

is a good practice to organize classes in controller, view and module packages ?

games are typically visual applications. This question is regarding the viability of a particular organization and pattern in a game application, which are mostly visually oriented.

\$\endgroup\$
  • \$\begingroup\$ The organization of the code is a personal preference. Also, this question is not game development related. \$\endgroup\$ – MichaelHouse Aug 14 '13 at 4:51
  • \$\begingroup\$ games are typically visual applications. This question is regarding the viability of a particular organization and pattern in a game application, which are mostly visually oriented. that is why this question is related to games. \$\endgroup\$ – Daniel Santos Aug 14 '13 at 14:30
  • 1
    \$\begingroup\$ Is this about coupling of systems or just namespaces? :o \$\endgroup\$ – Casper Beyer Aug 14 '13 at 15:07
  • \$\begingroup\$ It really depends on the size of your game/application. If you are just making some small program with 3 or 4 different screens then I would not bother creating subdirectories. If your application is quite large and contains pages with completely different uses then I would group them into directories. But that is just my personal preference and why this is a comment and not an answer. \$\endgroup\$ – Benjamin Danger Johnson Aug 14 '13 at 17:19
0
\$\begingroup\$

It depends on what programming language are you using. In Java for example I would strongly recommend separating coherent classes by their use.

At the very least you should put Game Logic and Display to different packages.

\$\endgroup\$
0
\$\begingroup\$

Yes, because you may then define your game resources as subclasses of Model, View, and Controller. Alternatively, you could feature Model, View, or Controller instance properties within your game classes.

For example: You could have an overall GameActor class, with separate instance properties of Model (for the data), View (for the visual representation of that data), and Controller (for game mechanics, etc.)...

Then, all actors within your game could be sent to Model, View, or Controller processing methods, just by passing-in the appropriate MVC actor property to that method.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.