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: multiple MVC's in one project  (Read 6159 times)
Nilz
Newbie
*
Posts: 1


View Profile Email
« on: November 06, 2007, 02:28:10 »

Hi all,

We are creating a big game with several mini games (puzzles, quizez etc) in flash cs3 using pureMVC.
To accommodate every developer with it's own environment we have a mvc structure for each mini game and one main mvc for the overall game. One 'problem' we have is that all the core classes are singletons so each game will need it's own puremvc setup.

Any experiences in this field ?
What is your view on merging multiple mvc's in one?

Cheers,

Niels
flashclub.nl
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: November 06, 2007, 12:42:38 »

I'm doing a FlashLite game in AS2 with a soon to be released PureMVC port. The game loads multiple levels. The level can be seen as simply registering some new mediators, commands and proxies.

So the shell movieclip initializes the Facade, calling a facade method on its first frame like:

:
import com.me.mygame.GameFacade;
GameFacade.getInstance().startup(this)

A StartupCommand is invoked that does the standard PureMVC housekeeping.

Each level, when loaded, on its frame 1 gets the Facade instance, calls a facade method like:

:
import com.me.mygame.GameFacade;
GameFacade.getInstance().levelLoad(this)

The LevelLoadCommand, like the StartupCommand, gets a reference to the MovieClip that invoked it so it can wrap it in the right Mediator, and create any associated Proxies, register any new commands and send a kickoff notification if necessary.

The idea, then is that the Facade has already been initialized by the shell, and the newly loaded thing just adds what it needs.  And if done correctly, the game it will run on its own as well as within the shell.

-=Cliff>

Logged
Pages: [1]
Print