Frame 1
stop();
this.onEnterFrame = function () {
if (this.getBytesTotal() <= this.getBytesLoaded()) {
delete this.onEnterFrame;
gotoAndStop ("game");
}
};
Frame 3
stop();
Symbol 1 MovieClip [mcChipOrg] Frame 1
stop();
w = 100;
ox = 0;
oy = 0;
x = new Array(5);
y = new Array(5);
ax = new Array(5);
ay = new Array(5);
x[0] = ox;
y[0] = oy;
x[4] = ox + w;
y[4] = oy;
ah = 20;
aw = 20;
ax[2] = (w / 2) - aw;
ay[2] = ah;
ax[3] = (w / 2) + aw;
ay[3] = ah;
ph = (ay[2] + ay[3]) / 2;
x[2] = (ax[2] + ax[3]) / 2;
y[2] = ph;
aw = 5;
ah = 40;
ax[1] = (w / 2) - aw;
ay[1] = ph - ah;
ax[4] = (w / 2) + aw;
ay[4] = ay[1];
x[1] = (ax[2] + ax[1]) / 2;
y[1] = (ay[2] + ay[1]) / 2;
x[3] = (ax[4] + ax[3]) / 2;
y[3] = (ay[4] + ay[3]) / 2;
this.beginFill(16777215);
this.lineStyle(2, 0, 100);
this.moveTo(x[0], y[0]);
if (shapeTop.shape == 0) {
this.lineTo(w, 0);
} else {
p = shapeTop.shape;
ax[2] = (w / 2) - shapeTop.ax1;
ay[2] = shapeTop.ay1;
ax[3] = (w / 2) + shapeTop.ax2;
ay[3] = shapeTop.ay2;
ph = (ay[2] + ay[3]) / 2;
x[2] = (ax[2] + ax[3]) / 2;
y[2] = ph;
ax[1] = (w / 2) - shapeTop.ax0;
ay[1] = ph - shapeTop.ay0;
ax[4] = (w / 2) + shapeTop.ax3;
ay[4] = ph - shapeTop.ay3;
x[1] = (ax[2] + ax[1]) / 2;
y[1] = (ay[2] + ay[1]) / 2;
x[3] = (ax[4] + ax[3]) / 2;
y[3] = (ay[4] + ay[3]) / 2;
this.curveTo(ax[1], (-p) * ay[1], x[1], (-p) * y[1]);
this.curveTo(ax[2], (-p) * ay[2], x[2], (-p) * y[2]);
this.curveTo(ax[3], (-p) * ay[3], x[3], (-p) * y[3]);
this.curveTo(ax[4], (-p) * ay[4], x[4], (-p) * y[4]);
}
if (shapeRight.shape == 0) {
this.lineTo(w, w);
} else {
px = w;
py = 0;
p = shapeRight.shape;
ax[2] = (w / 2) - shapeRight.ax1;
ay[2] = shapeRight.ay1;
ax[3] = (w / 2) + shapeRight.ax2;
ay[3] = shapeRight.ay2;
ph = (ay[2] + ay[3]) / 2;
x[2] = (ax[2] + ax[3]) / 2;
y[2] = ph;
ax[1] = (w / 2) - shapeRight.ax0;
ay[1] = ph - shapeRight.ay0;
ax[4] = (w / 2) + shapeRight.ax3;
ay[4] = ph - shapeRight.ay3;
x[1] = (ax[2] + ax[1]) / 2;
y[1] = (ay[2] + ay[1]) / 2;
x[3] = (ax[4] + ax[3]) / 2;
y[3] = (ay[4] + ay[3]) / 2;
this.curveTo(px + (p * ay[1]), py + ax[1], px + (p * y[1]), py + x[1]);
this.curveTo(px + (p * ay[2]), py + ax[2], px + (p * y[2]), py + x[2]);
this.curveTo(px + (p * ay[3]), py + ax[3], px + (p * y[3]), py + x[3]);
this.curveTo(px + (p * ay[4]), py + ax[4], px + (p * y[4]), py + x[4]);
}
if (shapeBottom.shape == 0) {
this.lineTo(0, w);
} else {
px = 0;
py = w;
p = shapeBottom.shape;
ax[2] = (w / 2) - shapeBottom.ax1;
ay[2] = shapeBottom.ay1;
ax[3] = (w / 2) + shapeBottom.ax2;
ay[3] = shapeBottom.ay2;
ph = (ay[2] + ay[3]) / 2;
x[2] = (ax[2] + ax[3]) / 2;
y[2] = ph;
ax[1] = (w / 2) - shapeBottom.ax0;
ay[1] = ph - shapeBottom.ay0;
ax[4] = (w / 2) + shapeBottom.ax3;
ay[4] = ph - shapeBottom.ay3;
x[1] = (ax[2] + ax[1]) / 2;
y[1] = (ay[2] + ay[1]) / 2;
x[3] = (ax[4] + ax[3]) / 2;
y[3] = (ay[4] + ay[3]) / 2;
this.curveTo(px + ax[4], py + (p * ay[4]), px + x[3], py + (p * y[3]));
this.curveTo(px + ax[3], py + (p * ay[3]), px + x[2], py + (p * y[2]));
this.curveTo(px + ax[2], py + (p * ay[2]), px + x[1], py + (p * y[1]));
this.curveTo(px + ax[1], py + (p * ay[1]), px + x[0], py + (p * y[0]));
}
if (shapeLeft.shape == 0) {
this.lineTo(0, 0);
} else {
px = 0;
py = 0;
p = shapeLeft.shape;
ax[2] = (w / 2) - shapeLeft.ax1;
ay[2] = shapeLeft.ay1;
ax[3] = (w / 2) + shapeLeft.ax2;
ay[3] = shapeLeft.ay2;
ph = (ay[2] + ay[3]) / 2;
x[2] = (ax[2] + ax[3]) / 2;
y[2] = ph;
ax[1] = (w / 2) - shapeLeft.ax0;
ay[1] = ph - shapeLeft.ay0;
ax[4] = (w / 2) + shapeLeft.ax3;
ay[4] = ph - shapeLeft.ay3;
x[1] = (ax[2] + ax[1]) / 2;
y[1] = (ay[2] + ay[1]) / 2;
x[3] = (ax[4] + ax[3]) / 2;
y[3] = (ay[4] + ay[3]) / 2;
this.curveTo(px - (p * ay[4]), py + ax[4], px - (p * y[3]), py + x[3]);
this.curveTo(px - (p * ay[3]), py + ax[3], px - (p * y[2]), py + x[2]);
this.curveTo(px - (p * ay[2]), py + ax[2], px - (p * y[1]), py + x[1]);
this.curveTo(px - (p * ay[1]), py + ax[1], px - (p * y[0]), py + x[0]);
}
this.endFill();
Symbol 6 MovieClip Frame 4
stop();
Symbol 7 Button
on (release) {
_parent._parent.push_begin();
}
Symbol 10 Button
on (release) {
_parent._parent.push_continue();
}
Symbol 13 MovieClip Frame 1
stop();
Symbol 18 Button
on (release) {
getURL ("http://www.gamedesign.jp/");
}
Symbol 21 MovieClip Frame 1
function random_put() {
var i;
var j;
var posx = new Array();
var posy = new Array();
var cw = (cel_w * 1.5);
var ch = (cel_h * 1.5);
var xa = ((puz_x % cw) / 2);
var ya = ((puz_y % ch) / 2);
var x = xa;
var y = ya;
i = 0;
while (i < cmax) {
posx[i] = x;
posy[i] = y;
x = x + cw;
if (x > ((screen_w - cel_w) - 10)) {
x = xa;
y = y + ch;
} else if (((x + cel_w) > puz_x) && (x < (puz_x + puz_w))) {
if (((y + cel_w) > puz_y) && (y < (puz_y + puz_h))) {
x = (puz_x + puz_w) + xa;
}
}
if ((y + ch) > screen_h) {
y = screen_h - ch;
}
i++;
}
var c = 0;
var i = 0;
while (i < ymax) {
var j = 0;
while (j < xmax) {
mc = eval ((("mcChip_" + i) + "_") + j);
var n = prio[c];
mc._x = posx[n] + (cel_w / 4);
mc._y = posy[n] + (cel_h / 4);
mc.fit = -1;
c++;
j++;
}
i++;
}
}
function pickup() {
var mc = eval ((("mcChip_" + chip_y) + "_") + chip_x);
mc.fit = -1;
mc.swapDepths(2000);
mc.startDrag();
mc.onRelease = function () {
this.stopDrag();
this.swapDepths(1000 + this.prio);
var x = (this._x + (cel_w / 2));
var y = (this._y + (cel_h / 2));
if ((((x >= puz_x) && (x < (puz_x + puz_w))) && (y >= puz_y)) && (y < (puz_y + puz_h))) {
var cx = Math.floor((x - puz_x) / cel_w);
var cy = Math.floor((y - puz_y) / cel_h);
var n = ((cy * xmax) + cx);
var f = 0;
var i = 0;
while (i < ymax) {
var j = 0;
while (j < xmax) {
var mc2 = eval ((("mcChip_" + i) + "_") + j);
if (mc2.fit == n) {
f = 1;
}
j++;
}
i++;
}
if (f == 0) {
this._x = puz_x + (cx * cel_w);
this._y = puz_y + (cy * cel_h);
this.fit = n;
this.swapDepths(this.prio);
if (check_comp()) {
disable_click();
_parent.gotoAndStop("comp");
}
}
}
};
}
function check_comp() {
var c = 0;
var i = 0;
while (i < ymax) {
var j = 0;
while (j < xmax) {
var mc = eval ((("mcChip_" + i) + "_") + j);
if (mc.fit != c) {
return(0);
}
c++;
j++;
}
i++;
}
return(1);
}
function disable_click() {
var i = 0;
while (i < ymax) {
var j = 0;
while (j < xmax) {
var mc = eval ((("mcChip_" + i) + "_") + j);
delete mc.onPress;
delete mc.onRelease;
j++;
}
i++;
}
}
function comp() {
var i = 0;
while (i < ymax) {
var j = 0;
while (j < xmax) {
var mc = eval ((("mcChip_" + i) + "_") + j);
mc._x = puz_x + (cel_w * j);
mc._y = puz_y + (cel_h * i);
mc.fit = (i * xmax) + j;
j++;
}
i++;
}
}
stop();
screen_w = 800;
screen_h = 600;
puz_w = 400;
puz_h = 300;
puz_x = (screen_w - puz_w) / 2;
puz_y = (screen_h - puz_h) / 2;
mcBG._width = puz_w;
mcBG._height = puz_h;
mcBG._x = puz_x;
mcBG._y = puz_y;
xmax = _parent.xmax;
s = puz_w / xmax;
ymax = Math.floor(puz_h / s);
if (ymax < 1) {
ymax = 1;
}
_parent.tfSize.text = (xmax + "x") + ymax;
cel_w = puz_w / xmax;
cel_h = puz_h / ymax;
cmax = xmax * ymax;
prio = new Array();
i = 0;
while (i < cmax) {
prio[i] = i;
i++;
}
i = 0;
while (i < cmax) {
r = Math.floor(Math.random() * cmax);
tmp = prio[i];
prio[i] = prio[r];
prio[r] = tmp;
i++;
}
c = 0;
i = 0;
while (i < ymax) {
j = 0;
while (j < xmax) {
var mcName = ((("mcChip_" + i) + "_") + j);
this.attachMovie("mcChipOrg", mcName, 1000 + c);
mc = eval (mcName);
x = j * cel_w;
y = i * cel_h;
mc.pos_x = j;
mc.pos_y = i;
mc.fit = -1;
mc.prio = prio[c];
mc._xscale = cel_w;
mc._yscale = cel_h;
mc.mcPicture._xscale = 10000 / cel_w;
mc.mcPicture._yscale = 10000 / cel_h;
mc.mcPicture._x = ((-x) * 100) / cel_w;
mc.mcPicture._y = ((-y) * 100) / cel_h;
mc.shapeTop = new Object();
mc.shapeTop.shape = 0;
mc.shapeRight = new Object();
mc.shapeRight.shape = 0;
mc.shapeBottom = new Object();
mc.shapeBottom.shape = 0;
mc.shapeLeft = new Object();
mc.shapeLeft.shape = 0;
c++;
j++;
}
i++;
}
rh = 30;
bh = 5;
i = 0;
while (i < ymax) {
j = 0;
while (j < xmax) {
if (j < (xmax - 1)) {
a = (((Math.random() * 2) < 1) ? 1 : -1);
ax1 = 15 + (Math.random() * 10);
ay1 = bh + (Math.random() * rh);
ax2 = 15 + (Math.random() * 10);
ay2 = bh + (Math.random() * rh);
ax0 = Math.random() * 10;
ay0 = 20 + (Math.random() * 20);
ax3 = Math.random() * 10;
ay3 = 20 + (Math.random() * 20);
mc = eval ((("mcChip_" + i) + "_") + j);
mc.shapeRight.shape = a;
mc.shapeRight.ax1 = ax1;
mc.shapeRight.ay1 = ay1;
mc.shapeRight.ax2 = ax2;
mc.shapeRight.ay2 = ay2;
mc.shapeRight.ax0 = ax0;
mc.shapeRight.ay0 = ay0;
mc.shapeRight.ax3 = ax3;
mc.shapeRight.ay3 = ay3;
mc = eval ((("mcChip_" + i) + "_") + (j + 1));
mc.shapeLeft.shape = ((a == 1) ? -1 : 1);
mc.shapeLeft.ax1 = ax1;
mc.shapeLeft.ay1 = ay1;
mc.shapeLeft.ax2 = ax2;
mc.shapeLeft.ay2 = ay2;
mc.shapeLeft.ax0 = ax0;
mc.shapeLeft.ay0 = ay0;
mc.shapeLeft.ax3 = ax3;
mc.shapeLeft.ay3 = ay3;
}
if (i < (ymax - 1)) {
a = (((Math.random() * 2) < 1) ? 1 : -1);
ax1 = 15 + (Math.random() * 10);
ay1 = bh + (Math.random() * rh);
ax2 = 15 + (Math.random() * 10);
ay2 = bh + (Math.random() * rh);
ax0 = Math.random() * 10;
ay0 = 20 + (Math.random() * 20);
ax3 = Math.random() * 10;
ay3 = 20 + (Math.random() * 20);
mc = eval ((("mcChip_" + i) + "_") + j);
mc.shapeBottom.shape = a;
mc.shapeBottom.ax1 = ax1;
mc.shapeBottom.ay1 = ay1;
mc.shapeBottom.ax2 = ax2;
mc.shapeBottom.ay2 = ay2;
mc.shapeBottom.ax0 = ax0;
mc.shapeBottom.ay0 = ay0;
mc.shapeBottom.ax3 = ax3;
mc.shapeBottom.ay3 = ay3;
mc = eval ((("mcChip_" + (i + 1)) + "_") + j);
mc.shapeTop.shape = ((a == 1) ? -1 : 1);
mc.shapeTop.ax1 = ax1;
mc.shapeTop.ay1 = ay1;
mc.shapeTop.ax2 = ax2;
mc.shapeTop.ay2 = ay2;
mc.shapeTop.ax0 = ax0;
mc.shapeTop.ay0 = ay0;
mc.shapeTop.ax3 = ax3;
mc.shapeTop.ay3 = ay3;
}
j++;
}
i++;
}
random_put();
i = 0;
while (i < ymax) {
j = 0;
while (j < xmax) {
mc = eval ((("mcChip_" + i) + "_") + j);
mc.onPress = function () {
chip_x = this.pos_x;
chip_y = this.pos_y;
pickup();
};
j++;
}
i++;
}
Symbol 22 Button
on (release) {
mcPlay.comp();
}
Symbol 25 Button
on (release) {
gotoAndStop ("title");
}
Symbol 29 Button
on (release) {
_parent._parent.next_play();
}
Symbol 32 MovieClip Frame 1
stop();
mcBG._alpha = 0;
onEnterFrame = function () {
mcBG._alpha = mcBG._alpha + 10;
if (mcBG._alpha >= 80) {
delete onEnterFrame;
nextFrame();
}
};
Symbol 32 MovieClip Frame 2
stop();
Symbol 33 MovieClip Frame 1
function push_begin() {
gotoAndPlay ("play");
}
function push_continue() {
if (so != null) {
if (so.data.whitejigsaw_xmax != undefined) {
xmax = so.data.whitejigsaw_xmax;
}
}
gotoAndPlay ("play");
}
stop();
xmax = 4;
completed = 0;
soName = "gamedesignjp";
so = SharedObject.getLocal(soName);
if (so != null) {
if (so.data.whitejigsaw_xmax != undefined) {
completed = 1;
}
}
if (completed == 0) {
mcTitle.btContinue._visible = false;
}
Symbol 33 MovieClip Frame 6
play();
Symbol 33 MovieClip Frame 7
stop();
btComp._visible = false;
Symbol 33 MovieClip Frame 13
function next_play() {
xmax++;
so = SharedObject.getLocal(soName);
so.data.whitejigsaw_xmax = xmax;
so.flush();
gotoAndPlay ("play");
}
stop();