home *** CD-ROM | disk | FTP | other *** search
- class classes.fx.Asteroids
- {
- var c;
- var c2;
- var stage = "A";
- var exists = true;
- var Name = "asteroids";
- function Asteroids()
- {
- this.c = 0;
- this.c2 = 10;
- }
- function switchStage(which)
- {
- this.c = 0;
- this.c2 = 10;
- this.stage = which;
- }
- function createTypeA()
- {
- var _loc3_ = random(4);
- _root.fxID = _root.fxID + 1;
- if(_root.hyper)
- {
- _root["asteroid" + _root.fxID] = new classes.fx.Asteroid(_root.randRange(50,950),620,_root.randRange(1,2),"U",_root.randRange(1,6),_root.fxID,true);
- this.c2 = _root.randRange(4,25);
- }
- else
- {
- _root["asteroid" + _root.fxID] = new classes.fx.Asteroid(_root.randRange(_root.posArray[_loc3_][0],_root.posArray[_loc3_][1]),_root.randRange(_root.posArray[_loc3_][2],_root.posArray[_loc3_][3]),_root.randRange(1,2),_root.dirArray[_loc3_],_root.randRange(1,6),_root.fxID);
- this.c2 = _root.randRange(10,300);
- }
- _root.addFX("asteroid" + _root.fxID);
- this.c = 0;
- this.c2 *= 1 / _root.dif.speed;
- }
- function createTypeB()
- {
- var _loc3_ = random(4);
- _root.fxID = _root.fxID + 1;
- _root["asteroid" + _root.fxID] = new classes.fx.Asteroid(_root.randRange(_root.posArray[_loc3_][0],_root.posArray[_loc3_][1]),_root.randRange(_root.posArray[_loc3_][2],_root.posArray[_loc3_][3]),_root.randRange(1,3),_root.dirArray[_loc3_],_root.randRange(1,6),_root.fxID);
- _root.addFX("asteroid" + _root.fxID);
- this.c = 0;
- this.c2 = _root.randRange(2,30);
- this.c2 *= 1 / _root.dif.speed;
- }
- function createTypeC()
- {
- var _loc3_ = random(4);
- _root.fxID = _root.fxID + 1;
- if(_root.hyper)
- {
- _root["asteroid" + _root.fxID] = new classes.fx.Asteroid(_root.randRange(50,950),620,_root.randRange(2,4),"U",_root.randRange(1,6),_root.fxID,true);
- this.c2 = _root.randRange(3,10);
- }
- else
- {
- _root["asteroid" + _root.fxID] = new classes.fx.Asteroid(_root.randRange(_root.posArray[_loc3_][0],_root.posArray[_loc3_][1]),_root.randRange(_root.posArray[_loc3_][2],_root.posArray[_loc3_][3]),_root.randRange(1,2),_root.dirArray[_loc3_],_root.randRange(1,6),_root.fxID);
- this.c2 = _root.randRange(5,25);
- }
- _root.addFX("asteroid" + _root.fxID);
- _loc3_ = random(4);
- _root.fxID = _root.fxID + 1;
- _root["asteroidB" + _root.fxID] = new classes.fx.AsteroidB(_root.randRange(_root.posArray[_loc3_][0],_root.posArray[_loc3_][1]),_root.randRange(_root.posArray[_loc3_][2],_root.posArray[_loc3_][3]),1,_root.dirArray[_loc3_],_root.randRange(1,6),_root.fxID);
- _root.addFX("asteroidB" + _root.fxID);
- this.c = 0;
- this.c2 *= 1 / _root.dif.speed;
- }
- function createTypeD()
- {
- var _loc3_ = random(4);
- _root.fxID = _root.fxID + 1;
- _root["asteroid" + _root.fxID] = new classes.fx.Asteroid(_root.randRange(_root.posArray[_loc3_][0],_root.posArray[_loc3_][1]),_root.randRange(_root.posArray[_loc3_][2],_root.posArray[_loc3_][3]),_root.randRange(1,4),_root.dirArray[_loc3_],_root.randRange(1,6),_root.fxID);
- _root.addFX("asteroid" + _root.fxID);
- _loc3_ = random(4);
- _root.fxID = _root.fxID + 1;
- _root["asteroidB" + _root.fxID] = new classes.fx.AsteroidB(_root.randRange(_root.posArray[_loc3_][0],_root.posArray[_loc3_][1]),_root.randRange(_root.posArray[_loc3_][2],_root.posArray[_loc3_][3]),_root.randRange(1,2),_root.dirArray[_loc3_],_root.randRange(1,6),_root.fxID);
- _root.addFX("asteroidB" + _root.fxID);
- this.c = 0;
- this.c2 = _root.randRange(3,15);
- this.c2 *= 1 / _root.dif.speed;
- }
- function createTypeE()
- {
- var _loc3_ = random(4);
- _root.fxID = _root.fxID + 1;
- _root["asteroid" + _root.fxID] = new classes.fx.Asteroid(_root.randRange(_root.posArray[_loc3_][0],_root.posArray[_loc3_][1]),_root.randRange(_root.posArray[_loc3_][2],_root.posArray[_loc3_][3]),_root.randRange(3,5),_root.dirArray[_loc3_],_root.randRange(1,6),_root.fxID);
- _root.addFX("asteroid" + _root.fxID);
- _loc3_ = random(4);
- _root.fxID = _root.fxID + 1;
- _root["asteroidB" + _root.fxID] = new classes.fx.AsteroidB(_root.randRange(_root.posArray[_loc3_][0],_root.posArray[_loc3_][1]),_root.randRange(_root.posArray[_loc3_][2],_root.posArray[_loc3_][3]),_root.randRange(1,3),_root.dirArray[_loc3_],_root.randRange(1,6),_root.fxID);
- _root.addFX("asteroidB" + _root.fxID);
- this.c = 0;
- this.c2 = _root.randRange(2,8);
- this.c2 *= 1 / _root.dif.speed;
- }
- function createTypeF()
- {
- var _loc3_ = random(4);
- _root.fxID = _root.fxID + 1;
- _root["asteroid" + _root.fxID] = new classes.fx.Asteroid(_root.randRange(_root.posArray[_loc3_][0],_root.posArray[_loc3_][1]),_root.randRange(_root.posArray[_loc3_][2],_root.posArray[_loc3_][3]),_root.randRange(3,5),_root.dirArray[_loc3_],_root.randRange(1,6),_root.fxID);
- _root.addFX("asteroid" + _root.fxID);
- this.c = 0;
- this.c2 = _root.randRange(10,60);
- this.c2 *= 1 / _root.dif.speed;
- }
- function createTypeG()
- {
- var _loc3_ = random(4);
- _root.fxID = _root.fxID + 1;
- _root["asteroid" + _root.fxID] = new classes.fx.Asteroid(_root.randRange(_root.posArray[_loc3_][0],_root.posArray[_loc3_][1]),_root.randRange(_root.posArray[_loc3_][2],_root.posArray[_loc3_][3]),_root.randRange(2,4),_root.dirArray[_loc3_],_root.randRange(1,6),_root.fxID);
- _root.addFX("asteroid" + _root.fxID);
- this.c = 0;
- this.c2 = _root.randRange(50,150);
- this.c2 *= 1 / _root.dif.speed;
- }
- function createTypeH()
- {
- var _loc3_ = random(4);
- _root.fxID = _root.fxID + 1;
- if(_root.hyper)
- {
- _root["asteroid" + _root.fxID] = new classes.fx.Asteroid(_root.randRange(50,950),620,_root.randRange(1,4),"U",_root.randRange(1,6),_root.fxID);
- }
- else
- {
- _root["asteroid" + _root.fxID] = new classes.fx.Asteroid(_root.randRange(_root.posArray[_loc3_][0],_root.posArray[_loc3_][1]),_root.randRange(_root.posArray[_loc3_][2],_root.posArray[_loc3_][3]),_root.randRange(1,4),_root.dirArray[_loc3_],_root.randRange(1,6),_root.fxID);
- }
- _root.addFX("asteroid" + _root.fxID);
- if(random(2) == 1)
- {
- _loc3_ = random(4);
- _root.fxID = _root.fxID + 1;
- _root["asteroidB" + _root.fxID] = new classes.fx.AsteroidB(_root.randRange(_root.posArray[_loc3_][0],_root.posArray[_loc3_][1]),_root.randRange(_root.posArray[_loc3_][2],_root.posArray[_loc3_][3]),_root.randRange(1,2),_root.dirArray[_loc3_],_root.randRange(1,6),_root.fxID);
- _root.addFX("asteroidB" + _root.fxID);
- }
- this.c = 0;
- this.c2 = _root.randRange(15,50);
- this.c2 *= 1 / _root.dif.speed;
- }
- function createTypeI()
- {
- var _loc3_ = random(4);
- _root.fxID = _root.fxID + 1;
- _root["asteroid" + _root.fxID] = new classes.fx.Asteroid(_root.randRange(_root.posArray[_loc3_][0],_root.posArray[_loc3_][1]),_root.randRange(_root.posArray[_loc3_][2],_root.posArray[_loc3_][3]),_root.randRange(1,5),_root.dirArray[_loc3_],_root.randRange(1,6),_root.fxID);
- _root.addFX("asteroid" + _root.fxID);
- if(random(2) == 1)
- {
- _loc3_ = random(4);
- _root.fxID = _root.fxID + 1;
- _root["asteroidB" + _root.fxID] = new classes.fx.AsteroidB(_root.randRange(_root.posArray[_loc3_][0],_root.posArray[_loc3_][1]),_root.randRange(_root.posArray[_loc3_][2],_root.posArray[_loc3_][3]),_root.randRange(1,3),_root.dirArray[_loc3_],_root.randRange(1,6),_root.fxID);
- _root.addFX("asteroidB" + _root.fxID);
- }
- this.c = 0;
- this.c2 = _root.randRange(3,15);
- this.c2 *= 1 / _root.dif.speed;
- }
- function main()
- {
- this.c = this.c + 1;
- if(this.c >= this.c2)
- {
- this["createType" + this.stage]();
- }
- }
- }
-