home *** CD-ROM | disk | FTP | other *** search
- class Controller
- {
- var bPause;
- var oTransition;
- var oMenu;
- var oInstructions;
- var oStartPop;
- var oCheatPop;
- var oTransitionLevel;
- var oSounds;
- static var PACKAGING_INTRO_MUSIC_NAME = "packaging_intro";
- static var PACKAGING_MUSIC_NAME = "packaging_loop";
- static var GAME_MUSIC_NAME = "in_game";
- static var nSFX_VOLUME = 60;
- static var nMUSIC_VOLUME = 60;
- static var oRef = null;
- function Controller(_mcTimeline)
- {
- this.bPause = false;
- Controller.oRef = this;
- this.oTransition = new Transition(_mcTimeline.mcTransition);
- this.oMenu = new Menu(_mcTimeline.mcMenu);
- this.oInstructions = new Instructions(_mcTimeline.mcInstructions);
- this.oStartPop = new StartPopUp(_mcTimeline.mcStartPop);
- this.oCheatPop = new CheatPopUp(_mcTimeline.mcCodePop);
- this.oTransitionLevel = new TransitionLevel(_mcTimeline.mcTransitionLevel);
- this.oSounds = new Sounds(_mcTimeline);
- }
- function pauseGame()
- {
- this.bPause = true;
- CTRLGame.getRef().blockEvents();
- Broadcaster.Instance.doPause();
- }
- function unPauseGame()
- {
- this.bPause = false;
- CTRLGame.getRef().unBlockEvents();
- Broadcaster.Instance.doUnPause();
- }
- function isPaused()
- {
- return this.bPause;
- }
- function isSoundsMuted()
- {
- return this.oSounds.isSoundsMuted();
- }
- function muteSounds()
- {
- this.oSounds.DoMuteSounds();
- }
- function unMuteSounds()
- {
- this.oSounds.UndoMuteSounds();
- }
- function isMusicMuted()
- {
- return this.oSounds.isMusicMuted();
- }
- function muteMusic()
- {
- this.oSounds.DoMuteMusic();
- }
- function unMuteMusic()
- {
- this.oSounds.UndoMuteMusic();
- }
- function goTo(_sGoingTo, _classToMove)
- {
- this.oTransition.goTo(_sGoingTo,_classToMove);
- }
- function goToNewLevel(_nFrameSongs)
- {
- this.oTransitionLevel.goToNewLevel(_nFrameSongs);
- }
- function resetForNewGame()
- {
- this.bPause = false;
- }
- function playRollOverSound()
- {
- this.oSounds.playSound("Button_rollover",Controller.nSFX_VOLUME,1);
- }
- function playClickSound()
- {
- this.oSounds.playSound("Button_click",Controller.nSFX_VOLUME,1);
- }
- function introComplete()
- {
- if(Main.getRef().getSection() == Main.PACKAGING_SECTION)
- {
- this.oSounds.playSound(Controller.PACKAGING_MUSIC_NAME,Controller.nMUSIC_VOLUME,999999);
- }
- }
- function playMusicLoop(_sSectionToPlay)
- {
- if(_sSectionToPlay == Main.PACKAGING_SECTION)
- {
- this.oSounds.startFadeOut(Controller.GAME_MUSIC_NAME);
- this.oSounds.startFadeIn(Controller.PACKAGING_INTRO_MUSIC_NAME,Controller.nMUSIC_VOLUME,1);
- }
- else if(_sSectionToPlay == Main.GAME_SECTION)
- {
- this.oSounds.startFadeOut(Controller.PACKAGING_INTRO_MUSIC_NAME);
- this.oSounds.startFadeOut(Controller.PACKAGING_MUSIC_NAME);
- this.oSounds.startFadeIn(Controller.GAME_MUSIC_NAME,Controller.nMUSIC_VOLUME,999999);
- }
- }
- static function getRef()
- {
- return Controller.oRef;
- }
- function getInstructions()
- {
- return this.oInstructions;
- }
- function getSounds()
- {
- return this.oSounds;
- }
- function getMenu()
- {
- return this.oMenu;
- }
- function getStartPop()
- {
- return this.oStartPop;
- }
- function getCheatPop()
- {
- return this.oCheatPop;
- }
- }
-