PureMVC Architects Lounge

Announcements and General Discussion => Architecture => Topic started by: eco_bach on June 16, 2010, 12:00:29



Title: A PureMVC architecture for games
Post by: eco_bach 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!




Title: Re: A PureMVC architecture for games
Post by: puremvc 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>