Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: A PureMVC architecture for games  (Read 6828 times)
eco_bach
Courseware Beta
Sr. Member
***
Posts: 81


View Profile Email
« on: June 16, 2010, 12:00:29 »

Hi
I'm no game coding expert, but I've seen and had to revise many home grown -spaghetti code game engines.

For a simple(non-database) game, where you need to track and increase the score, notify the user(you lose, you win etc) that requires basic keyboard interaction, would puremvc be overkill?

If not could someone suggest 'best practice' for architecting?

What logic if any would be in the model, or would the model simply be maintaining application state?
How much logic to put in controllers vs views, etc?

Any feedback appreciated!


Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: June 21, 2010, 06:22:33 »

Overkill? no. You still have a model and a view and the need to separate the two. MVC is still appropriate.

Things like current score, number of lives, inventory, should be tended by a Proxy. You might want a VO or set of VOs that can be passed to the view for display or use by view critters.

The State machine is great for managing overall application state, and of course you'll have those: the 'insert coin' state, the 'level n' state, the 'high score list' state...

Also, see the HelloFlash demo for some self-directed but mediated view components that can interact with their environment.

-=Cliff>
« Last Edit: June 21, 2010, 07:20:54 by puremvc » Logged
Pages: [1]
Print