Frame 1
function sndInit() {
var _local2;
_local2 = 0;
while (_local2 < MSND) {
sndObj[_local2] = new Sound(this);
sndObj[_local2].attachSound(snd_fi[_local2]);
_local2++;
}
}
function sndPlay(a) {
sndObj[a].start();
}
function sndStop(a) {
sndObj[a].stop();
}
function randInt(a) {
return(Math.floor(Math.random() * a));
}
function rand(a) {
return(Math.random() * a);
}
function rgb(r, g, b) {
return(((r << 16) + (g << 8)) + b);
}
function spcStr(v, sp) {
var _local3;
var _local1;
var _local2;
_local2 = "" + v.toString();
_local3 = sp - _local2.length;
_local1 = 0;
while (_local1 < _local3) {
_local2 = " " + _local2;
_local1++;
}
return(_local2);
}
function createChr(sx, sy) {
var _local2 = naChr + "0";
this.attachMovie(naChr, _local2, dpChr);
this[_local2]._x = sx;
this[_local2]._y = sy;
x = sx;
y = sy;
this[_local2]._alpha = ALP;
this[_local2].xx = SP;
this[_local2].yy = 0;
this[_local2].onEnterFrame = function () {
var _local2 = new Color(this);
_local2.setRGB(rgb(200, 30, 255 - (this._y / 2)));
if (die) {
this.yy = this.yy + 0.5;
this._y = this._y + this.yy;
this._xscale = this._xscale + 5;
this._yscale = this._yscale + 5;
_local2 = new Color(this);
_local2.setRGB(rgb(randInt(256), randInt(256), randInt(256)));
if (this._y > (SCY + (SCY / 2))) {
this.removeMovieClip();
}
return(undefined);
}
this._x = this._x + this.xx;
if (Key.isDown(65)) {
this._x = this._x + this.xx;
}
if (Key.isDown(66)) {
this.xx = -this.xx;
sndPlay(3);
}
if (this._y < 0) {
this.yy = 0;
this._y = 0;
}
if (mu) {
mu--;
this._visible = (((mu & 1) == 0) ? true : false);
}
if (mu2) {
mu2--;
}
if (jp) {
this._y = this._y + yy;
yy++;
if (this._y > FLR) {
this._y = FLR;
jp = 0;
}
}
if (this._x > ((SCX - SZ) + (SZ / 2))) {
this._x = (SCX - SZ) + (SZ / 2);
this.xx = -Math.abs(this.xx);
} else if (this._x < (0 + (SZ / 2))) {
this.x = 0 + (SZ / 2);
this.xx = Math.abs(this.xx);
}
x = this._x;
y = this._y;
if (!pw) {
createBmc(this._x, this._y);
this.removeMovieClip();
}
if (!mo) {
this.removeMovieClip();
}
};
}
function createMeter() {
var _local2 = naMeter + "0";
this.attachMovie(naMeter, _local2, dpMeter);
this[_local2]._x = 5;
this[_local2]._y = 15;
this[_local2]._alpha = ALP;
this[_local2].width = 1;
this[_local2].down = 0;
this[_local2]._width = 2;
this[_local2].onEnterFrame = function () {
if (this.down == 0) {
if (ksl || (Key.isDown(17))) {
this.down = 1;
}
}
if (this.down == 1) {
this._width = this._width + 2;
var _local2 = new Color(this);
_local2.setRGB(rgb(120 + (this._width * 2), 120 - this._width, 0));
if ((!ksl) && (!Key.isDown(17))) {
yy = (-Math.floor(this._width / 2)) - 4;
jp = 1;
this._width = 1;
this.down = 0;
}
}
if (!mo) {
this.removeMovieClip();
}
};
}
function createItm(sx, sy) {
var _local2 = naItm + cntItm;
this.attachMovie(naItm, _local2, dpItm - cntItm);
if ((++cntItm) == maxItm) {
cntItm = 0;
}
this[_local2]._x = sx;
this[_local2]._y = sy;
this[_local2]._alpha = ALP;
this[_local2]._xscale = 10;
this[_local2]._yscale = 10;
this[_local2].onEnterFrame = function () {
var _local2 = new Color(this);
_local2.setRGB(rgb(0, randInt(255), randInt(255)));
if (this._xscale < 100) {
this._xscale = this._xscale + 5;
this._yscale = this._yscale + 5;
}
if ((Math.abs(x - this._x) < SZ) && (Math.abs(y - this._y) < SZ)) {
re++;
sc = sc + (re * 10);
mu = 8;
mu2 = 8;
setBm(this._x, this._y);
createNum(this._x, this._y, re * 10);
ik--;
if (ik == 0) {
bobo = 0;
i = 0;
while (i < 5) {
createItm(randInt((SCX - 40) - SZ) + 20, randInt(SCY - 80) + 40);
i++;
}
ik = 5;
sndPlay(7);
} else if (re == 10) {
sndPlay(6);
} else {
sndPlay(0);
}
this.removeMovieClip();
}
if (!mo) {
this.removeMovieClip();
}
};
}
function createApl(sx, sy) {
var _local2 = naApl + cntApl;
this.attachMovie(naApl, _local2, dpApl - cntApl);
if ((++cntApl) == maxApl) {
cntApl = 0;
}
this[_local2]._x = sx;
this[_local2]._y = sy;
this[_local2]._alpha = ALP;
this[_local2].onEnterFrame = function () {
var _local2 = new Color(this);
_local2.setRGB(rgb(randInt(255), 120, 80));
this._y = this._y + 3;
if ((Math.abs(x - this._x) < SZ) && (Math.abs(y - this._y) < SZ)) {
re++;
sc = sc + (re * 10);
mu = 10;
mu2 = 10;
createNum(this._x, this._y, re * 10);
if (re == 10) {
sndPlay(6);
} else {
sndPlay(5);
}
this.removeMovieClip();
}
if (this._y > (SCY + (SZ * 2))) {
this.removeMovieClip();
}
if (!mo) {
this.removeMovieClip();
}
};
}
function createIw(sx, sy) {
var na = (naIw + cntIw);
this.attachMovie(naIw, na, dpIw - cntIw);
if ((++cntIw) == maxIw) {
cntIw = 0;
}
this[na]._x = sx;
this[na]._y = sy;
this[na]._alpha = ALP;
this[na].yy = 1;
this[na].t = 0;
var _local4 = new Color(this[na]);
_local4.setRGB(rgb(168, 151, randInt(50)));
this[na].onEnterFrame = function () {
var _local3;
if (this.t == 0) {
if (this._y < 30) {
this._y++;
}
if ((Math.abs(x - this._x) < SZ) && (Math.abs(y - this._y) < SZ)) {
this.t = 1;
sndPlay(3);
}
} else {
this._y = this._y + 4;
_local3 = 0;
while (_local3 < maxEnm) {
na = naEnm + _local3;
if (((_root[na].t > 0) && (Math.abs(_root[na]._x - this._x) < SZ)) && (Math.abs(_root[na]._y - this._y) < SZ)) {
_root[na].t = -1;
}
_local3++;
}
}
if (this._y > (SCY + (SZ * 2))) {
this.removeMovieClip();
}
if (!mo) {
this.removeMovieClip();
}
};
}
function createEnm(sx, sy, a) {
var _local2 = naEnm + cntEnm;
this.attachMovie(naEnm, _local2, dpEnm - cntEnm);
if ((++cntEnm) == maxEnm) {
cntEnm = 0;
}
this[_local2]._x = sx;
this[_local2]._y = sy;
this[_local2]._alpha = ALP;
this[_local2]._xscale = 10;
this[_local2]._yscale = 10;
this[_local2].xx = 1 + a;
this[_local2].t = a;
this[_local2].th = 0;
this[_local2].tl = 0;
var _local8;
var _local7;
switch (a) {
case 3 :
this[_local2].xx = randInt(7) - 3;
this[_local2].yy = randInt(5) + 1;
break;
case 4 :
this[_local2].xx = (-randInt(7)) - 2;
this[_local2].yy = -3;
}
var _local4 = new Color(this[_local2]);
_local4.setRGB(enmco[a - 1]);
this[_local2].cl = 0;
this[_local2].onEnterFrame = function () {
this._rotation = this._rotation + 10;
switch (this.t) {
case -1 :
createBmc(this._x, this._y);
createNum(this._x, this._y, 80);
sc = sc + 80;
sndPlay(4);
this.removeMovieClip();
break;
case 1 :
this._x = this._x + this.xx;
if (this._x > ((SCX - SZ) + (SZ / 2))) {
this._x = (SCX - SZ) + (SZ / 2);
this.xx = -this.xx;
} else if (this._x < (0 + (SZ / 2))) {
this.x = 0 + (SZ / 2);
this.xx = -this.xx;
}
break;
case 2 :
this._x = this._x + this.xx;
this._y = this._y + wv[this.th];
if ((++this.th) == wv.length) {
this.th = 0;
}
if ((++this.tl) == 5) {
this.tl = 0;
createApl(this._x, this._y);
}
if (this._x > (SCX + (SZ * 2))) {
this.removeMovieClip();
}
break;
case 3 :
this._x = this._x + this.xx;
this._y = this._y + this.yy;
if (((this._x < ((-this._width) - (this._width / 2))) || ((this._x - (this._width / 2)) > SCX)) || ((this._y - (this._height / 2)) > SCY)) {
this.removeMovieClip();
}
break;
case 4 :
this._x = this._x + this.xx;
this._y = this._y + this.yy;
this.yy++;
if (this._y > FLR) {
this._y = FLR;
this.yy = (-rand(8)) - 3;
}
if (this._x < ((-SZ) * 2)) {
this.removeMovieClip();
}
break;
}
if ((++this.cl) == 127) {
this.cl = -127;
}
var _local2 = new Color(this);
_local2.setRGB(enmco[this.t - 1] + this.cl);
if (this._xscale < 100) {
this._xscale = this._xscale + 5;
this._yscale = this._yscale + 5;
} else if ((Math.abs(x - this._x) < SZ) && (Math.abs(y - this._y) < SZ)) {
if (!mu) {
if (pw) {
pw--;
mu = 10;
sndPlay(1);
}
} else if ((this.t != 2) && (mu2)) {
this.t = -1;
}
}
if (!mo) {
this.removeMovieClip();
}
};
}
function createBmc(sx, sy) {
var _local2 = naBmc + cntBmc;
this.attachMovie(naBmc, _local2, dpBmc - cntBmc);
if ((++cntBmc) == maxBmc) {
cntBmc = 0;
}
this[_local2]._x = sx;
this[_local2]._y = sy;
this[_local2]._alpha = ALP;
var _local3 = new Color(this[_local2]);
_local3.setRGB(rgb(randInt(80) + 170, 80 + randInt(155), 10));
this[_local2].onEnterFrame = function () {
this._alpha = this._alpha - 5;
this._xscale = this._xscale + 20;
this._yscale = this._yscale + 20;
if (this._alpha <= 30) {
this.removeMovieClip();
}
if (!mo) {
this.removeMovieClip();
}
};
}
function setBm(sx, sy) {
var _local1;
_local1 = 0;
while (_local1 < 8) {
createBm(sx + 1, sy + 1);
_local1++;
}
}
function createBm(sx, sy) {
var _local2 = naBm + cntBm;
this.attachMovie(naBm, _local2, dpBm - cntBm);
if ((++cntBm) == maxBm) {
cntBm = 0;
}
this[_local2]._x = sx;
this[_local2]._y = sy;
this[_local2].xx = randInt(9) - 4;
this[_local2].yy = (-randInt(5)) - 2;
this[_local2]._alpha = ALP;
this[_local2].onEnterFrame = function () {
var _local2 = new Color(this);
_local2.setRGB(rgb(0, randInt(255), randInt(255)));
this._x = this._x + this.xx;
this._y = this._y + this.yy;
this.yy++;
this._xscale = this._xscale - 2;
this._yscale = this._yscale - 2;
this._alpha--;
if (this._alpha <= 0) {
this.removeMovieClip();
}
if (!mo) {
this.removeMovieClip();
}
};
}
function createNum(sx, sy, a) {
var _local2 = naNum + cntNum;
this.attachMovie(naNum, _local2, dpNum - cntNum);
if ((++cntNum) == maxNum) {
cntNum = 0;
}
this[_local2]._x = sx;
this[_local2]._y = sy;
this[_local2].txtNum.text = a;
this[_local2]._alpha = ALP + 20;
this[_local2].onEnterFrame = function () {
this._y = this._y - 1;
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
if (re) {
re--;
}
this.removeMovieClip();
}
if (!mo) {
this.removeMovieClip();
}
};
}
function PutSc() {
strSc = (("SC-" + spcStr(sc, 6)) + " PW-") + pw;
}
function Title() {
mo = 0;
wa = 5;
txtSubmiths._visible = true;
txtName._visible = true;
txtNameIn._visible = true;
btnSubmit._visible = true;
btnStart._visible = true;
txtRecord._visible = true;
txtTitle1._visible = true;
txtTitle1._rotation = randInt(360);
txtTitle2._visible = true;
txtTitle2._rotation = randInt(360);
txtTitle3._visible = true;
txtTitle3._rotation = randInt(360);
txtTitle4._visible = true;
txtTitle4._rotation = randInt(360);
txtTitle5._visible = true;
txtTitle5._rotation = randInt(360);
strMessage = "2005 N.I";
strSc = "HS-" + hs;
Mouse.show();
wwwView();
recsrInit();
}
function Shoki() {
var _local1;
createChr((SCX / 2) - (SZ / 2), FLR);
createMeter();
ik = 5;
_local1 = 0;
while (_local1 < ik) {
createItm(randInt((SCX - 40) - SZ) + 20, randInt(SCY - 80) + 40);
_local1++;
}
strMessage = "";
txtSubmiths._visible = false;
txtName._visible = false;
txtNameIn._visible = false;
btnSubmit._visible = false;
btnStart._visible = false;
txtRecord._visible = false;
txtTitle1._visible = false;
txtTitle2._visible = false;
txtTitle3._visible = false;
txtTitle4._visible = false;
txtTitle5._visible = false;
txtTitle6._visible = false;
re = 0;
yy = 0;
sc = 0;
pw = 3;
die = 0;
ksl = 0;
mo = 1;
tl = 0;
tlk = 0;
mu2 = 0;
bobo = 0;
}
function recsrInit() {
scryy = 1;
scrw = MSCRW;
txtRecord.scroll = 0;
}
function recsrScroll() {
if (scrw) {
scrw--;
} else {
txtRecord.scroll = txtRecord.scroll + scryy;
if (txtRecord.scroll == txtRecord.maxscroll) {
scryy = -1;
}
if (txtRecord.scroll == 0) {
scryy = 1;
}
scrw = 10;
}
}
function wwwSubmit() {
var _local2 = 0;
var _local1;
_local1 = 0;
while (_local1 < gname.length) {
_local2 = _local2 + gname.charCodeAt(_local1);
_local1++;
}
_local2 = _local2 ^ hs;
var _local3 = new LoadVars();
_local3.co = "submit";
_local3.i = gname;
_local3.s1 = "" + _local2;
_local3.s2 = "" + (hs ^ 43);
_local3.nam = tname;
var load_lv = new LoadVars();
load_lv.onLoad = function (success) {
trecord = load_lv.result;
recsrInit();
};
_local3.sendAndLoad("flahs.cgi", load_lv, "POST");
}
function wwwView() {
var _local1 = new LoadVars();
_local1.co = "view";
_local1.i = gname;
var load_lv = new LoadVars();
load_lv.onLoad = function (success) {
trecord = load_lv.result;
};
_local1.sendAndLoad("flahs.cgi", load_lv, "POST");
}
var SCX = Stage.width;
var SCY = Stage.height;
var SZ = 20;
var ALP = 100;
var FLR = (SCY - 30);
var SP = 6;
var YMX = 20;
var EN2SP = 6;
var mo;
var wa;
var ksl;
var sc;
var hs = 0;
var pw;
var die;
var yy;
var jp;
var x;
var y;
var re;
var tl;
var tlk;
var mu;
var mu2;
var ik;
var bobo;
var naChr = "chr";
var dpChr = 2000;
var naMeter = "meter";
var dpMeter = 2001;
var naItm = "itm";
var cntItm = 0;
var dpItm = 1800;
var maxItm = 199;
var naEnm = "enm";
var cntEnm = 0;
var dpEnm = 1600;
var maxEnm = 199;
var naBm = "bm";
var cntBm = 0;
var dpBm = 1200;
var maxBm = 199;
var naApl = "apl";
var cntApl = 0;
var dpApl = 1000;
var maxApl = 199;
var naIw = "iw";
var cntIw = 0;
var dpIw = 800;
var maxIw = 99;
var iwx;
var iwy;
var naNum = "num";
var cntNum = 0;
var dpNum = 2400;
var maxNum = 64;
var NWAI = 10;
var naBmc = "bmc";
var cntBmc = 0;
var dpBmc = 2200;
maxBmc = 199;
var wv = [4, 3, 2, 1, -1, -2, -3, -4, -4, -3, -2, -1, 1, 2, 3, 4];
var wv2 = [3, 2, 1, -1, -2, -3, -3, -2, -1, 1, 2, 3];
var snd_fi = ["KO.WAV", "KICK.WAV", "WIN.WAV", "TAOS.WAV", "DIE.WAV", "QUI.WAV", "TATA.WAV", "STA.WAV", "STA.WAV"];
var MSND = 9;
var sndObj = new Array(MSND);
var scryy;
var scrw;
var MSCRW = 50;
gname = "pofgi";
System.useCodepage = true;
enmco = [15658496, 3403332, 3368686, 11184691];
btnStart.onPress = function () {
if (!wa) {
Shoki();
}
};
btnSubmit.onPress = function () {
if (((!wa) && (hs > 0)) && (tname)) {
wwwSubmit();
}
};
timer1._visible = false;
timer1.onMouseDown = function () {
ksl = 1;
};
timer1.onMouseUp = function () {
ksl = 0;
};
timer1.onEnterFrame = function () {
if (wa > 0) {
wa--;
}
switch (mo) {
case 0 :
recsrScroll();
txtTitle1._rotation = txtTitle1._rotation + 10;
txtTitle2._rotation = txtTitle2._rotation + 10;
txtTitle3._rotation = txtTitle3._rotation + 10;
txtTitle4._rotation = txtTitle4._rotation + 10;
txtTitle5._rotation = txtTitle5._rotation + 10;
txtTitle6._rotation = txtTitle6._rotation + 10;
return;
case 1 :
if ((tlk > 14) && (tl == 30)) {
createEnm(randInt((SCX - 40) - SZ) + 20, (-SZ) * 2, 3);
}
if ((tlk > 40) && (randInt(100) == 0)) {
createEnm(SCX + (SZ * 2), FLR, 4);
}
if (tl == 60) {
if (randInt(3) > 0) {
createEnm(randInt((SCX - 40) - SZ) + 20, randInt(SCY - 100) + 40, 1);
}
tl = 0;
tlk++;
if (((tlk % 8) == 0) && (!bobo)) {
createEnm((-SZ) * 2, randInt(SCY / 3) + 30, 2);
bobo = 1;
}
if ((tlk % 8) == 0) {
createIw(randInt((SCX - 40) - SZ) + 20, (-SZ) * 2);
}
}
tl++;
PutSc();
if (!pw) {
die = 1;
if (sc > hs) {
hs = sc;
}
strMessage = "Game Over";
mo = 2;
wa = 10;
ksl = 0;
sndPlay(2);
}
return;
case 2 :
if (!((ksl || (Key.isDown(32))) && (!wa))) {
break;
}
Title();
}
};
sndInit();
Title();