Frame 1
function SpawnToken() {
xpos = (Math.random() * 500) + 20;
name = "spawn" + depth;
_root.attachMovie("spawn", name, depth);
_root[name]._x = xpos + 45;
_root[name]._y = 500;
_root[name].xmov = speed;
_root[name].ymov = speed;
depth++;
_root[name].onEnterFrame = function () {
this._y = this._y - this.ymov;
if (this._y < 0) {
this.removeMovieClip();
}
if (colade != 1) {
m = 0;
while (m < pdepth) {
if (_root["boolet" + m]._x != null) {
var _local4 = this._x - _root["boolet" + m]._x;
var _local3 = this._y - _root["boolet" + m]._y;
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local5 <= ((this._width / 2) + (_root["boolet" + m]._width / 2))) {
if (colade != 1) {
this.removeMovieClip();
colade = 1;
}
}
}
m++;
}
}
};
}
speed = 2;
depth = 100;
i = 500;
pspeed = 4;
pdepth = 800;
nose = 40;
_root.onMouseMove = function () {
updateAfterEvent();
xdiff = _root._xmouse - palka._x;
ydiff = _root._ymouse - palka._y;
angle = Math.atan2(ydiff, xdiff);
angle = (angle * 180) / Math.PI;
palka._rotation = angle;
};
_root.onMouseDown = function () {
if (colade == 1) {
colade = 0;
}
angle = palka._rotation;
angle = (angle * Math.PI) / 180;
pdepth = pdepth + 2;
name = "boolet" + pdepth;
_root.attachMovie("boolet", name, pdepth);
_root[name]._x = palka._x + (nose * Math.cos(angle));
_root[name]._y = palka._y + (nose * Math.sin(angle));
_root[name].xmov = pspeed * Math.cos(angle);
_root[name].ymov = pspeed * Math.sin(angle);
_root[name].onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
};
myTimer = setInterval(SpawnToken, i);
Instance of Symbol 11 MovieClip in Symbol 12 MovieClip Frame 1
onClipEvent (load) {
timeA = 0;
median_fps_sum = 0;
median_fps_mod = 5;
median_fps_count = 0;
median_fps_sum2 = 0;
median_fps_mod2 = 25;
median_fps_count2 = 0;
}
onClipEvent (enterFrame) {
timeB = getTimer();
var fps_rough = Math.floor(1000 / (this.timeB - this.timeA));
timeA = timeB;
if (median_fps_count < median_fps_mod) {
median_fps_count++;
median_fps_sum = median_fps_sum + fps_rough;
} else {
this.current_fps = Math.floor(median_fps_sum / this.median_fps_count);
this.median_fps_sum = 0;
this.median_fps_count = 0;
}
if (median_fps_count2 < median_fps_mod2) {
median_fps_count2++;
median_fps_sum2 = median_fps_sum2 + fps_rough;
} else {
this.current_fps2 = Math.floor(median_fps_sum2 / this.median_fps_count2);
this.median_fps_sum2 = 0;
this.median_fps_count2 = 0;
}
if (current_fps > 30) {
current_fps = "--";
}
showvar = current_fps;
}