home *** CD-ROM | disk | FTP | other *** search
- package Code.WINDOWS
- {
- import Code.LIB.MOCHIADS._gw127;
- import Code.LIB._bm350;
- import Code.LIB._bm468;
- import Code.LIB._ei76;
- import Code.LIB._hu299;
- import Code.LIB._iv163;
- import Code.LIB._lx496;
- import Code.LIB._na237;
- import Code.LIB._nx518;
- import Code.LIB._pw224;
- import Code.LIB._uu24;
- import Code.LOGIC._cd449;
- import Code.OPTIONS._dx111;
- import Code.OPTIONS._ea490;
- import Code.WINDOWS.DIALOGS._ra85;
- import Code._vy402;
- import flash.display.MovieClip;
- import flash.display.Sprite;
- import flash.events.Event;
- import flash.events.KeyboardEvent;
- import flash.events.MouseEvent;
- import flash.utils.getTimer;
-
- public class _gk231 extends _ei76
- {
-
- public static const stLevel:int = 3;
-
- public static const stInvisible:int = 8;
-
- public static const stPlay:int = 4;
-
- public static const stCompleteAllLevels:int = 7;
-
- public static const stComplete:int = 5;
-
- public static const stLoose:int = 6;
-
- public static const stShow:int = 0;
-
-
- public var pause:_nx518;
-
- private var msgs:Array;
-
- public var iLevelLabel:_pw224;
-
- private var iField:_cd449;
-
- public var menuBig:_nx518;
-
- public var menu:_nx518;
-
- private var allLevels:Boolean = false;
-
- public var iMenu:_nx518;
-
- public var submitScore:_nx518;
-
- private var iMsgLabel:_pw224;
-
- private var submitDialog:_ra85;
-
- public var iMore:_nx518;
-
- public var playAgain:_nx518;
-
- private var score:_bm468;
-
- private var iWFinished:MovieClip;
-
- public var retry:_nx518;
-
- private var iState:int;
-
- public var biba:_pw224;
-
- public var nextLevel:_nx518;
-
- private var iPaused:Boolean = false;
-
- public function _gk231()
- {
- var _loc1_:Array = null;
- iPaused = false;
- allLevels = false;
- _loc1_ = [[_vy402._jk562,"next level",_dx111.cAqua,220,70,21,_dx111.cWhite,80,510,"nextLevel",false],[_vy402._jk562,"submit score",_dx111.cAqua,220,70,21,_dx111.cWhite,469,510,"submitScore",false],[_vy402._jk562,"retry",_dx111.cAqua,220,70,21,_dx111.cWhite,300,390,"retry",false],[_vy402._jk562,"menu",_dx111.cAqua,220,70,21,_dx111.cWhite,595,520,"menuBig",false],[_vy402._jk562,"play again",_dx111.cAqua,220,70,21,_dx111.cWhite,370,542,"playAgain",false],[_vy402._rd64,"pause",_dx111.cAqua,63,30,13,_dx111.cWhite,240,3,"pause",false],[_vy402._rd64,"menu",_dx111.cAqua,60,30,13,_dx111.cWhite,315,3,"menu",false]];
- super(_loc1_);
- score = new _bm468(20,_dx111.cWhite,"score");
- score.alpha = 0.8;
- score._oa54 = 0;
- score.visible = false;
- score._lh238 = 570;
- addChild(score);
- biba = new _pw224(19,_dx111.cWhite,null);
- biba._gm53(610,570);
- biba.Text = "bibagames.com";
- biba.alpha = 0.8;
- biba.visible = false;
- addChild(biba);
- _nk262();
- }
-
- override public function _vx267(param1:KeyboardEvent) : void
- {
- if(Boolean(iField) && iField.paused)
- {
- _rr336(false);
- }
- }
-
- private function _rr336(param1:Boolean) : void
- {
- iField.paused = param1;
- if(param1 == true)
- {
- this.iMsgLabel.Text = "game paused\n press any key to continue!";
- this.iMsgLabel._gm53((800 - this.iMsgLabel.width) / 2,(500 - this.iMsgLabel.height) / 2);
- }
- else
- {
- this.iMsgLabel.Text = "";
- }
- }
-
- override public function onEnterFrame(param1:Event) : void
- {
- var _loc2_:int = 0;
- var _loc3_:int = 0;
- var _loc4_:_iv163 = null;
- super.onEnterFrame(param1);
- if(this.iPaused)
- {
- return;
- }
- _loc2_ = getTimer();
- switch(this.iState)
- {
- case stShow:
- if(!this._mf556 && this._rm382)
- {
- this.State = stLevel;
- }
- break;
- case stLevel:
- if(this.iMsgLabel.alpha < 0.99)
- {
- this.iMsgLabel.alpha += 0.07;
- }
- if(_loc2_ - this.iITimer > 1500)
- {
- this.iMsgLabel.Text = "";
- this.State = stPlay;
- }
- break;
- case stPlay:
- if(iField._sn240 == _cd449.stWin)
- {
- menu.visible = false;
- pause.visible = false;
- State = stComplete;
- }
- else if(iField._sn240 == _cd449.stLoose)
- {
- menu.visible = false;
- pause.visible = false;
- State = stLoose;
- }
- else if(_na237._gt371 + iField._kw428 * 150 != score._oa54)
- {
- score._oa54 = _na237._gt371 + iField._kw428 * 150;
- }
- break;
- case stComplete:
- _loc3_ = 0;
- while(_loc3_ < msgs.length)
- {
- if((_loc4_ = msgs[_loc3_]).alpha < 1)
- {
- _loc4_.alpha += 0.045;
- break;
- }
- _loc3_++;
- }
- break;
- case stLoose:
- }
- }
-
- public function _lb395(param1:Event) : void
- {
- if(iField && !iField.paused && iState == stPlay)
- {
- _rr336(true);
- }
- }
-
- override public function _lf305(param1:MouseEvent) : void
- {
- var _loc2_:String = null;
- var _loc3_:Sprite = null;
- if(Boolean(submitDialog) && (param1.target == submitDialog.iOk._ol346 || param1.target == submitDialog.iCancel._ol346))
- {
- switch(param1.target)
- {
- case submitDialog.iOk._ol346:
- _loc2_ = int(_bm350.prStage.stageWidth) + "x" + int(_bm350.prStage.stageHeight);
- _gw127._mx117({
- "boardID":"bea313d30c4f0068",
- "score":_na237._gt371,
- "res":_loc2_
- });
- submitScore.visible = false;
- _bm350.scoreSubmitted = true;
- _loc3_ = new Sprite();
- _loc3_.graphics.beginFill(0,1);
- _loc3_.graphics.drawRect(448 * _bm350._tc204,460 * _bm350._tc204,300 * _bm350._tc204,120 * _bm350._tc204);
- _loc3_.graphics.endFill();
- addChild(_loc3_);
- break;
- case submitDialog.iCancel._ol346:
- }
- removeChild(submitDialog);
- submitDialog._fy281();
- submitDialog = null;
- return;
- }
- if(submitDialog)
- {
- return;
- }
- if(Boolean(iField) && (param1.target == nextLevel._ol346 || param1.target == retry._ol346 || param1.target == playAgain._ol346))
- {
- (parent as _lx496).menuItem = _dx111.miGame;
- hide();
- State = stInvisible;
- }
- if(Boolean(iField) && param1.target == submitScore._ol346)
- {
- submitDialog = new _ra85("You can submit\nscore only once.\n Are you sure?");
- addChild(submitDialog);
- submitDialog._gm53(150,100);
- }
- if(iState == stPlay && param1.target == menu._ol346)
- {
- (parent as _lx496).menuItem = _dx111.miMenu;
- hide();
- }
- if(iState == stPlay && param1.target == pause._ol346)
- {
- _rr336(!iField.paused);
- }
- if(param1.target == menuBig._ol346)
- {
- (parent as _lx496).menuItem = _dx111.miMenu;
- hide();
- }
- }
-
- public function _nk262() : void
- {
- this.iMsgLabel = new _pw224(40,_dx111.cAqua,_hu299.Bevel);
- this.addChild(this.iMsgLabel);
- this.iMsgLabel.mouseEnabled = false;
- this.addEventListener(Event.DEACTIVATE,_lb395);
- }
-
- private function set State(param1:int) : void
- {
- var _loc2_:Class = null;
- var _loc3_:MovieClip = null;
- var _loc4_:int = 0;
- var _loc5_:_iv163 = null;
- var _loc6_:Sprite = null;
- this.iState = param1;
- switch(this.iState)
- {
- case stShow:
- break;
- case stLevel:
- if(_na237._wd393 >= _ea490.Levels.length)
- {
- _bm350.scoreSubmitted = false;
- _na237._wm168();
- }
- this.iMsgLabel.Color = _dx111.cWhite;
- this.iMsgLabel._yy538 = 40;
- this.iMsgLabel.Text = " " + _dx111.iLanguage.strLevel + " # " + (_na237._wd393 + 1).toString() + "/" + _ea490.Levels.length;
- this.iMsgLabel._gm53((500 - this.iMsgLabel.width) / 2,(600 - this.iMsgLabel.height) / 2);
- this.iMsgLabel.alpha = 0;
- this.iITimer = getTimer();
- break;
- case stPlay:
- pause.visible = true;
- menu.visible = true;
- score.visible = true;
- biba.visible = true;
- this.iField = new _cd449(_ea490.Levels[_na237._wd393]);
- this.addChildAt(iField,0);
- break;
- case stComplete:
- _na237._gk216();
- if(_na237._wd393 >= _ea490.Levels.length)
- {
- allLevels = true;
- submitScore._vt351 = 93;
- submitScore._lh238 = 544;
- playAgain.visible = true;
- }
- msgs = new Array();
- this.iMsgLabel._vt351 = 200;
- this.iMsgLabel._lh238 = 10;
- this.iMsgLabel.Text = allLevels == true ? "Congratulations!\nYou have completed\nall levels!" : "great, level completed!";
- msgs.push(_uu24._ec508(iMsgLabel));
- this.iMsgLabel.Color = _dx111.cGreen;
- this.iMsgLabel._lh238 = 100;
- this.iMsgLabel.Text = "Little Frizzles: " + int(this.iField._kw428);
- msgs.push(_uu24._ec508(iMsgLabel));
- this.iMsgLabel.Color = _dx111.cRed;
- this.iMsgLabel.Text = "score: " + this.iField._kw428 * 150;
- msgs.push(_uu24._ec508(iMsgLabel));
- _na237._ym248(this.iField._kw428 * 150);
- this.iMsgLabel.Color = _dx111.cAquaLight;
- this.iMsgLabel.Text = "total score: " + _na237._gt371;
- msgs.push(_uu24._ec508(iMsgLabel));
- _loc4_ = 0;
- while(_loc4_ < msgs.length)
- {
- (_loc5_ = msgs[_loc4_])._lh238 = _loc4_ * 60;
- _loc5_.alpha = 0;
- addChild(_loc5_);
- _loc4_++;
- }
- _loc2_ = allLevels ? _dx111.TWComplete : _dx111.GWWin;
- _loc3_ = new _loc2_() as MovieClip;
- _loc3_.scaleX = _loc3_.scaleY = _bm350._tc204;
- addChild(_loc3_);
- addChild(nextLevel);
- addChild(submitScore);
- addChild(playAgain);
- nextLevel.visible = !allLevels;
- submitScore.visible = !_bm350.scoreSubmitted;
- if(!submitScore.visible)
- {
- (_loc6_ = new Sprite()).graphics.beginFill(0,1);
- _loc6_.graphics.drawRect(448 * _bm350._tc204,460 * _bm350._tc204,300 * _bm350._tc204,120 * _bm350._tc204);
- _loc6_.graphics.endFill();
- addChild(_loc6_);
- }
- break;
- case stLoose:
- this.iMsgLabel.Text = "level failed,\n try again!";
- this.iMsgLabel._gm53((800 - this.iMsgLabel.width) / 2,140);
- this.iMsgLabel.visible = true;
- _loc3_ = new _dx111.GWGameOver() as MovieClip;
- _loc3_.scaleX = _loc3_.scaleY = _bm350._tc204;
- addChild(_loc3_);
- addChild(menuBig);
- addChild(retry);
- addChild(this.iMsgLabel);
- menuBig.visible = true;
- retry.visible = true;
- break;
- case stCompleteAllLevels:
- iWFinished = new _dx111.TWComplete() as MovieClip;
- iWFinished.scaleX = iWFinished.scaleY = _bm350._tc204;
- iWFinished.x = (800 - 400) / 2 * _bm350._tc204;
- iWFinished.y = (600 - 400) / 2 * _bm350._tc204;
- addChild(iWFinished);
- }
- }
-
- override public function _fy281() : void
- {
- super._fy281();
- if(this.iField)
- {
- this.iField._fy281();
- }
- this.removeEventListener(Event.DEACTIVATE,_lb395);
- }
- }
- }
-