home *** CD-ROM | disk | FTP | other *** search
- function Depth()
- {
- this.freeDepths = [1];
- }
- function Fee()
- {
- }
- function Bgr()
- {
- }
- function Enemy_s()
- {
- }
- function Enemy_e()
- {
- }
- function Enemy_x1()
- {
- }
- function Enemy_x2()
- {
- }
- function Pointer()
- {
- }
- EventEngine = function()
- {
- this._temp = [];
- this._listeners = [];
- };
- EventEngine.init = function(mc)
- {
- if(Object.broadcaster == undefined)
- {
- Object.broadCaster = mc;
- Object.broadCaster.__proto__ = new EventEngine();
- }
- };
- EventEngine.prototype._clearListeners = function()
- {
- this._sendevent("kleenup");
- this._listeners = [];
- };
- EventEngine.prototype._addlistener = function(obj)
- {
- var lNum = this._listeners.length;
- if(lNum)
- {
- while(lNum)
- {
- if(this._listeners[--lNum] == obj)
- {
- return 0;
- }
- }
- }
- this._listeners.push(obj);
- };
- EventEngine.prototype._removeListener = function(obj)
- {
- var lNum = this._listeners.length;
- if(lNum)
- {
- while(lNum)
- {
- if(this._listeners[--lNum] == obj)
- {
- this._listeners.splice(lNum,1);
- }
- }
- }
- };
- EventEngine.prototype._sendEvent = function(event, arg)
- {
- var lNum = this._listeners.length;
- if(lNum)
- {
- while(lNum)
- {
- this._listeners[--lNum][event](arg);
- }
- }
- };
- Depth.prototype.getDepth = function()
- {
- var long = this.freeDepths.length;
- var i = 1;
- while(long >= i)
- {
- if(this.freeDepths[i] == 0)
- {
- this.freeDepths[i] = 1;
- return i;
- }
- i++;
- }
- this.freeDepths.push(1);
- return long;
- };
- Depth.prototype.setDepth = function(d)
- {
- this.freeDepths[d] = 0;
- };
- MovieClip.prototype.mcIs = function(§class§)
- {
- this.__proto__ = eval("class").prototype;
- this.base = eval("class");
- };
- Object.prototype["extends"] = function(obj)
- {
- obj.prototype.__proto__ = this;
- };
- Fee.prototype.init = function()
- {
- this.oldPos = {x:this._x,y:this._y};
- this.friction = 20;
- this.heading = -1;
- this.reverse = 1;
- this.offsetx = 0;
- this.offsety = 0;
- this.gameIsOver = 0;
- this.hit = 0;
- this.goo = 0;
- this.swapDepths(1000);
- Object.broadcaster._addlistener(this);
- };
- Fee.prototype.checkHeading = function()
- {
- var dir = this.reverse * (-1 + int(this._y < _root._ymouse) * 2);
- if(dir != this.heading)
- {
- Object.heading.setHeading(this.heading = dir);
- }
- };
- Fee.prototype.isHit = function()
- {
- this.gotoAndPlay("hit");
- this.hit = 1;
- this.swapDepths(3000);
- Object.broadcaster._sendEvent("stop_game");
- };
- Fee.prototype.kleenup = function()
- {
- };
- Fee.prototype.setOver = function()
- {
- this.gameIsOver = 1;
- };
- Fee.prototype.getNuPos = function()
- {
- var nux = (_root._xmouse - this._x) * this.reverse;
- var nuy = (_root._ymouse - this._y) * this.reverse;
- var rad = Math.atan2(nuy,nux);
- this.destAng = Math.round(90 + rad / Math.Pi * 180);
- if(180 < this.destAng)
- {
- this.destAng -= 360;
- }
- var r1 = this._rotation - this.destAng;
- var r2 = 360 - Math.abs(r1);
- if(Math.abs(r1) >= Math.abs(r2))
- {
- if(0 >= this._rotation)
- {
- r = r2;
- }
- else
- {
- r = - r2;
- }
- }
- else
- {
- r = r1;
- }
- this.step = r / 2;
- this._rotation -= this.step / Math.ceil((this.goo + 1) / 10);
- var nux = this.oldPos.x - _root._xmouse;
- var nuy = this.oldPos.y - _root._ymouse;
- var nuPos = {x:nux,y:nuy};
- var nux = this._x - nuPos.x / ((this.friction + this.goo) / 2) * this.reverse;
- if(100 < nux)
- {
- if(nux < 600)
- {
- this.oldPos.x = this._x = nux;
- }
- else
- {
- this.oldPos.x = this._x = 600;
- }
- }
- else
- {
- this.oldPos.x = this._x = 100;
- }
- if(Math.abs(nuPos.y) >= 2.5)
- {
- var nuy = this._y - nuPos.y / (this.friction + this.goo) * this.reverse;
- if(150 < nuy)
- {
- if(nuy < 450)
- {
- this.oldPos.y = this._y = nuy;
- }
- else
- {
- this.oldPos.y = this._y = 450;
- }
- }
- else
- {
- this.oldPos.y = this._y = 150;
- }
- }
- this.checkHeading();
- };
- Fee.prototype.enterframe = function()
- {
- if(!this.hit)
- {
- this.getNuPos();
- }
- };
- Fee.prototype.stop_game = function()
- {
- this.enterframe = "";
- };
- Fee.prototype.kleen = function()
- {
- Object.broadcaster._removeListener(this);
- this.removeMovieClip();
- };
- Fee.prototype.setReverse = function(r)
- {
- this.offsetx = this.offsety = 0;
- this.reverse = r;
- };
- Fee.prototype.setGoo = function(g)
- {
- this.goo += g;
- };
- Fee.prototype.setState = function(f)
- {
- this.korper.gotoAndStop(this.korper._currentframe + f);
- };
- Bgr.prototype.init = function(max, p, pl)
- {
- this.point_target = p;
- this.max = max;
- this.player = pl;
- this.reverse = 1;
- this.goo = 0;
- this.friction = 40;
- Object.broadcaster._addlistener(this);
- this.position = 0;
- this.oldForce = 0;
- this.y = this._y;
- o = _root.stuff;
- this.minClip = 0;
- this.maxClip = 7;
- var x = this.minclip;
- i = this.minclip;
- while(i < this.maxclip + 2)
- {
- if(o[i])
- {
- var c = o[i][3];
- _root[c].duplicateMovieClip("stuff" + i,i);
- var clip = _root["stuff" + i];
- clip._x = o[i][0];
- clip._y = o[i][1] + i * 100;
- if(c == "bank")
- {
- clip.swapDepths(1001 + nu);
- }
- clip._rotation = o[i][2];
- clip.mcIs(_root["Enemy_" + o[i][4]]);
- var hitArea = o[i][4] + "_hit";
- if(this.player[hitArea])
- {
- clip.init(i,this.point_target,this.player[hitArea]);
- }
- else
- {
- clip.init(i,this.point_target,this.player.s_hit);
- }
- }
- i++;
- }
- };
- Bgr.prototype.enterframe = function()
- {
- var nuForce = this.reverse * ((300 - _root._ymouse) / (this.friction + this.goo));
- var head = -1 * Object.heading.getHeading();
- var nuf = this.force - nuforce / 30;
- if(0.5 < Math.abs(nuf))
- {
- this.force = nuf;
- }
- else
- {
- this.force = 0;
- }
- if(0 >= nuForce == head < 0)
- {
- this.y += this.force = nuForce;
- }
- else
- {
- this.y += this.force;
- }
- if(0 < this.y)
- {
- this.y -= this.max;
- }
- else if(this.y < - this.max)
- {
- this.y += this.max;
- }
- this._y = this.y;
- var skip = this.max * 100;
- var nupos = this.position - this.force;
- if(0 >= nupos)
- {
- nupos += skip;
- }
- else if(skip < nupos)
- {
- nupos -= skip;
- }
- if(this.force < 0)
- {
- var posOff = nupos / 100;
- var posOff2 = Math.floor(posOff);
- var nuScreen = (posOff2 + 7) % this.max;
- var del = this.minclip - 1;
- var ad = (this.maxClip + 2) % this.max;
- var old = (this.minClip + 1) % this.max;
- var nu = (this.maxClip + 1) % this.max;
- var nudir = 1;
- }
- else
- {
- var posOff = nupos / 100;
- var posOff2 = Math.floor(posOff);
- var del = this.maxclip + 1;
- var ad = Math.abs((this.max + (this.minClip - 2)) % this.max);
- var nuScreen = Math.abs((this.max + posOff2) % this.max);
- var nu = Math.abs((this.max + (this.minClip - 1)) % this.max);
- var old = Math.abs((this.max + (this.maxClip - 1)) % this.max);
- var nudir = -1;
- }
- if(nuScreen == nu)
- {
- var o = _root.stuff;
- if(0 < o[ad].length)
- {
- var c = o[ad][3];
- _root[c].duplicateMovieClip("stuff" + ad,ad);
- var clip = _root["stuff" + ad];
- clip._x = o[ad][0];
- var nuy = o[ad][1] + ad * 100 - nupos;
- if(nuy < -1000)
- {
- nuy += 8600;
- }
- clip._y = nuy;
- if(c == "bank")
- {
- clip.swapDepths(1001 + ad);
- }
- else if(c == "pfutz")
- {
- clip.gotoAndStop(o[ad][5]);
- }
- clip._rotation = o[ad][2];
- clip.mcIs(_root["Enemy_" + o[ad][4]]);
- var hitArea = o[ad][4] + "_hit";
- if(this.player[hitArea])
- {
- clip.init(ad,this.point_target,this.player[hitArea]);
- }
- else
- {
- clip.init(ad,this.point_target,this.player.s_hit);
- }
- }
- var num = (this.max + old - nudir) % this.max;
- if(0 < o[del].length)
- {
- var clip = _root["stuff" + del];
- clip.kleen();
- }
- this.maxClip = 0 >= nudir ? old : nu;
- this.minClip = 0 >= nudir ? nu : old;
- }
- this.position = nuPos;
- Object.broadcaster._sendEvent("move",this.force);
- };
- Bgr.prototype.stop_game = function()
- {
- this.enterframe = "";
- };
- Bgr.prototype.setReverse = function(r)
- {
- this.reverse = r;
- };
- Bgr.prototype.setGoo = function(g)
- {
- this.goo += g;
- };
- Array.prototype.addObjects = function(place, type, str)
- {
- for(i in "place")
- {
- var check = place[i];
- if(typeof check == type)
- {
- var isObject = check._name.indexOf(str) + 1;
- if(isObject)
- {
- this.push(check);
- }
- }
- }
- };
- Enemy_s.prototype.init = function(num, p, pl)
- {
- this.target = p;
- this.player = pl;
- this.y = this._y;
- this.hit = 0;
- this.num = num;
- this.max = 8;
- Object.broadcaster._addListener(this);
- };
- Enemy_s.prototype.move = function(f)
- {
- if(!this.hit)
- {
- this.y += f;
- this._y = this.y;
- if(this.hitTest(this.player))
- {
- this.gotoAndStop(2);
- this.hit = 1;
- _root.stuff[this.num] = [];
- this.target.setPoints();
- }
- }
- else if(this.wolk._currentframe < this.max)
- {
- this.wolk.gotoAndStop(++this.wolk._currentframe);
- }
- else
- {
- this.kleen();
- }
- };
- Enemy_s.prototype.stop_game = function()
- {
- this.enterframe = "";
- };
- Enemy_s.prototype.kleen = function()
- {
- Object.broadcaster._removeListener(this);
- this.removeMovieClip();
- };
- Enemy_e.prototype.init = function(num, p, pl)
- {
- this.target = p;
- this.y = this._y;
- this.hit = 0;
- this.player_hit = pl;
- this.player = pl._parent;
- this.num = num;
- this.max = 8;
- Object.broadcaster._addListener(this);
- };
- Enemy_e.prototype.kleen = function()
- {
- Object.broadcaster._removeListener(this);
- this.removeMovieClip();
- };
- Enemy_e.prototype.stop_game = function()
- {
- this.enterframe = "";
- };
- Enemy_e.prototype.move = function(f)
- {
- if(!this.hit)
- {
- if(this.area.hitTest(this.player_hit))
- {
- this.hit = 1;
- }
- }
- else
- {
- this.player.isHit();
- _root.stuff[this.num] = [];
- }
- this.y += f;
- this._y = this.y;
- };
- Enemy_x1.prototype.init = function(num, pt, p)
- {
- this.target = p;
- this.pointer = pt;
- this.y = this._y;
- this.hit = 0;
- this.cf = this._currentframe;
- this.goo = 0;
- this.num = num;
- this.max = 8;
- Object.broadcaster._addListener(this);
- };
- Enemy_x1.prototype.stop_game = function()
- {
- this.enterframe = "";
- };
- Enemy_x1.prototype.move = function(f)
- {
- if(!this.hit)
- {
- this.y += f;
- this._y = this.y;
- if(this.hitTest(this.target))
- {
- this.goo += this.cf * 10;
- Object.broadcaster._sendevent("setGoo",this.cf * 10);
- this.cf = this.cf + 1;
- this.gotoAndStop(cf);
- _root.stuff[this.num][5] = cf;
- }
- else
- {
- if(4 < this.cf)
- {
- this.player.setState(1);
- this.hit = 1;
- _root.stuff[this.num] = [];
- this._visible = 0;
- this.count = this.max;
- this.pointer.setPoints();
- }
- if(this.goo)
- {
- this.goo--;
- Object.broadcaster._sendevent("setGoo",-1);
- }
- }
- }
- else if(this.goo)
- {
- this.goo--;
- Object.broadcaster._sendevent("setGoo",-1);
- }
- else if(this.hit)
- {
- this.hit = 0;
- Object.broadcaster._sendevent("setGoo",0);
- this.kleen();
- }
- };
- Enemy_x1.prototype.kleen = function()
- {
- Object.broadcaster._removeListener(this);
- this.removeMovieClip();
- };
- Enemy_x2.prototype.init = function(num, pt, p)
- {
- this.target = p;
- this.pointer = pt;
- this.player = p._parent;
- this.y = this._y;
- this.hit = 0;
- this.num = num;
- this.max = 60;
- this.count = 0;
- Object.broadcaster._addListener(this);
- };
- Enemy_x2.prototype.stop_game = function()
- {
- this.enterframe = "";
- };
- Enemy_x2.prototype.move = function(f)
- {
- if(!this.hit)
- {
- this.y += f;
- this._y = this.y;
- if(this.hitTest(this.target))
- {
- this.player.setState(1);
- this.hit = 1;
- _root.stuff[this.num] = [];
- this._visible = 0;
- this.count = this.max;
- this.pointer.setPoints();
- Object.broadcaster._sendevent("setReverse",-1);
- }
- }
- else if(!this.count)
- {
- this.player.setState(-1);
- Object.broadcaster._sendevent("setReverse",1);
- this.kleen();
- }
- else
- {
- this.count--;
- }
- };
- Enemy_x2.prototype.kleen = function()
- {
- Object.broadcaster._removeListener(this);
- this.removeMovieClip();
- };
- Pointer.prototype.init = function(readout, p)
- {
- this.player = p;
- var r = readout;
- var r_n = r.length;
- this.max = 0;
- i = 0;
- while(i < r_n)
- {
- if(1 < r[i].length && r[i][4] != "e")
- {
- this.max = this.max + 1;
- }
- i++;
- }
- this.step = 264 / this.max;
- this._height = 0;
- };
- Pointer.prototype.setPoints = function()
- {
- this._height += this.step;
- this.max--;
- if(!this.max)
- {
- this.player.setOver();
- _root.gotoAndStop(_root._currentframe + 1);
- _root.blende.play();
- }
- };
- stuff_x = [[503,50,90,"kof1","e"],[166,74,0,"pfutz","x1",1],[344,37,0,"zeito","s"],[618,57,0,"cig2","s"],[482,22,0,"appel","s"],[102,37,0,"banan","s"],[241,37,90,"dose1","s"],[348,45,0,"batteri","x2"],[211,43,90,"kof2","e"],[337,54,0,"dose1","s"],[103,10,90,"kof1","e"],[202,32,135,"papier2","s"],[427,14,180,"bank","e"],[303,50,0,"trash","e"],[452,22,0,"papier1","s"],[303,1,0,"batteri","x2"],[366,74,180,"pfutz","x1",1],[137,54,90,"pfutz","x1",1],[120,35,0,"zeito","s"],[540,7,0,"trash","e"],[279,38,0,"dose2","s"],[149,50,0,"papier2","s"],[556,7,90,"bank","e"],[456,20,0,"pfutz","x1",1],[103,10,0,"kof2","e"],[337,54,-135,"cig2","s"],[37,32,0,"dose2","s"],[256,86,-135,"cig3","s"],[499,70,0,"trash","e"],[535,99,0,"batteri","x2"],[257,74,0,"banan","s"],[274,79,0,"kof2","e"],[89,32,0,"kof1","e"],[503,70,0,"kof2","e"],[324,73,0,"papier2","s"],[82,34,0,"cig2","s"],[520,62,0,"batteri","x2"],[232,68,0,"trash","e"],[382,20,0,"appel","s"],[537,54,0,"dose2","s"],[160,70,0,"papier2","s"],[459,11,90,"kof1","e"],[220,61,0,"pfutz","x1",1],[551,28,0,"dose2","s"],[128,36,0,"cig3","s"],[341,65,0,"bank","e"],[93,20,0,"trash","e"],[461,28,0,"pfutz","x1",1],[504,65,0,"kof2","e"],[275,20,0,"papier2","s"],[134,6,0,"batteri","x2"],[133,57,-90,"kof2","e"],[424,37,0,"appel","s"],[433,1,0,"cig1","s"],[299,85,0,"cig2","s"],[568,60,0,"cig3","s"],[524,46,0,"pfutz","x1",1],[159,7,0,"zeito","s"],[354,17,0,"dose1","s"],[73,35,0,"banan","s"],[222,67,180,"bank","e"],[499,18,0,"batteri","x2"],[567,64,0,"papier2","s"],[276,36,0,"appel","s"],[437,51,0,"dose1","s"],[73,16,0,"zeito","s"],[510,52,90,"kof1","e"],[190,85,0,"batteri","x2"],[249,33,0,"cig1","s"],[188,71,0,"dose2","s"],[303,10,180,"kof2","e"],[441,85,0,"pfutz","x1",1],[124,40,0,"trash","e"],[332,13,0,"cig2","s"],[549,20,0,"cig1","s"],[403,10,0,"bank","e"],[225,91,0,"banan","s"],[86,33,0,"batteri","x2"],[203,23,0,"kof2","e"],[570,48,0,"zeito","s"],[324,7,0,"cig3","s"],[124,37,0,"appel","s"],[492,75,0,"cig2","s"],[215,73,0,"bank","e"],[527,33,0,"papier2","s"],[]];
- EVENTengine.init(bc);
- MovieClip.prototype["extends"](Fee);
- MovieClip.prototype["extends"](Bgr);
- MovieClip.prototype["extends"](Enemy_s);
- MovieClip.prototype["extends"](Enemy_e);
- MovieClip.prototype["extends"](Enemy_x1);
- MovieClip.prototype["extends"](Enemy_x2);
- MovieClip.prototype["extends"](Pointer);
- Object.heading = {setHeading:function(h)
- {
- this.heading = h;
- },heading:-1,getHeading:function()
- {
- return this.heading;
- },setForce:function(f)
- {
- this.force = f;
- },force:0,getForce:function()
- {
- return this.force;
- }};
-