PureMVC Architects Lounge

Announcements and General Discussion => Architecture => Topic started by: Hyakugei on May 06, 2008, 06:51:53



Title: Game Architecture Question
Post by: Hyakugei on May 06, 2008, 06:51:53
I'm a new user of the PureMVC framework, although a long time user of Flash and have used the MVP/C pattern in other projects.

So. I'm in the process of designing and architecting a real-time, single player game. I'm at a bit of a loss as to where the "main loop" of the game should reside? I've got it figured where the data is - in a model/proxy, but where is the code which updates the screen every frame (looking at the data, updating moving objects, etc), assuming no user interaction. Would this live in a Mediator?

I get that each user interaction will generate an event, which will trigger commands which will then update the model/proxy... But where does the _ongoing_ process of updating the screen in real time take place... Or rather, where should that code be located?

Thanks,
jos


Title: Re: Game Architecture Question
Post by: puremvc on May 06, 2008, 11:22:56
Well, it all depends on your game how things are handled. Usually game entities or particles will be self-directed. The bad guys in the Pac-man maze are probably sprites with their own code that uses timers to call them back at intervals so that they can decide where they're headed and whether they need to alter direction, etc based on their location in the maze and their preternatural knowledge of which way you're going. The scrolling surface you're flying over on Xevious could be a simple movieclip loaded playing in the background.

Two good places to start looking at how you might organize things in PureMVC would be the AS3/HelloFlash Demo (see the HelloSprite) and the AS2/Balloonatroid demo.

http://trac.puremvc.org/Demo_AS3_Flash_HelloFlash
http://trac.puremvc.org/Demo_AS2_FlashLite_Ballonatroid

-=Cliff>


Title: Re: Game Architecture Question
Post by: Hyakugei on May 06, 2008, 11:55:45
Ok, cool thanks! I'll check those two examples out. As i go forward i'm sure i'll have more questions... I've been looking at the State Working Group boards, and trying to get my head around the idea that state should be held in the view rather then the model, and how that relates to game objects.


Title: Re: Game Architecture Question
Post by: houen on March 11, 2009, 01:46:32
Hi - sorry to be a bother, but the Balloonatroid link is broken. Is there another place to find it?


Title: Re: Game Architecture Question
Post by: Jason MacDonald on March 12, 2009, 06:21:31
It can be found here http://trac.puremvc.org/Demo_AS2_FlashLite_Balloonatroid