Frame 1
_global.Snd = new Object();
Snd.list = ["bgm", "dead", "hit", "miss", "uoo", "happy"];
Snd.init = function () {
var i;
var s;
var name;
var cont;
cont = function () {
this.start();
};
i = Snd.list.length - 1;
for ( ; i >= 0 ; i--) {
name = "SND_" + Snd.list[i];
s = new Sound();
s.attachSound(name);
this[name] = s;
}
this.SND_bgm.onSoundComplete = cont;
};
Snd.start = function (name) {
var s;
name = "SND_" + name;
s = this[name];
if (s) {
s.stop(name);
s.start();
}
};
Snd.stop = function (name) {
var s;
name = "SND_" + name;
s = this[name];
if (s) {
s.stop(name);
}
};
Snd.stopAll = function () {
var i;
i = Snd.list.length - 1;
for ( ; i >= 0 ; i--) {
Snd.stop(Snd.list[i]);
}
};
Snd.init();
Frame 2
function MedoiClass() {
this.hitLine = 280;
this.hitRange = 60;
this.pantsLevel = 100;
this.miss = false;
}
function CeClass() {
this._y = -60 - Math.floor(Math.random() * 120);
this._x = Math.floor(Math.random() * 40) + 40;
if (Math.random() < 0.5) {
this._x = 360 - this._x;
}
this.speed = 4;
this.range = 0;
this.as = ((Math.PI * 2) / 25) / ((Math.random() * 4) + 1);
this.arg = (Math.random() * Math.PI) * 2;
this.arg = 0;
this.alive = true;
}
function GameClass() {
this.scoreBoard = this.attachMovie("MC_score", "mcScore", 2000);
this.score = 0;
this.hiscore = 0;
this.showTitle();
this.move = this.move_title;
this.startLevel = 3;
}
MedoiClass.prototype = new MovieClip();
Object.registerClass("MC_medoi", MedoiClass);
MedoiClass.prototype.setPants = function (alpha) {
this.mcPants._alpha = 100 - alpha;
};
MedoiClass.prototype.getPants = function () {
return(100 - this.mcPants._alpha);
};
MedoiClass.prototype.hit = function () {
if (0 >= this._xscale) {
this._xscale = 100;
return(-1);
}
this._xscale = -100;
return(1);
};
CeClass.prototype = new MovieClip();
Object.registerClass("MC_ce", CeClass);
CeClass.prototype.setSpeed = function (level) {
this.speed = (Math.random() * level) + 4;
if (Math.random() >= (level / 20)) {
this.range = 0;
} else {
this.range = ((Math.random() * level) * 2) + 4;
}
};
CeClass.prototype.move = function (down) {
var s;
if (!this.alive) {
if (this._x >= 180) {
s = s + 16;
} else {
s = s - 16;
}
this._x = this._x + s;
return(this._visible);
}
this.arg = this.arg + this.as;
if ((Math.PI * 2) < this.arg) {
this.arg = this.arg - (Math.PI * 2);
}
s = Math.sin(this.arg) * this.range;
if (!down) {
s = s - (this.speed / 2);
} else {
s = s + this.speed;
}
if (18 >= s) {
if (s < -18) {
s = -18;
}
} else {
s = 18;
}
this._y = this._y + s;
return(this._y < 460);
};
CeClass.prototype.die = function () {
this.alive = false;
this.gotoAndPlay("DEAD");
return(Math.floor(this.speed * 10));
};
GameClass.prototype = new MovieClip();
Object.registerClass("MC_game", GameClass);
GameClass.prototype.onMouseDown = function () {
this.mouse = true;
};
GameClass.prototype.showScore = function () {
this.scoreBoard.scoreTxt = "Score " + this.score;
if (this.hiscore < this.score) {
this.hiscore = this.score;
this.scoreBoard.hiscoreTxt = "Hiscore " + this.hiscore;
}
};
GameClass.prototype.clearAll = function () {
var i;
if (this.medoi) {
this.medoi.removeMovieClip();
this.medoi = null;
}
if (this.tinko) {
this.tinko.removeMovieClip();
this.tinko = null;
}
i = 0;
for ( ; i < this.ceMax ; i++) {
if (this.ce[i]) {
this.ce[i].removeMovieClip();
this.ce[i] = null;
}
}
this.numCe = 0;
this.hideCaption();
};
GameClass.prototype.hideCaption = function () {
if (this.caption) {
this.caption.removeMovieClip();
this.caption = null;
}
};
GameClass.prototype.showTitle = function () {
this.clearAll();
this.caption = this.attachMovie("MC_title", "mcTitle", 1000);
this.showMode();
};
GameClass.prototype.showGameover = function (nin) {
this.hideCaption();
if (!nin) {
this.caption = this.attachMovie("MC_gameover", "mcGameover", 1000);
} else {
this.caption = this.attachMovie("MC_ins", "mcGameover", 1000);
this.caption._x = 180;
this.caption._xscale = this.medoi._xscale;
}
};
GameClass.prototype.start = function () {
var i;
this.clearAll();
this.score = 0;
this.showScore();
this.medoi = this.attachMovie("MC_medoi", "mcMedoi", 1);
this.medoi._x = 180;
this.medoi._y = 0;
this.ceMax = 3;
this.numCe = 0;
this.ce = new Array();
this.combo = 1;
this.count = 0;
this.level = this.startLevel;
this.tinkoCnt = 0;
Snd.start("bgm");
};
GameClass.prototype.addCe = function () {
var i;
var speed;
if (this.numCe == this.ceMax) {
return(false);
}
i = 0;
for ( ; i < this.ceMax ; i++) {
if (!this.ce[i]) {
this.ce[i] = this.attachMovie("MC_ce", "mcCe" + i, i + 100);
this.numCe++;
this.ce[i].setSpeed(this.level);
return;
}
}
};
GameClass.prototype.attack = function () {
var i;
var c;
var dir;
var differ;
var s;
var base;
var range;
var pants;
dir = this.medoi.hit();
base = this.medoi.hitLine;
range = this.medoi.hitRange;
s = 0;
i = 0;
for ( ; i < this.ceMax ; i++) {
c = this.ce[i];
if (c && (c.alive)) {
if (0 < ((c._x - 180) * dir)) {
differ = c._y - base;
if (differ < 0) {
differ = differ * -1;
}
if (range >= differ) {
c.die();
s++;
}
}
}
}
pants = this.medoi.getPants();
if (0 >= s) {
Snd.start("miss");
if (!this.tinko) {
if (!this.miss) {
this.miss = true;
} else {
this.count = this.count + 25;
pants = pants + (((100 - pants) / 4) + 10);
if (100 < pants) {
pants = 100;
}
this.combo = 1;
}
} else {
this.miss = false;
}
} else {
Snd.start("hit");
this.miss = false;
pants = pants - 3;
if (pants < 0) {
pants = 0;
}
}
this.medoi.setPants(pants);
return(s);
};
GameClass.prototype.showMode = function () {
if (this.startLevel != 12) {
this.caption.mode = "";
} else {
this.caption.mode = "HARD";
}
};
GameClass.prototype.move_title = function () {
if (this.caption.hard) {
this.caption.hard = false;
this.mouse = false;
if (this.startLevel != 3) {
this.startLevel = 3;
} else {
this.startLevel = 12;
}
this.showMode();
return(null);
}
if (this.mouse) {
this.mouse = false;
this.start();
this.move = this.move_game;
}
};
GameClass.prototype.move_game = function () {
var s;
var i;
var c;
var damage;
if (this.mouse) {
this.mouse = false;
s = this.attack();
if (0 < s) {
ss = (s * 10) * this.combo;
if (0 >= this.medoi.getPants()) {
ss = ss * 4;
}
this.score = this.score + ss;
if (this.caption) {
this.caption.removeMovieClip();
}
this.caption = this.attachMovie("MC_get", "mcGet", 1000);
this.caption.scoreTxt = ((this.combo + "HIT COMBO! ") + ss) + "pts";
this.showScore();
if (this.combo < 20) {
this.combo++;
}
}
}
if (this.caption) {
this.caption._y = this.caption._y - 4;
this.caption._alpha = this.caption._alpha - 4;
if (0 >= this.caption._alpha) {
this.caption.removeMovieClip();
this.caption = null;
}
}
if (this.moveTinko()) {
Snd.stopAll();
Snd.start("uoo");
this.showGameover(true);
this.move = this.move_gameover;
return(null);
}
damage = false;
i = 0;
for ( ; i < this.ceMax ; i++) {
c = this.ce[i];
if (c) {
if (!c.move(!this.tinko)) {
if (c.alive) {
damage = true;
}
c.removeMovieClip();
this.ce[i] = null;
this.numCe--;
}
}
}
this.addCe();
if (this.level < 12) {
this.count++;
}
if ((this.level * 40) < this.count) {
this.level++;
this.count = 0;
}
if (damage) {
Snd.stopAll();
Snd.start("dead");
this.showGameover(false);
this.move = this.move_gameover;
}
};
GameClass.prototype.move_gameover = function () {
if (this.mouse) {
this.mouse = false;
if (this.caption.done) {
Snd.stopAll();
this.showTitle();
this.move = this.move_title;
}
}
};
GameClass.prototype.moveTinko = function () {
var i;
var c;
if (0 < this.tinkoCnt) {
this.tinkoCnt--;
return(false);
}
if (!this.tinko) {
if (0 < this.medoi.getPants()) {
return(false);
}
i = 0;
for ( ; i < this.ceMax ; i++) {
c = this.ce[i];
if (c) {
if (200 < c._y) {
return(false);
}
}
}
this.tinko = this.attachmovie("MC_tinko", "mcTinko", 200);
this.tinko._xscale = this.medoi._xscale;
this.tinko._x = 180;
this.tinko._y = 100;
this.tinko.speed = 0;
return(false);
}
if (this.tinko._y == 0) {
if (!((0 >= this.medoi.getPants()) && (this.tinko._xscale == this.medoi._xscale))) {
this.tinko.speed = -1;
if (this.caption) {
this.caption.removeMovieClip();
}
this.caption = this.attachMovie("MC_get", "mcGet", 1000);
this.caption.scoreTxt = "BONUS 3000pts";
this.score = this.score + 3000;
this.showScore();
} else {
this.tinko.removeMovieClip();
this.tinko = null;
return(true);
}
}
if (this.tinko.speed < 0) {
this.tinko._y = this.tinko._y + 20;
if (this.tinko._y >= 100) {
this.tinko.removeMovieClip();
this.tinko = null;
this.tinkoCnt = 250;
}
} else {
this.tinko.speed = this.tinko.speed + 0.4;
this.tinko._y = this.tinko._y - this.tinko.speed;
if (this.tinko._y < 0) {
this.tinko._y = 0;
}
}
return(false);
};
Instance of Symbol 16 MovieClip [MC_game] in Frame 3
onClipEvent (enterFrame) {
this.move();
}
Frame 4
stop();
Symbol 10 MovieClip [MC_medoi] Frame 2
stop();
Symbol 54 MovieClip [MC_ins] Frame 22
this.attachMovie("MC_nin", "mcNin", 1);
mcNin._xscale = this._xscale;
Symbol 54 MovieClip [MC_ins] Frame 48
this.done = true;
this.stop();
Symbol 20 MovieClip [MC_tinko] Frame 1
stop();
Symbol 12 MovieClip [MC_pants] Frame 2
stop();
Symbol 14 MovieClip [MC_ce] Frame 11
gotoAndPlay("ALIVE");
Symbol 14 MovieClip [MC_ce] Frame 12
stop();
Symbol 14 MovieClip [MC_ce] Frame 38
this.stop();
this._visible = false;
Symbol 60 MovieClip [MC_get] Frame 3
stop();
Symbol 56 MovieClip [MC_nin] Frame 1
Snd.start("happy");
Symbol 56 MovieClip [MC_nin] Frame 23
stop();
Symbol 16 MovieClip [MC_game] Frame 1
stop();
Symbol 18 MovieClip [MC_score] Frame 5
stop();
Symbol 20000 Button
on (press) {
this.hard = true;
}
on () {
}
Symbol 22 MovieClip [MC_title] Frame 2
stop();
Symbol 30 MovieClip [MC_gameover] Frame 26
this.done = true;
this.stop();