Frame 6
stop();
sndHit = new Sound();
sndHit.attachSound("TEEDA2.WAV");
Symbol 4 MovieClip [mcCelOrg] Frame 1
stop();
Symbol 8 MovieClip [mcBallEditOrg] Frame 1
function start_fall(px, py, dx, dy, w, h) {
_x = px;
_y = py;
cnt = 0;
ax = (dx * w) - (dy * w);
ay = (dy * h) + (dx * h);
_x = (_x + ax);
_y = (_y + ay);
g = 0;
ax = ax * 0.5;
ay = ay * 0.5;
_visible = true;
_alpha = 100;
shadow._visible = false;
onEnterFrame = function () {
_x = (_x + ax);
_y = (_y + ay);
ax = ax * 0.9;
ay = ay * 0.9;
_y = (_y + g);
g = g + 10;
cnt++;
_alpha = (_alpha - 8);
if (cnt > 30) {
delete onEnterFrame;
}
};
}
function init() {
delete onEnterFrame;
_visible = true;
_alpha = 100;
shadow._visible = true;
}
stop();
Symbol 10 MovieClip Frame 7
stop();
Symbol 11 MovieClip Frame 1
stop();
Symbol 14 MovieClip [mcBallOrg] Frame 1
function start_fall(px, py, dx, dy, w, h) {
_x = px;
_y = py;
cnt = 0;
ax = (dx * w) - (dy * w);
ay = (dy * h) + (dx * h);
_x = (_x + ax);
_y = (_y + ay);
g = 0;
ax = ax * 0.5;
ay = ay * 0.5;
_visible = true;
_alpha = 100;
shadow._visible = false;
onEnterFrame = function () {
_x = (_x + ax);
_y = (_y + ay);
ax = ax * 0.9;
ay = ay * 0.9;
_y = (_y + g);
g = g + 10;
cnt++;
_alpha = (_alpha - 8);
if (cnt > 30) {
delete onEnterFrame;
}
};
}
function init() {
delete onEnterFrame;
_visible = true;
_alpha = 100;
shadow._visible = true;
}
stop();
Symbol 17 MovieClip [mcTimerDot] Frame 1
stop();
Symbol 24 MovieClip Frame 1
stop();
if (_root.lang) {
nextFrame();
}
Symbol 42 Button
on (release) {
getURL ("http://www.gamedesign.jp/");
}
Symbol 46 MovieClip Frame 1
stop();
if (_root.lang) {
nextFrame();
}
Symbol 47 MovieClip Frame 1
_visible = false;
Symbol 47 MovieClip Frame 2
_visible = true;
Symbol 47 MovieClip Frame 5
stop();
btStart.onPress = function () {
_parent.gotoAndStop("game");
};
Symbol 54 MovieClip Frame 1
_visible = false;
Symbol 54 MovieClip Frame 3
function stop_timer() {
delete onEnterFrame;
}
stop();
_visible = true;
rest = _parent.rest_time;
i = 0;
while (i < rest) {
mcname = "mc" + i;
attachMovie("mcTimerDot", mcname, i);
mc = eval (mcname);
mc._x = i * 10;
mc._y = 0;
i++;
}
st = getTimer();
sec = 0;
onEnterFrame = function () {
var s = Math.floor((getTimer() - st) / 1000);
if (sec != s) {
sec = s;
_parent.rest_time = rest - s;
var i = 0;
while (i < rest) {
var mc = eval ("mc" + i);
if (i < _parent.rest_time) {
mc.gotoAndStop(1);
} else {
mc.gotoAndStop(2);
}
i++;
}
if (sec >= rest) {
_parent.gotoAndStop("gameover");
}
}
};
Symbol 68 MovieClip Frame 1
_visible = false;
Symbol 68 MovieClip Frame 2
_visible = true;
Symbol 68 MovieClip Frame 16
stop();
if (_parent.foul == 2) {
nextFrame();
}
onPress = function () {
_parent.after_faul();
};
Symbol 72 MovieClip Frame 1
_visible = false;
Symbol 72 MovieClip Frame 2
_visible = true;
Symbol 72 MovieClip Frame 19
stop();
onPress = function () {
_parent.after_clear();
};
Symbol 79 Button
on (release) {
_parent._parent.gotoAndStop("title");
}
Symbol 80 Button
on (release) {
gotoAndStop ("rank");
}
Symbol 81 Button
on (release) {
getURL ("http://www.gamedesign.jp/");
}
Symbol 95 MovieClip Frame 1
_visible = false;
Symbol 95 MovieClip Frame 2
_visible = true;
Symbol 95 MovieClip Frame 33
stop();
Symbol 95 MovieClip Frame 38
score = Number(_parent.stage_no);
ranker = new Array();
RANK_MAX = 10;
i = 0;
while (i < RANK_MAX) {
ranker[i] = new Object();
i++;
}
CGIFile = "hisc.cgi?" + Math.floor(Math.random() * 1000);
myLoadVars = new LoadVars();
myLoadVars.onLoad = function (success) {
var _local1;
_local1 = 0;
while (_local1 < RANK_MAX) {
ranker[_local1].playername = myLoadVars["name" + _local1];
ranker[_local1].score = myLoadVars["score" + _local1];
_local1++;
}
rank_in = false;
_local1 = 0;
while (_local1 < RANK_MAX) {
if (score > Number(myLoadVars["score" + _local1])) {
rank_in = true;
}
_local1++;
}
if (rank_in) {
gotoAndStop ("entry");
} else {
gotoAndStop ("display");
}
};
myLoadVars.load(CGIFile);
Symbol 95 MovieClip Frame 43
stop();
btEntry.onRelease = function () {
playername = tfName.text;
if (playername.length > 20) {
playername = playername.slice(0, 20);
}
gotoAndStop ("save");
};
Symbol 95 MovieClip Frame 49
stop();
CGIFile = "hisc.cgi?" + Math.floor(Math.random() * 1000);
mySaveVars = new LoadVars();
mySaveVars.score = score;
mySaveVars.playername = playername;
myLoadVars = new LoadVars();
myLoadVars.onLoad = function (success) {
var _local1;
_local1 = 0;
while (_local1 < RANK_MAX) {
ranker[_local1].playername = myLoadVars["name" + _local1];
ranker[_local1].score = myLoadVars["score" + _local1];
_local1++;
}
gotoAndStop ("display");
};
mySaveVars.sendAndLoad(CGIFile, myLoadVars, "POST");
Symbol 95 MovieClip Frame 55
stop();
i = 0;
while (i < RANK_MAX) {
mc = eval ("mc" + i);
mc.tfRank.text = i + 1;
if (i == 0) {
mc.tfRank.text = "Top";
}
mc.tfName.text = ranker[i].playername;
mc.tfScore.text = "STAGE " + ranker[i].score;
i++;
}
Symbol 96 MovieClip Frame 1
_visible = false;
stage_no = 1;
ball_min = 3;
ball_max = 7;
ball_num = ball_min;
rest_time = 20;
timeup = 0;
pass = 0;
addx = [0, 1, 0, -1];
addy = [-1, 0, 1, 0];
xmax = 7;
ymax = 7;
cel_w = 40;
cel_h = 32;
prio_back = 0;
prio_cel = 100;
prio_ball = 200;
prio_front = 300;
c = 0;
cel = new Array();
i = 0;
while (i < ymax) {
cel[i] = new Array();
j = 0;
while (j < xmax) {
cel[i][j] = new Object();
cel[i][j].prio = c;
cel[i][j].px = cel_w * (j - i);
cel[i][j].py = cel_h * (j + i);
cel[i][j].ball = 0;
c++;
j++;
}
i++;
}
Symbol 96 MovieClip Frame 2
_visible = true;
Symbol 96 MovieClip Frame 4
function make_bmap() {
var _local4;
var _local1;
var _local2;
_local4 = 0;
while (_local4 < ymax) {
_local1 = 0;
while (_local1 < xmax) {
bmap[_local4][_local1] = 0;
_local1++;
}
_local4++;
}
var _local9 = 1 + Math.floor(Math.random() * (xmax - 2));
var _local8 = 1 + Math.floor(Math.random() * (ymax - 2));
bmap[_local8][_local9] = 1;
var _local7 = 1;
while (_local7 < ball_num) {
var _local5 = new Array();
var _local3 = 0;
_local4 = 0;
while (_local4 < ymax) {
_local1 = 0;
while (_local1 < xmax) {
if (bmap[_local4][_local1] == 0) {
} else {
_local2 = 0;
while (_local2 < 4) {
if (able_to_be_target(_local1, _local4, addx[_local2], addy[_local2])) {
_local5[_local3] = new Object();
_local5[_local3].cx = _local1;
_local5[_local3].cy = _local4;
_local5[_local3].dir = _local2;
_local3++;
}
_local2++;
}
}
_local1++;
}
_local4++;
}
if (_local3 == 0) {
break;
}
var _local6 = Math.floor(Math.random() * _local3);
appear_ball(_local5[_local6].cx, _local5[_local6].cy, _local5[_local6].dir);
_local7++;
}
draw_stage();
}
function able_to_be_target(ox, oy, ax, ay) {
var _local4 = ox;
var _local3 = oy;
var _local7 = 0;
while (true) {
var _local2 = _local4 + ax;
var _local1 = _local3 + ay;
if ((((_local2 < 0) || (_local2 >= xmax)) || (_local1 < 0)) || (_local1 >= ymax)) {
break;
}
if (bmap[_local1][_local2]) {
return(0);
}
_local7++;
_local4 = _local2;
_local3 = _local1;
}
if (_local7 == 0) {
return(0);
}
_local4 = ox;
_local3 = oy;
while (true) {
var _local2 = _local4 - ax;
var _local1 = _local3 - ay;
if ((((_local2 < 0) || (_local2 >= xmax)) || (_local1 < 0)) || (_local1 >= ymax)) {
return(0);
}
if (bmap[_local1][_local2] == 0) {
return(1);
}
_local4 = _local2;
_local3 = _local1;
}
}
function appear_ball(ox, oy, d) {
var _local4 = ox + addx[d];
var _local3 = oy + addy[d];
bmap[_local3][_local4] = 1;
var _local5 = new Array();
var _local6 = 0;
_local4 = ox;
_local3 = oy;
while (true) {
var _local2 = _local4 - addx[d];
var _local1 = _local3 - addy[d];
if ((((_local2 < 0) || (_local2 >= xmax)) || (_local1 < 0)) || (_local1 >= ymax)) {
break;
}
if (bmap[_local1][_local2] == 0) {
_local5[_local6] = new Object();
_local5[_local6].cx = _local2;
_local5[_local6].cy = _local1;
_local6++;
}
_local4 = _local2;
_local3 = _local1;
}
if (_local6 == 0) {
return(undefined);
}
var _local8 = Math.floor(Math.random() * _local6);
_local4 = ox;
_local3 = oy;
while (true) {
var _local2 = _local4 - addx[d];
var _local1 = _local3 - addy[d];
if ((((_local2 < 0) || (_local2 >= xmax)) || (_local1 < 0)) || (_local1 >= ymax)) {
trace("error");
break;
}
if (bmap[_local1][_local2]) {
} else {
bmap[_local3][_local4] = 0;
bmap[_local1][_local2] = 1;
}
if ((_local2 == _local5[_local8].cx) && (_local1 == _local5[_local8].cy)) {
break;
}
_local4 = _local2;
_local3 = _local1;
}
}
stage_txt = "Stage " + stage_no;
bmap = new Array();
i = 0;
while (i < ymax) {
bmap[i] = new Array();
j = 0;
while (j < xmax) {
bmap[i][j] = 0;
j++;
}
i++;
}
make_bmap();
Symbol 96 MovieClip Frame 10
i = 0;
while (i < ymax) {
j = 0;
while (j < xmax) {
cel[i][j].ball = bmap[i][j];
j++;
}
i++;
}
his = new Array();
his_c = 0;
Symbol 96 MovieClip Frame 11
i = 0;
while (i < ymax) {
j = 0;
while (j < xmax) {
mcname = (("mc_" + j) + "_") + i;
mcLayer.attachMovie("mcCelOrg", mcname, prio_cel + cel[i][j].prio);
mc = eval ("mcLayer." + mcname);
mc._x = cel[i][j].px;
mc._y = cel[i][j].py;
mc.gotoAndStop((1 + i) + j);
mcname = (("ball_" + j) + "_") + i;
mcLayer.attachMovie("mcBallOrg", mcname, prio_ball + cel[i][j].prio);
mc = eval ("mcLayer." + mcname);
mc._x = cel[i][j].px;
mc._y = cel[i][j].py;
if (cel[i][j].ball) {
mc._visible = true;
} else {
mc._visible = false;
}
j++;
}
i++;
}
mcLayer.attachMovie("mcBallOrg", "mcFall", prio_back);
mcLayer.mcFall._visible = false;
Symbol 96 MovieClip Frame 15
function start_wait() {
var i;
var j;
i = 0;
while (i < ymax) {
j = 0;
while (j < xmax) {
var mc = eval ((("mcLayer.ball_" + j) + "_") + i);
mc._x = cel[i][j].px;
mc._y = cel[i][j].py;
mc._alpha = 100;
if (cel[i][j].ball) {
mc.gotoAndStop(1);
mc._visible = true;
mc.onPress = function () {
var _local2 = this._name.split("_");
ball_x = Number(_local2[1]);
ball_y = Number(_local2[2]);
after_wait();
drag_ox = _xmouse;
drag_oy = _ymouse;
gotoAndStop ("drag");
};
} else {
mc._visible = false;
}
j++;
}
i++;
}
}
function after_wait() {
var i = 0;
while (i < ymax) {
var j = 0;
while (j < xmax) {
if (cel[i][j].ball == 0) {
} else {
var mc = eval ((("mcLayer.ball_" + j) + "_") + i);
delete mc.onPress;
}
j++;
}
i++;
}
btQuit.enabled = false;
btUndo.enabled = false;
}
function undo() {
if (his_c == 0) {
return(undefined);
}
var _local3;
var _local4;
_local3 = 0;
while (_local3 < ymax) {
_local4 = 0;
while (_local4 < xmax) {
cel[_local3][_local4].ball = bmap[_local3][_local4];
_local4++;
}
_local3++;
}
his_c--;
_local3 = 0;
while (_local3 < his_c) {
var _local6 = his[_local3].bx;
var _local5 = his[_local3].by;
var _local7 = his[_local3].dir;
while (true) {
var _local2 = _local6 + addx[_local7];
var _local1 = _local5 + addy[_local7];
if ((((_local2 < 0) || (_local2 >= xmax)) || (_local1 < 0)) || (_local1 >= ymax)) {
cel[_local5][_local6].ball = 0;
break;
}
if (cel[_local1][_local2].ball) {
} else {
cel[_local5][_local6].ball = 0;
cel[_local1][_local2].ball = 1;
}
_local6 = _local2;
_local5 = _local1;
}
_local3++;
}
}
stop();
btUndo.onRelease = function () {
undo();
start_wait();
};
btUndo.enabled = true;
btQuit.onRelease = function () {
_parent.gotoAndPlay("title");
};
btQuit.enabled = true;
start_wait();
Symbol 96 MovieClip Frame 20
stop();
mc = eval ((("mcLayer.ball_" + ball_x) + "_") + ball_y);
mc.gotoAndStop(2);
onMouseMove = function () {
var msx = (_xmouse - drag_ox);
var msy = (_ymouse - drag_oy);
if ((Math.abs(msx) + Math.abs(msy)) < 40) {
return(undefined);
}
dir = 0;
if (msx < 0) {
if (msy < 0) {
dir = 3;
} else {
dir = 2;
}
} else if (msy < 0) {
dir = 0;
} else {
dir = 1;
}
his[his_c] = new Object();
his[his_c].bx = ball_x;
his[his_c].by = ball_y;
his[his_c].dir = dir;
his_c++;
delete onMouseMove;
delete onMouseUp;
mc = eval ((("mcLayer.ball_" + ball_x) + "_") + ball_y);
mc.gotoAndStop(1);
gotoAndStop ("move");
};
onMouseUp = function () {
delete onMouseMove;
delete onMouseUp;
mc = eval ((("mcLayer.ball_" + ball_x) + "_") + ball_y);
mc.gotoAndStop(1);
gotoAndStop ("wait");
};
Symbol 96 MovieClip Frame 25
function check_clear() {
var _local3 = 0;
var _local2 = 0;
while (_local2 < ymax) {
var _local1 = 0;
while (_local1 < xmax) {
if (cel[_local2][_local1].ball) {
_local3++;
}
_local1++;
}
_local2++;
}
if (_local3 == 1) {
return(1);
}
return(0);
}
stop();
crack = 0;
cnt = 0;
kiss = 0;
onEnterFrame = function () {
var nx = (ball_x + addx[dir]);
var ny = (ball_y + addy[dir]);
var mc = eval ((("mcLayer.ball_" + ball_x) + "_") + ball_y);
var mc2 = eval ((("mcLayer.ball_" + nx) + "_") + ny);
var mcs = eval ((((("mcLayer.ball_" + ball_x) + "_") + ball_y) + ".mcSpark") + dir);
if ((((nx < 0) || (nx >= xmax)) || (ny < 0)) || (ny >= ymax)) {
delete onEnterFrame;
cel[ball_y][ball_x].ball = 0;
mc._visible = false;
mcLayer.mcFall.swapDepths((((nx < 0) || (ny < 0)) ? (prio_back) : (prio_front)));
mcLayer.mcFall.start_fall(mc._x, mc._y, addx[dir], addy[dir], cel_w, cel_h);
foul = 0;
if (crack == 0) {
foul = 1;
}
if (kiss) {
foul = 2;
}
if (foul) {
gotoAndStop ("foul");
} else if (check_clear()) {
if (timeup) {
gotoAndStop ("gameover");
} else {
gotoAndStop ("clear");
}
} else {
gotoAndStop ("wait");
}
return(undefined);
}
if (cel[ny][nx].ball) {
_root.sndHit.start();
mc.gotoAndStop(1);
mcs.gotoAndPlay(2);
mc2.gotoAndPlay(3);
ball_x = nx;
ball_y = ny;
crack++;
if (cnt == 0) {
kiss = 1;
}
} else {
cel[ball_y][ball_x].ball = 0;
cel[ny][nx].ball = 1;
ball_x = nx;
ball_y = ny;
mc._visible = false;
mc2._visible = true;
}
cnt++;
};
Symbol 96 MovieClip Frame 31
function after_faul() {
undo();
gotoAndStop ("wait");
}
stop();
Symbol 96 MovieClip Frame 37
function after_clear() {
stage_no++;
ball_num++;
if (ball_num > ball_max) {
ball_num = ball_min;
ball_max++;
if (ball_max >= 12) {
ball_max = 12;
}
}
rest_time = rest_time + 20;
if (rest_time > 78) {
rest_time = 78;
}
gotoAndPlay ("stage");
}
stop();
mcTimer.stop_timer();
Symbol 96 MovieClip Frame 43
stop();
var i = 0;
while (i < ymax) {
var j = 0;
while (j < xmax) {
if (cel[i][j].ball == 0) {
} else {
var mc = eval ((("mcLayer.ball_" + j) + "_") + i);
delete mc.onPress;
}
j++;
}
i++;
}
Symbol 97 MovieClip Frame 1
_visible = false;
Symbol 97 MovieClip Frame 2
_visible = true;
Symbol 97 MovieClip Frame 4
stop();
Symbol 97 MovieClip Frame 9
stop();