home *** CD-ROM | disk | FTP | other *** search
- x = 100;
- y = 150;
- xb = -6;
- yb = 6;
- _xscale = Math.round(Math.random() * (y - x)) + x;
- _yscale = _xscale;
- xspeed = Math.round(Math.random() * (yb - xb)) + xb;
- switch(type)
- {
- case "slow":
- if(_root.sound)
- {
- sound = new Sound(this);
- sound.attachSound("energyballs");
- sound.setVolume(60);
- sound.start();
- }
- speed = 2;
- break;
- default:
- if(_root.sound)
- {
- sound = new Sound(this);
- sound.attachSound("bigball");
- sound.setVolume(60);
- sound.start();
- }
- case "homing":
- speed = random(4) + 2;
- }
- time = random(60);
- m = random(20);
- if(type == "homing")
- {
- if(_root.sound)
- {
- sound = new Sound(this);
- sound.attachSound("energyballs");
- sound.setVolume(60);
- sound.start();
- }
- lol = random(2);
- if(lol == 0)
- {
- this.removeMovieClip();
- }
- shotSpeed = 5;
- deltaX = _X - _root.car._x;
- deltaY = _Y - _root.car._y;
- angle = - Math.atan2(deltaX,deltaY);
- ySpeed = shotSpeed * Math.cos(angle);
- xSpeed = shotSpeed * Math.sin(angle);
- }
-