Frame 1
_global.scaling = 50;
drumHolder = new Array();
var i = 0;
while (i < 10) {
drumHolder[i] = new Sound(this);
drumHolder[i].attachSound("drum" + (i + 1));
i++;
}
_root.attachMovie("dudes", "stuff1", 30);
_root.attachMovie("dudes", "stuff2", 31);
_global.approach = function (start, end) {
if (Math.abs(start - end) > 0.1) {
return((start / 2) + (end / 2));
}
return(end);
};
doIt = function () {
this._x = approach(this._x, this.x);
this._y = approach(this._y, this.y);
this._rotation = this.rot + ((Math.random() * _root.tempo) * 0.01);
this._xscale = (this._yscale = this.sc);
};
stuff1._xscale = (stuff1._yscale = (stuff2._yscale = scaling));
stuff2._xscale = scaling * -1;
stuff1.x = 100;
stuff1.y = 200;
stuff2.x = 450;
stuff2.y = 200;
stuff1.onEnterFrame = doIt;
stuff2.onEnterFrame = doIt;
tempoSwitchCounter = 0;
switchAfter = 10;
tempo = 400;
changeBG = function () {
var _local2 = new Color(bground);
var _local1 = new Object();
_local1.ra = (Math.random() * 500) - 200;
_local1.rb = 100;
_local1.ga = (Math.random() * 500) - 200;
_local1.gb = 100;
_local1.ba = (Math.random() * 500) - 200;
_local1.bb = 100;
_local1.aa = 100;
_local1.ab = 0;
_local2.setTransform(_local1);
};
playSound = function () {
var _local2 = random(10);
var _local1 = random(10);
stuff1.gotoAndStop(_local2 + 1);
stuff2.gotoAndStop(_local1 + 1);
stuff1.rot = Math.random() * 360;
stuff2.rot = Math.random() * 360;
var _local4 = Math.random() * 550;
var _local3 = Math.random() * 550;
stuff1.x = _local4;
stuff2.x = _local3;
stuff1.y = Math.random() * 400;
stuff2.y = Math.random() * 400;
var _local7 = ((_local4 / 550) * 200) - 100;
var _local8 = ((_local3 / 550) * 200) - 100;
var _local6 = 10 + (Math.random() * 90);
var _local5 = 10 + (Math.random() * 90);
stuff1.sc = _local6;
stuff2.sc = _local5;
changeBG();
drumHolder[_local2].setPan(_local7);
drumHolder[_local1].setPan(_local8);
drumHolder[_local2].setVolume(_local6);
drumHolder[_local1].setVolume(_local5);
drumHolder[_local2].start(0, 0);
drumHolder[_local1].start(0, 0);
tempoSwitchCounter++;
if (tempoSwitchCounter > switchAfter) {
tempoSwitchCounter = 0;
tempo = random(200) + 200;
resetInterval();
}
};
resetInterval = function () {
clearInterval(beat);
beat = setInterval(playSound, tempo);
};
resetInterval();