Frame 1
function SpawnToken() {
trace(colade);
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 = 300;
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;
};
};
SpawnToken();
SpawnToken();
SpawnToken();
SpawnToken();