home *** CD-ROM | disk | FTP | other *** search
- movieclip.prototype.cekhit = function()
- {
- var i = 0;
- while(i < r.bul.length)
- {
- var b = r[r.bul[i]];
- if(b._alpha > 30)
- {
- if(this.hittest(b._x,b._y,1))
- {
- if(math.abs(b.dis - dis) < r.hitrange)
- {
- r.bul.removevalue(r.bul[i]);
- b.removeMovieClip();
- this.hit = 1;
- }
- }
- }
- i++;
- }
- };
- movieclip.prototype.cekhit2 = function()
- {
- var i = 0;
- while(i < r.bul.length)
- {
- var b = r[r.bul[i]];
- if(b._alpha > 30)
- {
- if(math.abs(b.ypoint - this._y) < r.aimrange)
- {
- if(this.z.hittest(b))
- {
- if(math.abs(b.dis - dis) < r.hitrange)
- {
- r.bul.removevalue(r.bul[i]);
- b.removeMovieClip();
- this.hit = 1;
- }
- }
- }
- }
- i++;
- }
- };
- movieclip.prototype.cekhita = function()
- {
- var i = 0;
- while(i < r.bul.length)
- {
- var b = r[r.bul[i]];
- if(math.abs(b.ypoint - this._y) < r.aimrange)
- {
- if(this.a.hittest(b._x,b._y))
- {
- if(math.abs(b.dis - dis) < r.hitrange)
- {
- r.bul.removevalue(r.bul[i]);
- b.removeMovieClip();
- this.hit = 1;
- }
- }
- }
- i++;
- }
- };
- 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++;
- }
- };
- 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});
- };
- Movieclip.prototype.fadescreen = function(speed)
- {
- if(!speed)
- {
- var speed = 5;
- }
- _root.createemptymovieclip("dark",1000001);
- 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();
- }
- };
- }
- };
-