Frame 1
function screenOutCheckUMD(x, y) {
if (((Math.abs(x) <= (Stage.width / 2)) && (y <= 51)) && (y >= ((-Stage.height) + 51))) {
return(1);
}
return(0);
}
function vecLen(x, y) {
return(Math.sqrt((x * x) + (y * y)));
}
function unitX(x, y) {
if ((x == 0) && (y == 0)) {
return(0);
}
return(x / Math.sqrt((x * x) + (y * y)));
}
function unitY(x, y) {
if ((x == 0) && (y == 0)) {
return(0);
}
return(y / Math.sqrt((x * x) + (y * y)));
}
function atariLR(l1x, l1y, l2x, l2y, r1x, r1y, r2x, r2y) {
unit = 0.2;
ret = 0;
i = unit;
while (i <= 1) {
workX = l1x + ((l2x - l1x) * i);
workY = l1y + ((l2y - l1y) * i);
if ((((r1x <= workX) && (workX <= r2x)) && (r1y <= workY)) && (workY <= r2y)) {
ret = 1;
break;
}
i = i + unit;
}
return(ret);
}
function pushUMD(name, x, y, vx, vy) {
i = 0;
while (i < umdN) {
if (name == ("umd" + i)) {
} else if ((((eval (("_root.flyUMD.umd" + i) + ".disc._x") >= (x - 20)) && ((x + 20) >= eval (("_root.flyUMD.umd" + i) + ".disc._x"))) && (eval (("_root.flyUMD.umd" + i) + ".disc._y") >= (y - 20))) && ((y + 20) >= eval (("_root.flyUMD.umd" + i) + ".disc._y"))) {
Set(("_root.flyUMD.umd" + i) + ".state", 2);
Set(("_root.flyUMD.umd" + i) + ".velocityX", vx * 0.4);
Set(("_root.flyUMD.umd" + i) + ".velocityY", vy * 0.4);
Set(("_root.flyUMD.umd" + i) + ".age", 0);
}
i++;
}
}
Stage.scaleMode = "noScale";
Stage.align = "B";
_focusrect = false;
umdN = 0;
score = 0;
Frame 3
stop();
Symbol 8 MovieClip Frame 1
gotoAndStop(Math.floor(Math.random() * 2) + 1);
Symbol 10 MovieClip [umd_fly] Frame 1
function initUMDPara() {
angle = (60 - ((Math.min(_parent._parent.clickTime, 150) / 150) * 60)) + 5;
velocityX = (Math.random() * angle) - (angle / 2);
velocityY = -((Math.random() * 20) + 20);
velocityX = _root.unitX(velocityX, velocityY) * ((_parent._parent.clickTime / 6) + 10);
velocityY = _root.unitY(velocityX, velocityY) * ((_parent._parent.clickTime / 6) + 10);
rotate = (Math.random() * 120) - 60;
fly = (Math.random() * 4) + 2;
age = 0;
state = 0;
posX = 0;
posY = 0;
}
initUMDPara();
Instance of Symbol 9 MovieClip "disc" in Symbol 10 MovieClip [umd_fly] Frame 1
onClipEvent (enterFrame) {
if (_parent.state == 0) {
if (_parent.age >= _parent.fly) {
_parent.velocityX = _parent.velocityX * 0.5;
_parent.velocityY = _parent.velocityY * 0.5;
_parent.rotate = _parent.rotate * 0.5;
}
_root.pushUMD(_parent._name, this._x, this._y, _parent.velocityX, _parent.velocityY);
this._x = this._x + _parent.velocityX;
this._y = this._y + _parent.velocityY;
this.d._rotation = this.d._rotation + _parent.rotate;
this.s._rotation = this.s._rotation + _parent.rotate;
_parent.age++;
if (_parent.age >= (_parent.fly + 5)) {
_parent.posX = this._x;
_parent.posY = this._y;
_parent.state = -1;
}
}
if (_parent.state == 1) {
_root.pushUMD(_parent._name, this._x, this._y, this._x - _parent.posX, this._y - _parent.posY);
if (_root.atariLR(this._x, this._y, _parent.posX, _parent.posY, -20, 10, 20, 25) == 1) {
this.stopDrag();
this._x = 0;
this._y = 0;
_parent._parent._parent.psp.gotoAndPlay("start");
_parent.initUMDPara();
}
_parent.posX = this._x;
_parent.posY = this._y;
}
if (_parent.state == 2) {
if (_parent.age <= 10) {
if (_root.atariLR(this._x, this._y, _parent.posX, _parent.posY, -20, 10, 20, 25) == 1) {
this._x = 0;
this._y = 0;
this._rotation = 0;
_parent._parent._parent.psp.gotoAndPlay("start");
_parent.initUMDPara();
} else {
_parent.posX = this._x;
_parent.posY = this._y;
this._x = this._x + _parent.velocityX;
this._y = this._y + _parent.velocityY;
this.d._rotation = this.d._rotation + _parent.rotate;
this.s._rotation = this.s._rotation + _parent.rotate;
_parent.velocityX = _parent.velocityX * 0.6;
_parent.velocityY = _parent.velocityY * 0.6;
_parent.rotate = _parent.rotate * 0.6;
_parent.age++;
}
} else {
_parent.state = -1;
}
}
}
on (press) {
trace(this.s._x);
this.startDrag(false);
_parent.state = 1;
}
on (release, releaseOutside, rollOut) {
if (_parent.state == 1) {
this.stopDrag();
_parent.state = 2;
_parent.velocityX = this._x - _parent.posX;
_parent.velocityY = this._y - _parent.posY;
_parent.age = 0;
if (_root.vecLen(_parent.velocityX, _parent.velocityY) > 20) {
_parent.velocityX = _root.unitX(_parent.velocityX, _parent.velocityY) * 20;
_parent.velocityY = _root.unitY(_parent.velocityX, _parent.velocityY) * 20;
}
if ((_parent.velocityX == 0) && (_parent.velocityY == 0)) {
_parent.rotate = 0;
} else {
_parent.rotate = (Math.random() * 120) - 60;
}
if (_root.screenOutCheckUMD(this._x, this._y) == 0) {
_parent.velocityX = 0;
_parent.velocityY = 0;
_parent.rotate = 0;
_parent.state = -1;
this._x = _parent.posX;
this._y = _parent.posY;
}
}
}
Symbol 10 MovieClip [umd_fly] Frame 30
stop();
Symbol 14 MovieClip Frame 1
time = getTimer();
if (time >= 360000000) {
h = 99;
m = 59;
s = 59;
ms = 99;
} else {
h = Math.floor(time / 3600000);
time = time - (h * 3600000);
m = Math.floor(time / 60000);
time = time - (m * 60000);
s = Math.floor(time / 1000);
time = time - (s * 1000);
ms = Math.floor(time / 10);
}
if ((h == 0) && (m == 0)) {
text = (s + ":") + ms;
} else if (h == 0) {
text = (((m + ":") + s) + ":") + ms;
} else {
text = (((((h + ":") + m) + ":") + s) + ":") + ms;
}
this.time = text;
stop();
Symbol 15 MovieClip Frame 61
stop();
Symbol 15 MovieClip Frame 121
stop();
Symbol 18 Button
on (press) {
pressTime = getTimer();
}
on (release) {
_parent.clickTime = getTimer() - pressTime;
_parent.psp.gotoAndPlay("start");
_root.score++;
if ((_root.score % 100) == 0) {
_root.text.gotoAndPlay("timeDisplay");
}
if (_root.score < 10000) {
_parent.psp.psp.scr = _root.score;
} else {
if ((_root.score % 2) == 0) {
_parent.psp.psp.scr = "PSP";
}
if ((_root.score % 2) == 1) {
_parent.psp.psp.scr = "UMD";
}
}
i = _root.umdN;
attachMovie("umd_fly", "umd" + i, i);
setProperty("umd" + i, _y , -15);
i++;
_root.umdN = i;
}
Symbol 19 MovieClip Frame 1
clickTime = 0;
Symbol 26 MovieClip Frame 1
stop();
Symbol 26 MovieClip Frame 14
stop();