home *** CD-ROM | disk | FTP | other *** search
- class fish extends MovieClip
- {
- var clickN;
- var sizeN;
- var firstX = 0;
- var suVis = "no";
- function fish()
- {
- super();
- }
- function come(num)
- {
- this._xscale = 20;
- this._yscale = 20;
- if(num == 2)
- {
- this.firstX = random(100) + 150;
- }
- else
- {
- this.firstX = random(120) + 140;
- }
- if(num == 0)
- {
- this.firstX = 114;
- this._x = 114;
- }
- else
- {
- this._x = this.firstX;
- }
- this._y = 155;
- this.clickN = num;
- }
- function onEnterFrame()
- {
- if(_root.playIng == "no")
- {
- this.removeMovieClip();
- }
- if(_root.speedN > 0)
- {
- if(this._xscale < 100)
- {
- if(this._y < 301)
- {
- this.sizeN = 20 + 0.53 * (this._y - 150);
- }
- else
- {
- this.sizeN = 100;
- }
- this._yscale = this._xscale = this.sizeN;
- if(this.clickN == 0)
- {
- this._x -= _root.speedN / _root.centerN;
- this._y += _root.speedN / _root.centerN;
- }
- else
- {
- if(this.firstX < 190)
- {
- this._x -= _root.speedN / _root.centerN;
- }
- else if(this.firstX > 210)
- {
- this._x += _root.speedN / _root.centerN;
- }
- this._y += _root.speedN;
- }
- }
- else if(this.clickN == 0)
- {
- if(this.firstX < 190)
- {
- this._x -= _root.speedN / _root.centerN;
- }
- else if(this.firstX > 210)
- {
- this._x += _root.speedN / _root.centerN;
- }
- this._y += _root.speedN / _root.centerN;
- }
- else
- {
- if(this.firstX < 190)
- {
- this._x -= _root.speedN / _root.centerN;
- }
- else if(this.firstX > 210)
- {
- this._x += _root.speedN / _root.centerN;
- }
- this._y += _root.speedN;
- }
- }
- if(this._y > 270 && this._y < 300)
- {
- if(this._x >= _root.user_mc._x - 25 && this._x <= _root.user_mc._x + 25)
- {
- if(this.clickN == 1)
- {
- trace("생성 걸림 = " + this._y);
- this.fishPlusF();
- this.removeMovieClip();
- }
- }
- }
- if(this.clickN == 3)
- {
- if(this._y > 270 && this._y < 310 && this._x >= _root.user_mc._x - 20 && this._x <= _root.user_mc._x + 20)
- {
- if(this.suVis == "no")
- {
- this.suVis = "yes";
- _root.placeVis = "yes";
- _root.user_mc.gotoAndStop("hitF");
- _root.lifeF();
- }
- }
- }
- else if(this.clickN == 2)
- {
- if(this._y > 275 && this._y < 310 && this._x >= _root.user_mc._x - 30 && this._x <= _root.user_mc._x + 30)
- {
- if(this.suVis == "no")
- {
- this.suVis = "yes";
- _root.placeVis = "yes";
- _root.speedN = 0;
- _root.user_mc.gotoAndStop("hitF");
- _root.lifeF();
- _root.moveStopF();
- }
- }
- }
- if(this._y > 320)
- {
- _root.placeVis = "no";
- this.removeMovieClip();
- }
- }
- function fishPlusF()
- {
- _root.user_mc.runi_mc.gotoAndPlay("eatF");
- _root.fishN = _root.fishN + 1;
- _root.gameSocreF(10);
- if(_root.fishN < 10)
- {
- _root.fishN1_mc.gotoAndStop(_root.fishN + "F");
- _root.fishN2_mc.gotoAndStop(1);
- }
- else
- {
- _root.fishN1_mc.gotoAndStop(_root.fishN % 10 + "F");
- _root.fishN2_mc.gotoAndStop(int(_root.fishN / 10) + "F");
- }
- }
- }
-