home *** CD-ROM | disk | FTP | other *** search
- function gameInit()
- {
- road_num = random(4);
- level = 0;
- second = 0;
- levelShow = level + 1;
- this.level_txt.text = levelShow;
- this.score_txt.text = score;
- trace("timeDelay=" + levelList[level].timeDelay);
- intervalID = setInterval(this,"bigFishOut",levelList[level].timeDelay);
- timeIntervalID = setInterval(this,"timeControl",1000);
- this.mainGame.attachMovie("fish_mc","fish_mc",road_num * 100 + 98);
- this.mainGame.fish_mc._x = 100;
- this.mainGame.fish_mc._y = y_arr[road_num] - 8;
- this.mainGame.fish_mc.road_num = road_num;
- this.mainGame.fish_mc.y_arr = y_arr;
- this.mainGame.sea_0.swapDepths(99);
- this.mainGame.sea_1.swapDepths(199);
- this.mainGame.sea_2.swapDepths(299);
- this.mainGame.sea_3.swapDepths(399);
- }
- function bigFishOut()
- {
- if(_root.game.isGameOver == false)
- {
- if(_root.game.isPause == false)
- {
- fishOut();
- }
- }
- }
- function fishOut()
- {
- var _loc3_ = undefined;
- _loc3_ = lastRoad + (random(3) + 1);
- _loc3_ < 4 ? _loc3_ : (_loc3_ -= 4);
- lastRoad = _loc3_;
- var _loc4_ = undefined;
- fishList[_loc3_] >= 90 ? (fishList[_loc3_] = 0) : fishList[_loc3_]++;
- _loc4_ = fishList[_loc3_];
- this.mainGame.attachMovie("ship","ship_" + (_loc3_ * 100 + _loc4_),_loc3_ * 100 + _loc4_);
- var _loc2_ = undefined;
- _loc2_ = this.mainGame["ship_" + (_loc3_ * 100 + _loc4_)];
- _loc2_.cacheAsBitmap == true;
- if(boxOut == true)
- {
- if(level >= 9)
- {
- _loc2_.gotoAndStop(random(_loc2_._totalframes - 4) + 3);
- }
- else
- {
- _loc2_.gotoAndStop(random(_loc2_._totalframes - 1) + 1);
- }
- }
- else if(level >= 9)
- {
- _loc2_.gotoAndStop(random(_loc2_._totalframes - 3) + 3);
- }
- else
- {
- _loc2_.gotoAndStop(random(_loc2_._totalframes) + 1);
- }
- if(_loc2_._currentframe == _loc2_._totalframes)
- {
- boxOut = true;
- }
- _loc2_._x = 900;
- _loc2_._y = y_arr[_loc3_];
- if(_loc2_._currentframe < 3)
- {
- _loc2_.speed = 8;
- }
- else
- {
- _loc2_.speed = levelList[level].speed + random(5 + level);
- }
- _loc2_.road_num = _loc3_;
- _loc4_ <= 0 ? (_loc2_.frontFish = this.mainGame["ship_" + (_loc2_.road_num * 100 + 90)]) : (_loc2_.frontFish = this.mainGame["ship_" + (_loc2_.road_num * 100 + (_loc4_ - 1))]);
- }
- function timeControl()
- {
- if(_root.game.isGameOver == false)
- {
- if(_root.game.isPause == false)
- {
- time_txt.text = second;
- second++;
- }
- }
- }
- function testScore()
- {
- var _loc3_ = undefined;
- _loc3_ = levelList[level].scoreToUp;
- if(score - oldScore != 0 && (score - oldScore) % _loc3_ == 0)
- {
- level >= 19 ? (level = 19) : level++;
- levelShow++;
- level_txt.text = levelShow;
- oldScore = score;
- trace("levelUp" + level + "___________score+" + score);
- _root.game.gameOver.gotoAndPlay(1);
- boxOut = false;
- _root.game.soundManage.playSound("levelUp_s");
- clearInterval(intervalID);
- intervalID = setInterval(this,"bigFishOut",levelList[level].timeDelay);
- }
- else
- {
- _root.game.soundManage.playSound("get_s");
- }
- }
- stop();
- this.init();
- var intervalID;
- var timeIntervalID;
- var road_num;
- var second;
- var y_arr = [140,195,250,310];
- var fishList = [0,0,0,0];
- var levelList = new Array();
- var boxOut;
- var eachScore = 50;
- var oldScore = 0;
- var levelShow;
- var lastRoad = random(4);
- var i = 0;
- while(i < 20)
- {
- if(i < 8)
- {
- levelList[i] = {levelNum:i + 1,speed:5 + i,scoreToUp:(2 + i) * 50,timeDelay:1200 - i * 120};
- }
- else
- {
- levelList[i] = {levelNum:i + 1,speed:5 + i,scoreToUp:(5 + i) * 50,timeDelay:300};
- }
- i++;
- }
- gameInit();
- stop();
-