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: Game Architecture Question  (Read 7935 times)
Hyakugei
Jr. Member
**
Posts: 11


View Profile Email
« 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
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 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>
Logged
Hyakugei
Jr. Member
**
Posts: 11


View Profile Email
« Reply #2 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.
Logged
houen
Newbie
*
Posts: 5



View Profile WWW Email
« Reply #3 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?
Logged

My sites:
Flash Game site: www.999credits.com
Blog: www.houen.net/blog
Jason MacDonald
Sr. Member
****
Posts: 243


View Profile Email
« Reply #4 on: March 12, 2009, 06:21:31 »

It can be found here http://trac.puremvc.org/Demo_AS2_FlashLite_Balloonatroid
Logged
Pages: [1]
Print