[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Frame 1 (1 B)
Frame 3 (957 B)
function gomain() {
i = 0;
while (i < 33) {
removeMovieClip("c" + i);
removeMovieClip("pipe" + i);
i++;
}
removeMovieClip("gclip");
gotoAndPlay (3);
}
_root.level = 0;
_root.score = 0;
levels = new Array();
levels[1] = "2,1,2,1,1,1,2,1,2,1,2,1,2,1,2,1,1,1,2,1,2,2,1,1,1,1,1,2,1,1,1,1";
levels[2] = "2,1,2,1,1,1,2,1,1,1,1,1,1,2,1,2,1,1,2,1,1,1,1,1,1,1,1,2,1,2,1,1";
levels[3] = "1,2,1,1,1,1,2,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,2";
levels[4] = "2,1,2,1,1,1,2,1,2,1,2,1,2,1,1,1,2,2,1,1,2,2,2,1,1,1,1,2,1,1,1,1";
levels[5] = "1,1,1,2,2,2,2,2,1,1,2,1,2,2,2,1,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,2";
levels[6] = "1,1,1,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,2,1,1,2,1";
levels[7] = "1,2,2,1,1,1,2,1,1,2,2,1,2,1,1,1,2,1,2,1,1,2,1,2,1,1,1,1,1,1,1,2";
splash = new Sound();
splash.attachSound("drop");
turnsound = new Sound();
turnsound.attachSound("turn");
flow = new Sound();
flow.attachSound("underwater");
Frame 62 (8 B)
stop();
Frame 63 (733 B)
removeMovieClip("congrats");
i = 1;
while (i < 33) {
removeMovieClip("c" + i);
i++;
}
score = score + bonus;
level++;
if (level >= 8) {
trace("you win");
gotoAndPlay (91);
}
use = 1;
moves = 0;
totaltime = 600 - (level * 40);
time = totaltime;
num = 0;
i = 1;
while (i < 33) {
attachMovie("pipeshell", "pipe" + num, 100 + num);
with (eval ("pipe" + num)) {
down = math.floor(num / 8);
across = num - (down * 8);
_x = 59.7 + (across * 72);
_y = 105.5 + (down * 72);
n = num;
w = across;
v = down;
}
num++;
i++;
}
holder = new Array();
holder = levels[level].split(",");
i = 0;
while (i < 32) {
st = holder[i];
eval ("pipe" + i).pipe.gotoAndStop(st);
i++;
}
Frame 71 (135 B)
time = time - 0.5;
timer._xscale = (time / totaltime) * 100;
if (time <= 0) {
timer._xscale = 0;
gotoAndPlay ("GAMEOVER");
}
Frame 72 (18 B)
gotoAndPlay (71);
Frame 73 (1.18 KiB) ●
function thatsright() {
n = 1;
attachMovie("right", "c" + correct, 150 + correct);
if ((flow == 1) && (pipetype == 2)) {
n = 12;
}
if ((flow == 3) && (pipetype == 2)) {
n = 11;
}
if ((flow == 2) && (pipetype == 2)) {
n = 9;
}
if ((flow == 4) && (pipetype == 2)) {
n = 10;
}
if (pipetype == 1) {
if ((flow == 1) && (pipedir == 3)) {
n = 4;
} else if ((flow == 1) && (pipedir == 4)) {
n = 7;
} else if ((flow == 2) && (pipedir == 4)) {
n = 8;
} else if ((flow == 2) && (pipedir == 1)) {
n = 1;
}
if ((flow == 1) && (pipedir == 2)) {
n = 6;
}
if ((flow == 3) && (pipedir == 4)) {
n = 8;
}
if ((flow == 3) && (pipedir == 3)) {
n = 3;
}
if ((flow == 1) && (pipedir == 1)) {
n = 2;
}
if ((flow == 2) && (pipedir == 2)) {
n = 5;
}
if ((flow == 2) && (pipedir == 3)) {
n = 4;
}
}
with (eval ("c" + correct)) {
gotoAndStop(n);
_x = 59.7 + (x * 72);
_y = 105.5 + (y * 72);
_alpha = 50;
}
}
use = 0;
x = 0;
y = 0;
flow = 3;
correct = 0;
test = 0;
pipedir = 1;
Frame 74 (21 B)
pipen = x + (y * 8);
Frame 75 (1.73 KiB) ●
pipedir = eval ("pipe" + pipen).pipe.dir;
pipetype = holder[pipen];
error = 1;
if (flow == 1) {
if (pipetype == 1) {
if (pipedir == 3) {
correct++;
flow = 2;
error = 0;
thatsright();
x++;
} else if (pipedir == 4) {
correct++;
flow = 4;
error = 0;
thatsright();
x--;
}
}
if (pipetype == 2) {
if ((pipedir == 2) || (pipedir == 4)) {
correct++;
flow = 1;
error = 0;
thatsright();
y--;
}
}
}
if (flow == 2) {
if (pipetype == 1) {
if (pipedir == 1) {
correct++;
flow = 1;
error = 0;
thatsright();
y--;
} else if (pipedir == 4) {
correct++;
flow = 3;
error = 0;
thatsright();
y++;
}
}
if (pipetype == 2) {
if ((pipedir == 1) || (pipedir == 3)) {
correct++;
flow = 2;
error = 0;
thatsright();
x++;
}
}
}
if (flow == 3) {
if (pipetype == 1) {
if (pipedir == 1) {
correct++;
flow = 4;
error = 0;
thatsright();
x--;
} else if (pipedir == 2) {
correct++;
flow = 2;
error = 0;
thatsright();
x++;
}
}
if (pipetype == 2) {
if ((pipedir == 2) || (pipedir == 4)) {
correct++;
flow = 3;
error = 0;
thatsright();
y++;
}
}
}
if (flow == 4) {
if (pipetype == 1) {
if (pipedir == 2) {
correct++;
flow = 1;
error = 0;
thatsright();
y--;
} else if (pipedir == 3) {
correct++;
flow = 3;
error = 0;
thatsright();
y++;
}
}
if (pipetype == 2) {
if ((pipedir == 1) || (pipedir == 3)) {
correct++;
flow = 4;
error = 0;
thatsright();
x--;
}
}
}
if ((x == 7) && (y == 4)) {
gotoAndPlay ("yay");
}
if (error > 0) {
gotoAndPlay ("GAMEOVER");
}
Frame 83 (27 B)
test++;
gotoAndPlay (74);
Frame 84 (565 B)
go = 0;
if (moves < 16) {
bonusm = 500;
}
if ((moves > 15) && (moves < 26)) {
bonusm = 200;
}
if ((moves > 25) && (moves < 36)) {
bonusm = 100;
}
if ((moves > 35) && (moves < 46)) {
bonusm = 50;
}
if (moves > 45) {
bonusm = 0;
}
timeleft = math.floor(time / 4);
timeb = timeleft * 10;
collectedb = 100 * correct;
bonus = (collectedb + bonusm) + timeb;
_root.levelreport = ("Level " + level) + " completed";
attachMovie("congrats", "congrats", 200);
congrats._x = 310;
congrats._y = 200;
Frame 85 (38 B)
if (go == 1) {
gotoAndPlay (63);
}
Frame 86 (18 B)
gotoAndPlay (85);
Frame 87 (357 B)
function reset() {
i = 0;
while (i < 33) {
removeMovieClip("pipe" + i);
removeMovieClip("c" + i);
i++;
}
_root.level = 0;
_root.score = 0;
removeMovieClip("gclip");
gotoAndPlay (63);
}
_root.tellplayer = "FINAL SCORE: " + score;
attachMovie("GAMEOVERCLIP", "gclip", 1000);
gclip._x = 310;
gclip._y = 200;
trace("GAME OVER");
Frame 90 (8 B)
stop();
Frame 91 (106 B)
i = 0;
while (i < 33) {
removeMovieClip("c" + i);
removeMovieClip("pipe" + i);
i++;
}
stop();
Symbol 6 MovieClip Frame 1 (202 B)
_root.stop();
PercentLoaded = Math.floor((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
_root.play();
}
Symbol 6 MovieClip Frame 2 (17 B)
gotoAndPlay (1);
Symbol 19 MovieClip Frame 1 (8 B)
stop();
Symbol 23 Button (215 B)
on (release) {
if ((_root.use == 1) && (pipe.r == 0)) {
_root.turnsound.start(0, 0);
dirn = pipe.dir;
_root.moves++;
dirn++;
if (dirn == 5) {
dirn = 1;
}
pipe.dir = dirn;
pipe.r = 2;
}
}
Symbol 24 MovieClip [pipeshell] Frame 1 (1 B)
Instance of Symbol 19 MovieClip "pipe" in Symbol 24 MovieClip [pipeshell] Frame 1 (430 B)
onClipEvent (load) {
r = 0;
dir = random(4) + 1;
if (dir == 1) {
this._rotation = 0;
} else if (dir == 2) {
this._rotation = 90;
} else if (dir == 3) {
this._rotation = 180;
} else if (dir == 4) {
this._rotation = 270;
}
}
onClipEvent (enterFrame) {
if (r == 2) {
step = 6;
r = 1;
}
if ((r == 1) && (step > 0)) {
this._rotation = this._rotation + 15;
step--;
}
if (step == 0) {
r = 0;
}
}
Symbol 46 Button (31 B)
on (release) {
_root.go = 1;
}
Symbol 47 MovieClip [congrats] Frame 33 (8 B)
stop();
Symbol 54 Button (33 B)
on (release) {
_root.gomain();
}
Symbol 58 Button (30 B)
on (press) {
_root.reset();
}
Symbol 60 MovieClip [GAMEOVERCLIP] Frame 25 (8 B)
stop();
Symbol 63 MovieClip Frame 9 (8 B)
stop();
Symbol 65 MovieClip Frame 9 (8 B)
stop();
Symbol 66 MovieClip [right] Frame 1 (8 B)
stop();
Symbol 69 MovieClip Frame 1 (8 B)
stop();
Instance of Symbol 75 MovieClip in Symbol 76 MovieClip Frame 1 (163 B)
onClipEvent (enterFrame) {
this._y = this._y + 20;
if (this._y > 270) {
_root.splash.start();
this._x = random(620);
this._y = -(random(500) + 50);
}
}
Symbol 79 Button (86 B)
on (press) {
getURL ("mailto:terrypaton1@bigpond.com?subject=Plumber 1", "_blank");
}
Symbol 89 Button (35 B)
on (release) {
gotoAndPlay (63);
}
Symbol 103 MovieClip Frame 1 (8 B)
stop();
Symbol 103 MovieClip Frame 24 (8 B)
stop();
Symbol 105 Button (88 B)
on (release) {
_root.flow.start(0, 3);
gotoAndPlay ("pump");
handle.gotoAndPlay(2);
}
Symbol 107 MovieClip Frame 260 (8 B)
stop();
Symbol 113 Button (82 B)
on (press) {
getURL ("http://www.newgrounds.com/portal/view/173695", "_BLANK");
}
Symbol 114 Button (31 B)
on (press) {
_root.gomain();
}