home *** CD-ROM | disk | FTP | other *** search
- stop();
- trace(modo);
- _root.createEmptyMovieClip("almacen",10);
- score = 0;
- vel = 5;
- radius = 12.5;
- probab = 30;
- probabp = 30;
- pausa = false;
- dmg = 0;
- tmpo = 0;
- rotor = 1.5;
- tam = 100;
- stam = 100;
- stam_dur = 0;
- start_time = getTimer();
- volumen.control._x = volumetrico;
- if(_root.modo == "inverse")
- {
- textoA.text = "Arrow keys";
- textoB.text = "Arrow keys [inverted]";
- }
- if(_root.modo == "hand")
- {
- textoA.text = "WASD";
- textoB.text = "Arrow keys";
- }
- onEnterFrame = function()
- {
- music.setVolume(volumen.control._x);
- if(tam < stam)
- {
- tam++;
- }
- if(tam > stam)
- {
- tam--;
- }
- if(elapsed_seconds - stam_dur >= 5)
- {
- stam = 100;
- }
- if(stam <= 0)
- {
- stam = 0;
- }
- toca = rank._currentframe + 1;
- vbar.bar._xscale = 100 - dmg;
- rank._rotation += rotor;
- if(elapsed_seconds >= 10 && rank._currentframe == 1)
- {
- rotor += 2;
- }
- if(elapsed_seconds >= 25 && rank._currentframe == 2)
- {
- rotor += 2;
- }
- if(elapsed_seconds >= 40 && rank._currentframe == 3)
- {
- rotor += 2;
- }
- if(elapsed_seconds >= 55 && rank._currentframe == 4)
- {
- rotor += 2;
- }
- if(elapsed_seconds >= 75 && rank._currentframe == 5)
- {
- rotor += 2;
- }
- if(elapsed_seconds >= 95 && rank._currentframe == 6)
- {
- rotor += 2;
- }
- if(elapsed_seconds >= 120 && rank._currentframe == 7)
- {
- rotor += 2;
- }
- if(elapsed_seconds >= 140 && rank._currentframe == 8)
- {
- rotor += 2;
- }
- if(elapsed_seconds >= 200 && rank._currentframe == 9)
- {
- rotor += 2;
- }
- if(rotor >= 90)
- {
- rank.gotoAndStop(toca);
- rotor = 1.5;
- }
- if(!pausa)
- {
- probab -= 0.0025;
- if(dmg >= 100)
- {
- volumetrico = volumen.control._x;
- score = elapsed_seconds;
- dmg = 100;
- _root.attachMovie("fininv","fininv",99999999 + _root.getNextHighestDepth());
- fininv.score.text = elapsed_seconds + " seconds";
- if(guardar.data.best < elapsed_seconds)
- {
- guardar.data.best = elapsed_seconds;
- }
- if(rotor <= 2)
- {
- fininv.ranko.gotoAndStop(toca - 1);
- }
- else
- {
- fininv.ranko.gotoAndStop(toca);
- }
- pausa = true;
- }
- elapsed_time = getTimer() - start_time;
- _root.count.text = elapsed_seconds;
- elapsed_seconds = Math.floor(elapsed_time / 1000);
- if(_root.modo == "inverse")
- {
- if(Key.isDown(37))
- {
- a._x -= vel;
- b._x += vel;
- }
- if(Key.isDown(39))
- {
- a._x += vel;
- b._x -= vel;
- }
- if(Key.isDown(38))
- {
- a._y -= vel;
- b._y += vel;
- }
- if(Key.isDown(40))
- {
- a._y += vel;
- b._y -= vel;
- }
- }
- if(_root.modo == "hand")
- {
- if(Key.isDown(65))
- {
- a._x -= vel;
- }
- if(Key.isDown(68))
- {
- a._x += vel;
- }
- if(Key.isDown(87))
- {
- a._y -= vel;
- }
- if(Key.isDown(83))
- {
- a._y += vel;
- }
- if(Key.isDown(37))
- {
- b._x -= vel;
- }
- if(Key.isDown(39))
- {
- b._x += vel;
- }
- if(Key.isDown(38))
- {
- b._y -= vel;
- }
- if(Key.isDown(40))
- {
- b._y += vel;
- }
- }
- if(a._x < 16.5)
- {
- a._x = 16.5;
- }
- if(a._x > 235.5)
- {
- a._x = 235.5;
- }
- if(a._y > 237.5)
- {
- a._y = 237.5;
- }
- if(a._y < 16.5)
- {
- a._y = 16.5;
- }
- if(b._x < 264.5)
- {
- b._x = 264.5;
- }
- if(b._x > 483.5)
- {
- b._x = 483.5;
- }
- if(b._y > 237.5)
- {
- b._y = 237.5;
- }
- if(b._y < 16.5)
- {
- b._y = 16.5;
- }
- e = almacen.getNextHighestDepth();
- i = almacen.getNextHighestDepth() + 3;
- if(random(probab) == 0)
- {
- var enemy = _root.almacen.attachMovie("enemy","enemy" + e,e);
- _root.guardar.data.enemy = _root.guardar.data.enemy + 1;
- enemy._y = -10;
- enemy._x = Math.random() * 220 + 15;
- enemy.velo = Math.random() * 5 + 1;
- enemy.rotor = 3;
- enemy.onEnterFrame = function()
- {
- this._xscale = _root.tam;
- this._yscale = _root.tam;
- if(!pausa)
- {
- if(_root.a.ha.hitTest(this) or _root.b.hb.hitTest(this))
- {
- _root.dmg = _root.dmg + 1;
- }
- this._rotation += enemy.rotor;
- this._y += enemy.velo;
- if(this._y > 250)
- {
- this._y = 250;
- enemy.rotor = 0;
- this._rotation = this._rotation;
- this._alpha = this._alpha - 1;
- }
- if(this._alpha <= 0)
- {
- this.removeMovieClip();
- }
- }
- };
- }
- if(random(probab) == 0)
- {
- var Enemy = _root.almacen.attachMovie("enemy","enemy" + e,e);
- _root.guardar.data.enemy = _root.guardar.data.enemy + 1;
- Enemy._y = -10;
- Enemy._x = Math.random() * 220 + 265;
- Enemy.velo = Math.random() * 5 + 1;
- Enemy.rotor = 3;
- Enemy.onEnterFrame = function()
- {
- this._xscale = _root.tam;
- this._yscale = _root.tam;
- if(!pausa)
- {
- if(_root.a.ha.hitTest(this) or _root.b.hb.hitTest(this))
- {
- _root.dmg = _root.dmg + 1;
- }
- this._rotation += Enemy.rotor;
- this._y += Enemy.velo;
- if(this._y > 250)
- {
- this._y = 250;
- Enemy.rotor = 0;
- this._rotation = this._rotation;
- this._alpha = this._alpha - 1;
- }
- if(this._alpha <= 0)
- {
- this.removeMovieClip();
- }
- }
- };
- }
- if(random(probab * 2) == 0)
- {
- _root.guardar.data.enemy += 2;
- var _loc3_ = _root.almacen.attachMovie("pinchod","pinchod" + e,e);
- _loc3_._y = Math.random() * 230 + 10;
- _loc3_._x = 520;
- _loc3_.onEnterFrame = function()
- {
- if(!pausa)
- {
- if(this._x > 250)
- {
- this._x -= 3;
- }
- if(_root.a.ha.hitTest(this) or _root.b.hb.hitTest(this))
- {
- _root.dmg = _root.dmg + 1;
- }
- if(this._x <= 250)
- {
- this._alpha -= 3;
- }
- if(this._alpha <= 20)
- {
- this.removeMovieClip();
- }
- }
- };
- var _loc4_ = _root.almacen.attachMovie("pinchoi","pinchoi" + i,i);
- _loc4_._y = Math.random() * 230 + 10;
- _loc4_._x = -20;
- _loc4_.onEnterFrame = function()
- {
- if(!pausa)
- {
- if(this._x < 250)
- {
- this._x += 3;
- }
- if(_root.a.ha.hitTest(this) or _root.b.hb.hitTest(this))
- {
- _root.dmg = _root.dmg + 1;
- }
- if(this._x >= 250)
- {
- this._alpha -= 3;
- }
- if(this._alpha <= 20)
- {
- this.removeMovieClip();
- }
- }
- };
- }
- if(random(probabp * 5) == 0)
- {
- var size = _root.almacen.attachMovie("size","size" + e,e);
- size._y = Math.random() * 220 + 15;
- size._x = Math.random() * 220 + 15;
- size.muerte = elapsed_seconds;
- size.onEnterFrame = function()
- {
- if(!pausa)
- {
- this._rotation += 1.2;
- if((_root.a.ha.hitTest(this) or _root.b.hb.hitTest(this)) and this._currentframe <= 14)
- {
- this.gotoAndPlay(15);
- _root.stam_dur = _root.elapsed_seconds;
- _root.stam += 50;
- _root.guardar.data.powers = _root.guardar.data.powers + 1;
- }
- if(_root.elapsed_seconds - size.muerte == 5)
- {
- this.gotoAndPlay(15);
- }
- }
- };
- }
- if(random(probabp * 5) == 0)
- {
- var sizem = _root.almacen.attachMovie("sizem","sizem" + e,e);
- sizem._y = Math.random() * 220 + 15;
- sizem._x = Math.random() * 220 + 265;
- sizem.muerte = elapsed_seconds;
- sizem.onEnterFrame = function()
- {
- if(!pausa)
- {
- this._rotation += 1.2;
- if((_root.a.ha.hitTest(this) or _root.b.hb.hitTest(this)) and this._currentframe <= 14)
- {
- this.gotoAndPlay(15);
- _root.stam_dur = _root.elapsed_seconds;
- _root.stam -= 25;
- _root.guardar.data.powers = _root.guardar.data.powers + 1;
- }
- if(_root.elapsed_seconds - sizem.muerte == 5)
- {
- this.gotoAndPlay(15);
- }
- }
- };
- }
- }
- };
- volumen.control.onPress = function()
- {
- volumen.control.onEnterFrame = function()
- {
- this._x = _root._xmouse;
- if(this._x <= 0)
- {
- this._x = 0;
- }
- if(this._x >= 100)
- {
- this._x = 100;
- }
- };
- };
- volumen.control.onMouseUp = function()
- {
- volumen.control.onEnterFrame = function()
- {
- };
- };
-