Frame 1
onEnterFrame = function () {
if (Key.isDown(13)) {
gotoAndStop ("start");
}
};
stop();
Frame 2
var speed = 8;
var debug = false;
var se_block = new Sound();
se_block.attachSound("se_block");
var se_enemy = new Sound();
se_enemy.attachSound("se_enemy");
var nobi = Array(head, body1, body2, body3, tail);
var bno = 0;
var muteki = 0;
var muteki_score = 200;
var muteki_start_score = 0;
bar.red._xscale = 0;
bar.gold._visible = false;
var vec = nobi[0]._rotation;
var nvx = 0;
var nvy = 0;
score = 0;
length = nobi.length;
var level = 30;
var chk = 1;
onEnterFrame = function () {
var v2 = ((nobi.length - 5) * 0.1);
if (v2 > 9.9) {
v2 = 9.9;
}
if (Key.isDown(39)) {
vec = vec + (10 - v2);
} else if (Key.isDown(37)) {
vec = vec - (10 - v2);
}
nobi[0]._rotation = vec;
nvx = speed * Math.cos((Math.PI/180) * vec);
nvy = speed * Math.sin((Math.PI/180) * vec);
var _local1 = 1;
while (_local1 < nobi.length) {
var _local3 = nobi[_local1]._rotation;
var dx = (nobi[_local1 - 1]._x - nobi[_local1]._x);
var dy = (nobi[_local1 - 1]._y - nobi[_local1]._y);
var _local2 = ((Math.atan2(dy, dx) * 180) / Math.PI) - _local3;
if (_local2 > 180) {
_local2 = _local2 - 360;
}
if (_local2 < -180) {
_local2 = _local2 + 360;
}
if (_local1 == 1) {
_local3 = _local3 + (_local2 * 0.5);
} else {
_local3 = _local3 + (_local2 * 1.5);
}
nobi[_local1]._x = nobi[_local1]._x + ((speed * Math.cos((Math.PI/180) * _local3)) - nvx);
nobi[_local1]._y = nobi[_local1]._y + ((speed * Math.sin((Math.PI/180) * _local3)) - nvy);
nobi[_local1]._rotation = _local3;
_local1++;
}
if ((Math.random() * 1) < 2) {
var mc = attachMovie("Block", "block" + bno, bno);
mc.life = 200;
if (Math.random() < 0.5) {
if (nvx > 0) {
mc._x = Stage.width + 50;
} else {
mc._x = -50;
}
mc._y = Math.random() * Stage.height;
} else {
if (nvy > 0) {
mc._y = Stage.height + 50;
} else {
mc._y = -50;
}
mc._x = Math.random() * Stage.width;
}
mc.gotoAndStop(Math.floor(Math.random() * 18) + 1);
bno++;
}
if ((Math.random() * level) < 1) {
var mc = attachMovie("Enemy", "enemy" + bno, bno);
mc.life = 1000;
if (Math.random() < 0.5) {
if (nvx > 0) {
mc._x = Stage.width + 50;
} else {
mc._x = -50;
}
mc._y = (Math.random() * Stage.height) + 50;
} else {
if (nvy > 0) {
mc._y = Stage.height;
} else {
mc._y = -50;
}
mc._x = Math.random() * Stage.width;
}
bno++;
if (level < 10) {
level = level - -0.1;
} else {
level = level - 0.3;
}
if (level < 1) {
level = 5;
}
}
if (muteki > 0) {
muteki--;
if (muteki == 0) {
muteki_start_score = score;
muteki_score = score + 500;
bar.red._xscale = 0;
bar.gold._visible = false;
head.gotoAndStop(1);
} else if (muteki < 50) {
if (head._currentframe < 3) {
head.gotoAndPlay(3);
}
}
} else if (score >= muteki_score) {
muteki = 250;
bar.gold._visible = true;
head.gotoAndStop(2);
} else {
var len = (((score - muteki_start_score) * 100) / (muteki_score - muteki_start_score));
bar.red._xscale = len;
}
if (Key.isDown(40) || (Key.isDown(90))) {
var mc = nobi[nobi.length - 2].duplicateMovieClip("nobi" + bno, bno);
nobi.push(nobi[nobi.length - 1]);
nobi[nobi.length - 2] = mc;
length = nobi.length;
bno++;
}
if (Key.isDown(38) || (Key.isDown(88))) {
if (nobi.length > 5) {
var mc = nobi.pop();
mc._x = nobi[nobi.length - 1]._x;
mc._y = nobi[nobi.length - 1]._y;
removeMovieClip(nobi[nobi.length - 1]);
nobi[nobi.length - 1] = mc;
length = nobi.length;
}
}
};
stop();
Frame 3
stopAllSounds();
var i = 1;
while (i < nobi.length) {
removeMovieClip(nobi[i]);
i++;
}
onEnterFrame = function () {
if (Key.isDown(13) && (hide_plate._visible)) {
gotoAndStop ("start");
}
if (Key.isDown(83) && (hide_plate._visible)) {
hide_plate._visible = false;
Selection.setFocus(name_txt);
}
};
Symbol 5 MovieClip [Enemy] Frame 1
onEnterFrame = function () {
var _local1 = _root;
_rotation = (_rotation + 10);
var r = ((_width - 15) / 2);
var dx = (_local1.head._x - _x);
var _local3 = _local1.head._y - _y;
var r2 = Math.sqrt((dx * dx) + (_local3 * _local3));
if (r2 < r) {
if (!_local1.debug) {
_local1.gotoAndStop("over");
}
}
_x = (_x - _local1.nvx);
_y = (_y - _local1.nvy);
if (_local1.score > 5000) {
var _local2 = _local1.score / 10000;
if (_local2 > 6) {
_local2 = 6;
}
_x = (_x + ((_local2 * dx) / r2));
_y = (_y + ((_local2 * _local3) / r2));
}
if ((((_x < (-Stage.width)) || (_x > (Stage.width * 2))) || (_y < (-Stage.height))) || (_y > (Stage.height * 2))) {
removeMovieClip(this);
}
life--;
if (life < 0) {
removeMovieClip(this);
}
if (_local1.muteki > 0) {
gotoAndStop (2);
}
if (_local1._currentframe != 2) {
removeMovieClip(this);
}
};
stop();
Symbol 5 MovieClip [Enemy] Frame 2
var mode = 0;
var vx = 0;
var vy = 0;
onEnterFrame = function () {
var _local1 = _root;
if (mode == 0) {
_rotation = (_rotation + 40);
var _local2 = (_width + 20) / 2;
var dx = (_local1.head._x - _x);
var _local3 = _local1.head._y - _y;
if (((dx * dx) + (_local3 * _local3)) < (_local2 * _local2)) {
vx = ((Math.random() * 10) - 5) + _local1.nvx;
vy = -10 + _local1.nvy;
mode = 1;
_local1.score = _local1.score + (20 + ((_local1.nobi.length - 5) * 10));
_local1.se_enemy.start();
}
} else {
_x = (_x + vx);
_y = (_y + vy);
vy++;
}
_x = (_x - _local1.nvx);
_y = (_y - _local1.nvy);
if ((((_x < (-Stage.width)) || (_x > (Stage.width * 2))) || (_y < (-Stage.height))) || (_y > (Stage.height * 2))) {
removeMovieClip(this);
}
if ((_local1.muteki == 0) && (mode == 0)) {
gotoAndStop (1);
}
if (_local1._currentframe != 2) {
removeMovieClip(this);
}
};
stop();
Symbol 24 MovieClip [Block] Frame 1
var mode = 0;
var vx = 0;
var vy = 0;
onEnterFrame = function () {
var _local1 = _root;
if (mode == 0) {
var _local2 = (_local1.head._width + _width) / 2;
var dx = (_local1.head._x - _x);
var _local3 = _local1.head._y - _y;
if (((dx * dx) + (_local3 * _local3)) < (_local2 * _local2)) {
vx = ((Math.random() * 10) - 5) + _local1.nvx;
vy = -10 + _local1.nvy;
mode = 1;
_local1.score = _local1.score + 10;
_local1.se_block.start();
}
} else {
_x = (_x + vx);
_y = (_y + vy);
vy++;
}
_x = (_x - _local1.nvx);
_y = (_y - _local1.nvy);
if ((((_x < (-Stage.width)) || (_x > (Stage.width * 2))) || (_y < (-Stage.height))) || (_y > (Stage.height * 2))) {
removeMovieClip(this);
}
life--;
if (life < 0) {
removeMovieClip(this);
}
if (_local1._currentframe != 2) {
removeMovieClip(this);
}
};
Symbol 33 MovieClip Frame 1
stop();
Symbol 33 MovieClip Frame 10
gotoAndPlay (3);
Symbol 53 Button
on (release) {
getURL ("index.php?rn=" + Math.random(), "_top", "POST");
}