home *** CD-ROM | disk | FTP | other *** search
- movieclip.prototype.makecrash = function(tipe1, tipe2, total)
- {
- var i = 0;
- while(i < total)
- {
- r.attachmovie("crashing","rub" + r.rd,r.rd);
- var rbb = r["rub" + r.rd];
- rbb._xscale = 60 + random(100);
- rbb._yscale = 60 + random(40);
- if(random(100) > 70)
- {
- rbb._yscale = 120 + random(80);
- }
- rbb._x = this._x - 40 + random(80);
- rbb._y = this._y - 40 + random(80);
- rbb.vx = 0.2 * this.vx;
- rbb.vy = 0.2 * this.vy;
- if(random(100) > 50)
- {
- rbb.tipe = tipe1;
- }
- else
- {
- rbb.tipe = tipe2;
- }
- r.rd = r.rd + 1;
- i++;
- }
- };
- movieclip.prototype.makecrash_instruction = function(tipe1, tipe2, total)
- {
- var i = 0;
- while(i < total)
- {
- this.attachmovie("crashing","rub" + r.rd,r.rd);
- var ska = 60 + random(40);
- var rbb = this["rub" + r.rd];
- rbb._xscale = ska;
- rbb._yscale = ska;
- rbb._x = -40 + random(80);
- rbb._y = -40 + random(80);
- rbb.vx = 0.2 * this.vx;
- rbb.vy = 0.2 * this.vy;
- if(random(100) > 50)
- {
- rbb.tipe = tipe1;
- }
- else
- {
- rbb.tipe = tipe2;
- }
- r.rd = r.rd + 1;
- i++;
- }
- };
- movieclip.prototype.followmouse = function()
- {
- var nx = r._xmouse;
- var ny = r._ymouse;
- if(nx < 50)
- {
- nx = 50;
- }
- else if(nx > 550)
- {
- nx = 550;
- }
- var oldx = this._x;
- var oldy = this._y;
- this._x = nx + (this._x - nx) / 1.4;
- this._y = ny + (this._y - ny) / 1.4;
- r.vx = this._x - oldx;
- r.vy = this._y - oldy;
- };
- movieclip.prototype.letgo = function()
- {
- if(r.water._visible)
- {
- r.attachmovie("waterdrop","rub" + r.rd2,r.rd2);
- r["rub" + r.rd2]._x = r.water._x;
- r["rub" + r.rd2]._y = r.water._y;
- r.rubs.push("rub" + r.rd2);
- r.rd2--;
- r.water.removeMovieClip();
- }
- else if(r.rub2._visible)
- {
- r.attachmovie("rub","rub" + r.rd,r.rd);
- r["rub" + r.rd].tipe = r.got;
- r["rub" + r.rd].ys = 6;
- r["rub" + r.rd]._x = r.rub2._x;
- r["rub" + r.rd]._y = r.rub2._y;
- r["rub" + r.rd]._rotation = r.rub2._rotation;
- r.rubs.push("rub" + r.rd);
- r.rd = r.rd + 1;
- r.rub2.removeMovieClip();
- }
- r.got = 0;
- };
- Movieclip.prototype.findang = function(dx, dy)
- {
- return deg(math.atan2(dy,dx));
- };
- Movieclip.prototype.rad = function(qdeg)
- {
- return qdeg * 0.017453292519943295;
- };
- Movieclip.prototype.deg = function(qrad)
- {
- return qrad * 57.29577951308232;
- };
- Array.prototype.copy = Array.prototype.slice;
- Array.prototype.randomize = function()
- {
- return this.sort(function(a, b)
- {
- return Math.floor(Math.random() * 2) != 0 ? -1 : 1;
- }
- );
- };
- Array.prototype.removeElement = function(i)
- {
- if(i == null)
- {
- i = 0;
- }
- var r = this[i];
- var j = i;
- while(j < this.length - 1)
- {
- this[j] = this[j + 1];
- j++;
- }
- this.pop();
- return r;
- };
- Array.prototype.removeValue = function(a)
- {
- var i = 0;
- while(i < this.length)
- {
- if(a == this[i])
- {
- this.removeElement(i);
- }
- i++;
- }
- };
- Movieclip.prototype.fadescreen = function(speed)
- {
- if(!speed)
- {
- var speed = 5;
- }
- _root.createemptymovieclip("dark",100001);
- var d = _root.dark;
- with(d)
- {
- lineStyle(1,0,100);
- beginfill(0,100);
- moveto(-5000,-5000);
- lineto(5000,-5000);
- lineto(5000,5000);
- lineto(-5000,5000);
- endfill();
- d.onEnterFrame = function()
- {
- _alpha -= speed;
- if(_alpha <= 0)
- {
- removeMovieClip("");
- stop();
- }
- };
- }
- };
- Color.prototype.setBrightness = function(value)
- {
- this.setTransform({ra:100,rb:0,ga:100,gb:0,ba:100,bb:0});
- var trans = this.getTransform();
- var percent = Math.abs(value) / 100;
- var brightnessColor = value <= 0 ? 0 : 255;
- with(trans)
- {
- ra -= ra * percent;
- ga -= ga * percent;
- ba -= ba * percent;
- rb += (brightnessColor - rb) * percent;
- gb += (brightnessColor - gb) * percent;
- bb += (brightnessColor - bb) * percent;
- }
- this.setTransform(trans);
- };
- Color.prototype.resetcolor = function()
- {
- this.setTransform({ra:100,rb:0,ga:100,gb:0,ba:100,bb:0});
- };
-