home *** CD-ROM | disk | FTP | other *** search
- function setvol(vol)
- {
- _root.sound.setVolume(vol);
- }
- function happyend()
- {
- _root.reinit();
- _global.tmp = 4;
- _root.onEnterFrame = function()
- {
- _global.tmp = _global.tmp - 1;
- if(_global.tmp == 0)
- {
- _global.tmp = 120;
- _root.onEnterFrame = function()
- {
- _global.tmp = _global.tmp - 1;
- if(_global.tmp == 0)
- {
- _root.onEnterFrame = null;
- if(_global.lev < 12)
- {
- var _loc3_ = 1;
- while(_loc3_ < 13)
- {
- var _loc4_ = new Color(_root.colorer[_loc3_]);
- _loc4_.setRGB(0);
- _loc3_ = _loc3_ + 1;
- }
- var _loc5_ = new Color("_root.b" + (_global.lev + 1));
- _loc5_.setRGB(11141120);
- _root.exe.starter(_global.lev + 1);
- }
- else
- {
- _root.exe.starter(12);
- }
- }
- };
- _root.congratulations._visible = true;
- _root.congratulations.gotoAndPlay(2);
- }
- };
- }
- function reinit()
- {
- _root.congratulations._visible = false;
- _global.spherecounter = 0;
- var _loc4_ = 1;
- while(_loc4_ <= 9)
- {
- var _loc3_ = 1;
- while(_loc3_ <= 9)
- {
- _root.quadros[_loc4_ + 10 * _loc3_].gotoAndPlay("die");
- _root.links[_loc4_ + 10 * _loc3_] = null;
- _root.bools[_loc4_ + 10 * _loc3_] = 0;
- _root.spheres[_loc4_ + 10 * _loc3_].gotoAndPlay("die");
- _loc3_ = _loc3_ + 1;
- }
- _loc4_ = _loc4_ + 1;
- }
- _root.quadros = new Array();
- _root.spheres = new Array();
- }
- function initerOnPress()
- {
- this.startDrag(false);
- this.onMouseUp = _root.initerOnMouseUp;
- }
- function initerOnMouseUp()
- {
- this.stopDrag();
- var _loc5_ = 1;
- while(_loc5_ <= i)
- {
- var _loc4_ = 1;
- while(_loc4_ <= j)
- {
- if(_root.bools[_loc5_ + 10 * _loc4_] == 0 && this._x + 12.5 >= 28 * (_loc5_ - 1) && this._x + 12.5 <= 28 * _loc5_ && this._y + 12.5 >= 28 * (_loc4_ - 1) && this._y + 12.5 <= 28 * _loc4_ && (this.c1 == _loc5_ && Math.abs(this.c2 - _loc4_) == 2 || this.c2 == _loc4_ && Math.abs(this.c1 - _loc5_) == 2))
- {
- if(this.c1 == _loc5_ && _root.bools[_loc5_ + 5 * (_loc4_ + this.c2)] == 1 || this.c2 == _loc4_ && _root.bools[(_loc5_ + this.c1) / 2 + 10 * _loc4_] == 1)
- {
- _root.bools[this.c1 + 10 * this.c2] = 0;
- _root.links[this.c1 + 10 * this.c2] = null;
- _root.bools[_loc5_ + 10 * _loc4_] = 1;
- _root.bools[(_loc5_ + this.c1) / 2 + 5 * (_loc4_ + this.c2)] = 0;
- _root.s[0].start();
- _root.links[(_loc5_ + this.c1) / 2 + 5 * (_loc4_ + this.c2)].gotoAndPlay("die");
- _global.spherecounter = _global.spherecounter - 1;
- _global.spherescore = _global.spherescore + 1;
- _root.links[_loc5_ + 10 * _loc4_] = this;
- this._x = 29 * (_loc5_ - 1);
- this._y = 29 * (_loc4_ - 1);
- this.ok = true;
- this.c1 = _loc5_;
- this.c2 = _loc4_;
- if(_global.spherecounter == 1)
- {
- _root.s[2].start();
- _root.happyend();
- }
- }
- }
- _loc4_ = _loc4_ + 1;
- }
- _loc5_ = _loc5_ + 1;
- }
- if(!this.ok)
- {
- _root.s[3].start();
- this._x = 29 * (this.c1 - 1);
- this._y = 29 * (this.c2 - 1);
- }
- _root.scores.scores_box.text = _global.spherescore;
- this.ok = false;
- this.onMouseUp = null;
- }
- function h1(smth)
- {
- _root.s[5].start();
- var _loc5_ = this._name;
- _loc5_ = _loc5_.substr(1);
- var _loc3_ = 1;
- while(_loc3_ < 13)
- {
- var _loc4_ = new Color(_root.colorer[_loc3_]);
- _loc4_.setRGB(0);
- _loc3_ = _loc3_ + 1;
- }
- var _loc6_ = new Color(this);
- _loc6_.setRGB(11141120);
- _root.exe.starter(Number(_loc5_));
- }
- stop();
- _root.soundoff._visible = false;
- var sound = new Sound();
- var s = new Array(new Sound(),new Sound(),new Sound(),new Sound(),new Sound(),new Sound());
- var t1 = 0;
- while(t1 < 6)
- {
- s[t1].attachSound("s" + (t1 + 1));
- s[t1].setVolume(50);
- t1++;
- }
- _root.volsontrol.roller._y = 35;
- var colorer = new Array();
- colorer[1] = _root.b1;
- colorer[2] = _root.b2;
- colorer[3] = _root.b3;
- colorer[4] = _root.b4;
- colorer[5] = _root.b5;
- colorer[6] = _root.b6;
- colorer[7] = _root.b7;
- colorer[8] = _root.b8;
- colorer[9] = _root.b9;
- colorer[10] = _root.b10;
- colorer[11] = _root.b11;
- colorer[12] = _root.b12;
- _root.congratulations._visible = false;
- var tmpbool;
- var drag = false;
- _global.spherecounter;
- _global.spherescore = 0;
- _global.tmp = 3;
- _global.lev = 1;
- _global.i = 0;
- _global.j = 0;
- var mydef = new arrdefine();
- var exe = new Object();
- var initer = new Object();
- var quadros = new Array();
- var spheres = new Array();
- var bools = new Array();
- var links = new Array();
- initer.onMouseUp = initerOnMouseUp;
- initer.onPress = initerOnPress;
- exe.setPfieldSize = function()
- {
- _root.pfield._x = (330 - 29 * j) / 2;
- _root.pfield._y = (300 - 29 * (i - 1)) / 2;
- var _loc4_ = 1;
- while(_loc4_ <= _global.i)
- {
- var _loc3_ = 1;
- while(_loc3_ <= _global.j)
- {
- _root.initer._x = 29 * (_loc4_ - 1);
- _root.initer._y = 29 * (_loc3_ - 1);
- _root.quadros[_loc4_ + 10 * _loc3_] = _root.pfield.attachMovie("quadro","quadro" + _loc4_ + _loc3_,_loc4_ - 1000 * _loc3_,_root.initer);
- _root.quadros[_loc4_ + 10 * _loc3_].onPress = null;
- _root.quadros[_loc4_ + 10 * _loc3_].onMouseUp = null;
- if(_root.mydef.net[_global.lev - 1][_loc4_ + _global.i * (_loc3_ - 1) - 1])
- {
- _root.bools[_loc4_ + 10 * _loc3_] = 1;
- _root.spheres[_loc4_ + 10 * _loc3_] = new Object();
- _global.spherecounter = _global.spherecounter + 1;
- _root.spheres[_loc4_ + 10 * _loc3_] = _root.pfield.attachMovie("sphere","sphere" + _loc4_ + _loc3_,20 + _loc4_ + _loc3_ * 10,_root.initer);
- _root.links[_loc4_ + 10 * _loc3_] = _root.spheres[_loc4_ + 10 * _loc3_];
- _root.spheres[_loc4_ + 10 * _loc3_].onMouseUp = null;
- _root.spheres[_loc4_ + 10 * _loc3_].c1 = _loc4_;
- _root.spheres[_loc4_ + 10 * _loc3_].c2 = _loc3_;
- _root.spheres[_loc4_ + 10 * _loc3_].ok = false;
- }
- _loc3_ = _loc3_ + 1;
- }
- _loc4_ = _loc4_ + 1;
- }
- _root.scores.scores_box.text = _global.spherescore;
- };
- exe.starter = function(lev)
- {
- _global.spherescore = 0;
- _root.scores.scores_box.text = _global.spherescore;
- _root.reinit();
- _global.lev = lev;
- _global.tmp = 4;
- _root.onEnterFrame = function()
- {
- if(_global.tmp > 0)
- {
- _global.tmp = _global.tmp - 1;
- }
- else
- {
- _root.onEnterFrame = null;
- _root.mydef.setlevel(lev);
- _root.exe.setPfieldSize();
- }
- };
- };
- with(_root)
- {
- b1.onRelease = h1;
- b2.onRelease = h1;
- b3.onRelease = h1;
- b4.onRelease = h1;
- b5.onRelease = h1;
- b6.onRelease = h1;
- b7.onRelease = h1;
- b8.onRelease = h1;
- b9.onRelease = h1;
- b10.onRelease = h1;
- b11.onRelease = h1;
- b12.onRelease = h1;
- b13.onRelease = h1;
- }
- var mycolor = new Color(_root.b1);
- mycolor.setRGB(11141120);
- _root.exe.starter(1);
-