Skip to main content
added 126 characters in body; added 18 characters in body
Source Link
Iain
  • 6.6k
  • 3
  • 35
  • 46

As Kylotan notes, "In games you can't treat the presentation aspect as a detachable and replaceable concept like HTML and CSS is for web apps". Having built a couple of games using a simple MVC pattern (not a huge framework) I've found the major problem is that your model needs to know about your view. It is very likely that you will need to use either sprite bitmap data, hitbox data or 3D geometry data from your art assets to help work out collision detection (or another similar task). This means each model needs a reference to its view, which breaks the classic MVC pattern - for example you can no longer create a new view to an existing model etc.

The component model you see in e.g. Unity3D is the best way to organise game code.

Having built a couple of games using a simple MVC pattern (not a huge framework) I've found the major problem is that your model needs to know about your view. It is very likely that you will need to use either sprite bitmap data, hitbox data or 3D geometry data from your art assets to help work out collision detection (or another similar task). This means each model needs a reference to its view, which breaks the classic MVC pattern - for example you can no longer create a new view to an existing model etc.

The component model you see in e.g. Unity3D is the best way to organise game code.

As Kylotan notes, "In games you can't treat the presentation aspect as a detachable and replaceable concept like HTML and CSS is for web apps". Having built a couple of games using a simple MVC pattern (not a huge framework) I've found the major problem is that your model needs to know about your view. It is very likely that you will need to use either sprite bitmap data, hitbox data or 3D geometry data from your art assets to help work out collision detection (or another similar task). This means each model needs a reference to its view, which breaks the classic MVC pattern - for example you can no longer create a new view to an existing model etc.

The component model you see in e.g. Unity3D is the best way to organise game code.

Source Link
Iain
  • 6.6k
  • 3
  • 35
  • 46

Having built a couple of games using a simple MVC pattern (not a huge framework) I've found the major problem is that your model needs to know about your view. It is very likely that you will need to use either sprite bitmap data, hitbox data or 3D geometry data from your art assets to help work out collision detection (or another similar task). This means each model needs a reference to its view, which breaks the classic MVC pattern - for example you can no longer create a new view to an existing model etc.

The component model you see in e.g. Unity3D is the best way to organise game code.