[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 (13.7 KiB) ● ●
function otherOnEnterFrame() {
q = (q + 1) % 180;
if ((msg != "Click to Start!") && (msgdelay != 0)) {
msgdelay--;
if (msgdelay == 0) {
msg = "";
}
}
if (gamestate == "playing") {
bgcolor(1);
pulseq--;
if (pulseq <= 0) {
pulseq = (18 - atkspd) * 2;
playsound(eval ("sfx_pulse" + Math.min(atkspd - 2, 8)));
}
if (penalty == 1) {
penalty = 0;
bgcolor(4);
}
if (penalty == 2) {
penalty = 1;
x = 0;
while (x < 4) {
cats[x].togo = Math.max(0, cats[x].togo - 10);
x++;
}
}
if (btimer > 0) {
if ((btimer > 60) || ((btimer % 2) == 0)) {
bgcolor(2);
}
btimer--;
if (btimer == 0) {
freeze = (scoremult = (defmult = 1));
}
}
x = 0;
while (x < 4) {
if (cats[x].pos != cats[x].togo) {
if (cats[x].pos < cats[x].togo) {
cats[x].pos = Math.min(cats[x].togo, int((cats[x].pos + cats[x].togo) / 2) + 1);
} else {
cats[x].pos = Math.max(cats[x].togo, cats[x].pos - atkspd);
}
}
if (cats[x].pos == 0) {
gamestate = "gameover";
bgcolor(4);
playsound(song_gameover);
setmsg("We're Doooomed!");
atkspd = 10;
defspd = 0;
delay = 90;
y = 0;
while (y < 4) {
cats[y].togo = 0;
y++;
}
}
x++;
}
wc = random(4);
cats[wc].togo = Math.max(0, cats[wc].togo - (atkspd * freeze));
}
if (gamestate == "reset") {
bgcolor(q % 2);
x = 0;
while (x < 4) {
cats[x].pos = cats[x].pos + 10;
x++;
}
if (cats[0].pos == 560) {
bgcolor(1);
gamestate = "playing";
atkspd = 3;
clickstogo = 10 * atkspd;
defspd = 5;
threshold = 250;
btimer = 0;
freeze = (scoremult = (defmult = 1));
}
}
if (gamestate == "gameover") {
delay--;
x = 0;
while (x < 4) {
cats[x].pos = Math.max(0, cats[x].pos - 10);
x++;
}
if (delay == 0) {
gamestate = "waiting";
bgcolor(0);
setmsg("Click to Start!");
}
}
bmp.fillRect(fullscreen, 0);
bmp.copyPixels(staticmap, staticscreen, playpoint, null, null, true);
writeln("LONGCAT", 2, 0, 0);
writeln("PRESSURE", 0, 7, 0);
writeln("By:", 2, 0, 1);
writeln("Anonymous D", 1, 4, 1);
writeln("SCORE BEST", 1, 0, 5);
scorestr = score.toString();
writeln(scorestr + "0", 2, 5 - length(scorestr), 6);
scorestr = top.toString();
writeln(scorestr + "0", 2, 14 - length(scorestr), 6);
writeln(msg, q % 3, 0, 12);
bmp.copyPixels(gfxmap, new flash.geom.Rectangle(0, ff[0] * 24, 24, 24), new flash.geom.Point(208, 80), null, null, true);
bmp.copyPixels(gfxmap, new flash.geom.Rectangle(24, ff[1] * 24, 24, 24), new flash.geom.Point(216, 88), null, null, true);
bmp.copyPixels(gfxmap, new flash.geom.Rectangle(48, ff[2] * 24, 24, 24), new flash.geom.Point(208, 96), null, null, true);
bmp.copyPixels(gfxmap, new flash.geom.Rectangle(72, ff[3] * 24, 24, 24), new flash.geom.Point(200, 88), null, null, true);
c0pos = int(cats[0].pos / 10);
bmp.copyPixels(gfxmap, new flash.geom.Rectangle(0, 48 + (ff[4] * 16), 16, 16), new flash.geom.Point(210, 68 - c0pos), null, null, true);
bmp.copyPixels(gfxmap, new flash.geom.Rectangle(64, 48 + (ff[8] * 16), 16, 16), new flash.geom.Point(214, 56 - c0pos), null, null, true);
if (c0pos != 0) {
rect(215, 84 - c0pos, 10, c0pos, 2);
rect(216, 84 - c0pos, 8, c0pos, 3 - ff[4]);
}
if (c0pos != 56) {
rect(215, 0, 10, 56 - c0pos, 1);
rect(216, 0, 8, 56 - c0pos, 2 - ff[8]);
}
c1pos = int(cats[1].pos / 10);
bmp.copyPixels(gfxmap, new flash.geom.Rectangle(16, 48 + (ff[5] * 16), 16, 16), new flash.geom.Point(236 + c1pos, 90), null, null, true);
bmp.copyPixels(gfxmap, new flash.geom.Rectangle(80, 48 + (ff[9] * 16), 16, 16), new flash.geom.Point(248 + c1pos, 94), null, null, true);
if (c1pos != 0) {
rect(236, 95, c1pos, 10, 2);
rect(236, 96, c1pos, 8, 3 - ff[5]);
}
if (c1pos != 56) {
rect(264 + c1pos, 95, 56 - c1pos, 10, 1);
rect(264 + c1pos, 96, 56 - c1pos, 8, 2 - ff[9]);
}
c2pos = int(cats[2].pos / 10);
bmp.copyPixels(gfxmap, new flash.geom.Rectangle(32, 48 + (ff[6] * 16), 16, 16), new flash.geom.Point(214, 116 + c2pos), null, null, true);
bmp.copyPixels(gfxmap, new flash.geom.Rectangle(96, 48 + (ff[10] * 16), 16, 16), new flash.geom.Point(210, 128 + c2pos), null, null, true);
if (c2pos != 0) {
rect(215, 116, 10, c2pos, 2);
rect(216, 116, 8, c2pos, 3 - ff[6]);
}
if (c2pos != 56) {
rect(215, 144 + c2pos, 10, 56 - c2pos, 1);
rect(216, 144 + c2pos, 8, 56 - c2pos, 2 - ff[10]);
}
c3pos = int(cats[3].pos / 10);
bmp.copyPixels(gfxmap, new flash.geom.Rectangle(48, 48 + (ff[7] * 16), 16, 16), new flash.geom.Point(188 - c3pos, 94), null, null, true);
bmp.copyPixels(gfxmap, new flash.geom.Rectangle(112, 48 + (ff[11] * 16), 16, 16), new flash.geom.Point(176 - c3pos, 90), null, null, true);
if (c3pos != 0) {
rect(204 - c3pos, 95, c3pos, 10, 2);
rect(204 - c3pos, 96, c3pos, 8, 3 - ff[7]);
}
if (c3pos != 56) {
rect(120, 95, 56 - c3pos, 10, 1);
rect(120, 96, 56 - c3pos, 8, 2 - ff[11]);
}
if (bavail > 0) {
bavail--;
if ((q % (int(bavail / 30) + 1)) != 0) {
bmp.copyPixels(gfxmap, new flash.geom.Rectangle(96 + ((bitem % 2) * 16), int(bitem / 2) * 16, 16, 16), new flash.geom.Point(bposx, bposy), null, null, true);
}
}
if (instspot < 248) {
bmp.copyPixels(instructions, new flash.geom.Rectangle(0, instspot, 120, 40), instpoint, null, null, true);
if ((q % 5) == 0) {
instspot++;
}
}
bmp.copyPixels(mousemap, mrect, new flash.geom.Point(int(_root._xmouse / 3), int(_root._ymouse / 3)), null, null, true);
x = 0;
while (x < 12) {
ff[x] = 0;
x++;
}
bmp.applyFilter(bmp, fullscreen, origin, blur);
}
function rect(x, y, w, h, c) {
if (c == 0) {
ac = 0;
}
if (c == 1) {
ac = 4283826175;
}
if (c == 2) {
ac = 4294923775;
}
if (c == 3) {
ac = 4294967295;
}
bmp.fillRect(new flash.geom.Rectangle(x, y, w, h), ac);
}
function bgcolor(bgc) {
bgblock.gotoAndStop(bgc + 1);
}
function write(wchr, wcolor, wherex, wherey) {
bmp.copyPixels(alphamap, new flash.geom.Rectangle((ord(wchr) - 32) * 8, wcolor * 8, 8, 8), new flash.geom.Point(wherex * 8, wherey * 8));
}
function writeln(wstr, wwc, wwx, wwy) {
x2 = wwx;
while (x2 < (wwx + length(wstr))) {
write(wstr.charAt(x2 - wwx), wwc, x2 % 28, wwy);
x2++;
}
}
function sendback(cat, str) {
clickok = true;
ff[cat + (4 * (str - 1))] = 1;
playsound(eval ("sfx_hit" + ((str + 2) * 10)));
if (cats[cat].togo <= 550) {
if (cat == lastcat) {
bonus = bonus + (str * 2);
} else {
lastcat = cat;
bonus = 0;
}
cats[cat].togo = Math.min(560, cats[cat].togo + ((((str + 2) * 5) + bonus) * defmult));
score = score + ((str + 2) * scoremult);
if (top < score) {
top = score;
}
if (score >= threshold) {
playsound(sfx_bonusappear);
threshold = threshold + 350;
bitem = random(6);
bavail = Math.max(90, 250 - (threshold / 100));
bposx = (random(2) * 80) + 172;
bposy = (random(2) * 80) + 52;
switch (bitem) {
case 0 :
setmsg("Get Freeze Out!");
return;
case 1 :
setmsg("Get Shove Back!");
return;
case 2 :
setmsg("Get All Strike!");
return;
case 3 :
setmsg("Get Slower Tac!");
return;
case 4 :
setmsg("Get Score Lift!");
return;
case 5 :
setmsg("Get Power Rush!");
}
}
}
}
function setmsg(themsg) {
msg = themsg;
msgdelay = 120;
}
function playsound(ps) {
if (soundguard == false) {
stopAllSounds();
ps.start(0, 1);
}
}
Mouse.hide();
blur = new flash.filters.BlurFilter(1.6, 1, 1);
fullscreen = new flash.geom.Rectangle(0, 0, 320, 200);
staticscreen = new flash.geom.Rectangle(0, 0, 200, 200);
origin = new flash.geom.Point(0, 0);
playpoint = new flash.geom.Point(120, 0);
instpoint = new flash.geom.Point(0, 136);
mrect = new flash.geom.Rectangle(0, 0, 8, 13);
focusRect = false;
tabEnabled = false;
bmp = new flash.display.BitmapData(320, 200, true, 0);
inmask.createEmptyMovieClip("b1", 101);
inmask.b1.attachBitmap(bmp, 1);
inmask._xscale = (inmask._yscale = 300);
var gfxmap = flash.display.BitmapData.loadBitmap("gfxmap.png");
var alphamap = flash.display.BitmapData.loadBitmap("alphamap.png");
var mousemap = flash.display.BitmapData.loadBitmap("mouse.png");
var staticmap = flash.display.BitmapData.loadBitmap("staticmap.png");
var instructions = flash.display.BitmapData.loadBitmap("instructions.png");
song_gameover = new Sound(this);
song_gameover.attachSound("song_gameover.wav");
song_gamestart = new Sound(this);
song_gamestart.attachSound("song_gamestart.wav");
sfx_bonusappear = new Sound(this);
sfx_bonusappear.attachSound("sfx_bonusappear.wav");
sfx_bonusget = new Sound(this);
sfx_bonusget.attachSound("sfx_bonusget.wav");
sfx_hit30 = new Sound(this);
sfx_hit30.attachSound("sfx_hit30.wav");
sfx_hit40 = new Sound(this);
sfx_hit40.attachSound("sfx_hit40.wav");
sfx_hit50 = new Sound(this);
sfx_hit50.attachSound("sfx_hit50.wav");
sfx_pulse1 = new Sound(this);
sfx_pulse1.attachSound("sfx_pulse1.wav");
sfx_pulse2 = new Sound(this);
sfx_pulse2.attachSound("sfx_pulse2.wav");
sfx_pulse3 = new Sound(this);
sfx_pulse3.attachSound("sfx_pulse3.wav");
sfx_pulse4 = new Sound(this);
sfx_pulse4.attachSound("sfx_pulse4.wav");
sfx_pulse5 = new Sound(this);
sfx_pulse5.attachSound("sfx_pulse5.wav");
sfx_pulse6 = new Sound(this);
sfx_pulse6.attachSound("sfx_pulse6.wav");
sfx_pulse7 = new Sound(this);
sfx_pulse7.attachSound("sfx_pulse7.wav");
sfx_pulse8 = new Sound(this);
sfx_pulse8.attachSound("sfx_pulse8.wav");
sfx_tacspeedup = new Sound(this);
sfx_tacspeedup.attachSound("sfx_tacspeedup.wav");
sfx_misclick = new Sound(this);
sfx_misclick.attachSound("sfx_misclick.wav");
song_gamestart.onSoundComplete = function () {
soundguard = false;
};
soundguard = false;
playsound(song_gameover);
instspot = -40;
score = 0;
top = 3000;
penalty = 0;
setmsg("Click to Start!");
q = 0;
pulseq = 1;
bgcolor(0);
cats = new Array(4);
x = 0;
while (x < 4) {
cats[x] = new Object();
cats[x].pos = 0;
cats[x].togo = 0;
x++;
}
atkspd = 10;
defspd = 0;
gamestate = "waiting";
ff = new Array(12);
x = 0;
while (x < 12) {
ff[x] = 0;
x++;
}
this.onMouseDown = function () {
if (gamestate == "waiting") {
bgcolor(1);
playsound(song_gamestart);
soundguard = true;
gamestate = "reset";
setmsg("Save the Earth!");
score = 0;
x = 0;
while (x < 4) {
cats[x].togo = 560;
atkspd = 0;
defspd = 10;
x++;
}
lastcat = -1;
bonus = 0;
}
if (gamestate == "playing") {
mx = int(_root._xmouse / 3);
my = int(_root._ymouse / 3);
cx = 219.5 - mx;
cy = 99.5 - my;
clickok = false;
if (((cx * cx) + (cy * cy)) <= 256) {
if ((mx + my) < 320) {
if ((mx - my) < 120) {
sendback(3, 1);
} else {
sendback(0, 1);
}
} else if ((mx - my) < 120) {
sendback(2, 1);
} else {
sendback(1, 1);
}
} else if ((mx >= 215) && (mx <= 224)) {
c0pos = int(cats[0].pos / 10);
c2pos = int(cats[2].pos / 10);
if ((my <= 83) && (my >= (70 - c0pos))) {
sendback(0, 2);
} else if ((my <= (69 - c0pos)) && (my >= 0)) {
sendback(0, 3);
} else if ((my >= 116) && (my <= (129 + c2pos))) {
sendback(2, 2);
} else if ((my >= (130 + c2pos)) && (my <= 199)) {
sendback(2, 3);
}
} else if ((my >= 95) && (my <= 104)) {
c1pos = int(cats[1].pos / 10);
c3pos = int(cats[3].pos / 10);
if ((mx <= 203) && (mx >= (190 - c3pos))) {
sendback(3, 2);
} else if ((mx <= (189 - c3pos)) && (mx >= 120)) {
sendback(3, 3);
} else if ((mx >= 236) && (mx <= (249 + c1pos))) {
sendback(1, 2);
} else if ((mx >= (250 + c1pos)) && (mx <= 319)) {
sendback(1, 3);
}
}
gotbonus = false;
if (bavail > 0) {
if ((mx >= 172) && (mx <= 187)) {
if ((my >= 52) && (my <= 67)) {
if ((bposx == 172) && (bposy == 52)) {
gotbonus = true;
}
} else if ((my >= 132) && (my <= 147)) {
if ((bposx == 172) && (bposy == 132)) {
gotbonus = true;
}
}
} else if ((mx >= 252) && (mx <= 267)) {
if ((my >= 52) && (my <= 67)) {
if ((bposx == 252) && (bposy == 52)) {
gotbonus = true;
}
} else if ((my >= 132) && (my <= 147)) {
if ((bposx == 252) && (bposy == 132)) {
gotbonus = true;
}
}
}
}
if (gotbonus) {
clickok = true;
bavail = 1;
playsound(sfx_bonusget);
switch (bitem) {
case 0 :
freeze = 0;
break;
case 1 :
far = 0;
dist = 560;
x = 0;
while (x < 4) {
if (cats[x].togo < dist) {
dist = cats[x].togo;
far = x;
}
x++;
}
cats[far].togo = 560;
break;
case 2 :
x = 0;
while (x < 4) {
cats[x].togo = int((cats[x].togo + 560) / 2);
x++;
}
break;
case 3 :
atkspd = Math.max(3, atkspd - 1);
break;
case 4 :
scoremult = 2;
break;
case 5 :
defmult = 2;
}
if ((bitem < 1) || (bitem > 3)) {
bgcolor(2);
btimer = 180;
}
}
if (clickok == false) {
playsound(sfx_misclick);
penalty = 2;
}
clickstogo--;
if (clickstogo == 0) {
atkspd++;
clickstogo = 10 * atkspd;
setmsg("Tacgnol Faster!");
playsound(sfx_tacspeedup);
}
}
};
this.desiredFrameRate = 30;
this.callFunctionInt = setInterval(this, "otherOnEnterFrame", 1000 / this.desiredFrameRate);
Symbol 41 MovieClip Frame 1 (8 B)
stop();