Frame 1
function RandomMovement(mc) {
mc.speed = _root.smokers_speed;
mc._width = 24;
mc._height = 24;
mc.counter = 0;
mc.xpos = random(650) + 1;
mc.ypos = random(500) + 1;
mc.filters = [gfps];
mc.onEnterFrame = function () {
this._x = this._x + ((this.xpos - this._x) / mc.speed);
this._y = this._y + ((this.ypos - this._y) / mc.speed);
if (Math.abs((this.ypos - this._y) / this.speed) < 1) {
this.counter++;
this.xpos = random(650) + 1;
this.ypos = random(500) + 1;
}
texter.text = this.xpos;
};
}
function CALC_Dist_Xv_Yv(x1, y1, x2, y2) {
A = {};
B = {};
A.xx = x1;
A.yy = y1;
B.xx = x2;
B.yy = y2;
dx = A.xx - B.xx;
dy = A.yy - B.yy;
distance = Math.sqrt((dx * dx) + (dy * dy));
return([distance, x_modifier, y_modifier, dx, dy]);
}
function Collide(item_smoker, item_ball) {
calc12312 = CALC_Dist_Xv_Yv(item_smoker._x, item_smoker._y, item_ball._x, item_ball._y);
distance = calc12312[0];
if (distance < min_stolknovenie) {
item_smoker.filters = [gfp];
item_smoker._color;
item_smoker.modifikat = random(20);
item_smoker.speed = random(25) + 10;
item_smoker.onEnterFrame = function () {
this._x = this._x + (((_root.ball._x - this._x) - this.modifikat) / this.speed);
this._y = this._y + (((_root.ball._y - this._y) - this.modifikat) / this.speed);
};
}
}
function MoveSomker(mc) {
mc._y = 0;
mc._x = 0;
mc.onEnterFrame = function () {
};
}
function moving(mc) {
mc.life = mc.life - 2;
mc._xscale = (mc._yscale = 100 - (mc.life * 3));
if (!mc.life) {
delete mc.onEnterFrame;
mc.removeMovieClip();
}
}
function SpawnSmoker() {
frame++;
if (frame == 24) {
frame = 0;
second++;
}
if (second == interval) {
namen = "smoker" + _root.smokers_number;
respname = "respawn" + random(7);
_root.smokers_number++;
if (_root.somkers_number == _root.smokers_depth) {
_root.smokers_number = 0;
}
_root.attachMovie("smoker", namen, _root.smokers_number);
_root[namen]._x = _root[respname]._x;
_root[namen]._y = _root[respname]._y;
RandomMovement(_root[namen]);
second = 0;
}
}
xspeed = 15;
yspeed = 15;
min_stolknovenie = 40;
frame = 0;
second = 0;
interval = 1;
smokers_number = 0;
smokers_depth = 100;
smokers_speed = 10;
Mouse.hide();
var gfp = (new flash.filters.GlowFilter(15269649, 26, 20, 20, 2, 3, false, false));
var gfpsk = (new flash.filters.GlowFilter(15269649, 26, 20, 20, 2, 3, false, true));
var gfps = (new flash.filters.GlowFilter(10066380, 26, 20, 20, 2, 3, false, false));
_root.onMouseMove = function () {
var _local2 = this.getNextHighestDepth();
var _local3 = follower.duplicateMovieClip("z" + _local2, _local2, {_x:_xmouse, _y:_ymouse, life:10});
_local3.onEnterFrame = function () {
moving(this);
};
};
ball.onEnterFrame = function () {
i = 0;
while (i < smokers_number) {
namenn = "smoker" + i;
trace(_root[namenn]);
Collide(_root[namenn], ball);
i++;
}
ball.filters = [gfp];
ball._x = ball._x + ((_xmouse - ball._x) / xspeed);
ball._y = ball._y + ((_ymouse - ball._y) / yspeed);
if (gfp.blurX <= 6) {
gfp.blurX = gfp.blurX + 6;
gfp.blurY = gfp.blurY + 6;
} else {
gfp.blurX = gfp.blurX - 1;
gfp.blurY = gfp.blurY - 1;
}
_root.onMouseDown = function () {
xspeed = 3;
yspeed = 3;
};
_root.onMouseUp = function () {
xspeed = 10;
yspeed = 10;
};
};
_root.onEnterFrame = function () {
SpawnSmoker();
};
Instance of Symbol 7 MovieClip "ball" in Frame 1
onClipEvent (enterFrame) {
}
Instance of Symbol 9 MovieClip in Frame 1
onClipEvent (enterFrame) {
_x = _root._xmouse;
_y = _root._ymouse;
}
Symbol 11 MovieClip Frame 5
stop();