Frame 5
loaded = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
pl_core.status.text = loaded + " %";
pl_core.progress._width = ((_root.getBytesLoaded() / _root.getBytesTotal()) * 100) / 2;
if (getBytesLoaded() < getBytesTotal()) {
this.gotoAndPlay(1);
} else {
pl_core.status.text = "100 %";
pl_core.base.gotoAndStop(2);
this.gotoAndPlay("bg");
}
Frame 7
function dumpMap() {
var _local2 = 0;
while (_local2 < 20) {
var _local3 = "";
var _local1 = 0;
while (_local1 < 20) {
_local3 = _local3 + _root.maze[_local2][_local1];
_local1++;
}
trace(_local3);
_local2++;
}
}
function fResetGame() {
var _local1 = _root;
_local1.lev = 1;
_local1.score = 0;
_local1.lives = 5;
_local1.key = false;
_local1.loadedModules = 0;
}
Stage.showMenu = false;
_quality = "HIGH";
_root.lev = 1;
_root.score = 0;
_root.lives = 5;
_root.key = false;
_root.loadedModules = 0;
_global.Point = function (px, py) {
this.x = px;
this.y = py;
};
_root.gameMode = "classic";
loadMovie ("LevelEditor/backGrounds.swf", "_root.sfondo");
Instance of Symbol 151 MovieClip "sfondo" in Frame 7
onClipEvent (data) {
_root.gotoAndPlay("tiles");
}
onClipEvent (load) {
function createBG() {
var cont = 1;
var gino = null;
y = 0;
while (y < 10) {
x = 0;
while (x < 10) {
duplicateMovieClip ("bg" + _root.level_BG, "bgtile" + cont, cont);
gino = eval ("bgtile" + cont);
gino._x = 64 * x;
gino._y = 64 * y;
cont = cont + 1;
x++;
}
y++;
}
}
}
onClipEvent (enterFrame) {
if (this.getBytesLoaded() == this.getBytesTotal()) {
_root.pl_bg.status.text = "100 %";
_root.pl_bg.progress._width = 50;
_root.pl_bg.base.gotoAndStop(2);
this.onEnterFrame = null;
} else {
var loaded = Math.round((this.getBytesLoaded() / this.getBytesTotal()) * 100);
_root.pl_bg.status.text = loaded + " %";
_root.pl_bg.progress._width = loaded / 2;
}
}
Frame 8
function mediumAI(id) {
var _local1 = _root;
var way = new Array();
var _local3 = _local1.bad[id].px;
var _local2 = _local1.bad[id].py;
var dir = _local1.bad[id].dir;
var old_dir = 0;
y = 1;
while (y <= 4) {
way[y] = 0;
y++;
}
switch (dir) {
case 1 :
old_dir = 2;
break;
case 2 :
old_dir = 1;
break;
case 3 :
old_dir = 4;
break;
case 4 :
old_dir = 3;
}
flag = 0;
y = 1;
while (y <= 4) {
if (y != old_dir) {
switch (y) {
case 1 :
if ((_local1.maze[_local2][_local3 - 1] != "X") && (_local1.maze[_local2][_local3 - 1] != "*")) {
way[1] = 1;
flag = flag + 1;
} else {
way[1] = 0;
}
break;
case 2 :
if ((_local1.maze[_local2][_local3 + 1] != "X") && (_local1.maze[_local2][_local3 + 1] != "*")) {
way[2] = 2;
flag = flag + 1;
} else {
way[2] = 0;
}
break;
case 3 :
if ((_local1.maze[_local2 - 1][_local3] != "X") && (_local1.maze[_local2 - 1][_local3] != "*")) {
way[3] = 3;
flag = flag + 1;
} else {
way[3] = 0;
}
break;
case 4 :
if ((_local1.maze[_local2 + 1][_local3] != "X") && (_local1.maze[_local2 + 1][_local3] != "*")) {
way[4] = 4;
flag = flag + 1;
} else {
way[4] = 0;
}
}
}
y++;
}
var avail_way = new Array();
var cc = 1;
y = 1;
while (y <= 4) {
if (way[y] != 0) {
avail_way[cc] = way[y];
cc = cc + 1;
}
y++;
}
if (flag == 0) {
dir = old_dir;
} else {
dir = avail_way[1];
factor = 0;
z = avail_way.length;
y = 1;
while (y <= z) {
switch (avail_way[y]) {
case 1 :
tmpfct = Math.abs(_local3 - _local1.gigio.gx);
if (((_local3 - _local1.gigio.gx) >= 0) and (tmpfct > factor)) {
dir = avail_way[y];
factor = tmpfct;
}
break;
case 2 :
tmpfct = Math.abs(_local3 - _local1.gigio.gx);
if (((_local3 - _local1.gigio.gx) <= 0) and (tmpfct > factor)) {
dir = avail_way[y];
factor = tmpfct;
}
break;
case 3 :
tmpfct = Math.abs(_local2 - _local1.gigio.gy);
if (((_local2 - _local1.gigio.gy) >= 0) and (tmpfct > factor)) {
dir = avail_way[y];
factor = tmpfct;
}
break;
case 4 :
tmpfct = Math.abs(_local2 - _local1.gigio.gy);
if (!(((_local2 - _local1.gigio.gy) <= 0) and (tmpfct > factor))) {
break;
}
dir = avail_way[y];
factor = tmpfct;
}
y++;
}
}
return(dir);
}
function lookForGigio(id) {
var seeFlag = 0;
var px = _root.bad[id].px;
var py = _root.bad[id].py;
var dir = _root.bad[id].dir;
var addx = new Array(0, -1, 1, 0, 0);
var addy = new Array(0, 0, 0, -1, 1);
if ((px == _root.gigio.gx) || (py == _root.gigio.gy)) {
var _local1 = 1;
while (_local1 <= 4) {
var _local3 = px;
var _local2 = py;
var z = 0;
while (z <= 10) {
if ((_root.maze[_local2 + addy[_local1]][_local3 + addx[_local1]] >= "A") && (_root.maze[_local2 + addy[_local1]][_local3 + addx[_local1]] <= "Z")) {
addx[i] = 0;
addy[i] = 0;
} else {
_local3 = _local3 + addx[_local1];
_local2 = _local2 + addy[_local1];
}
if ((_local3 == _root.gigio.gx) && (_local2 == _root.gigio.gy)) {
return(true);
}
z++;
}
_local1++;
}
}
return(false);
}
function sendEnemyToDoor() {
var _local2 = _root;
var _local3 = 0;
var _local1 = 0;
while (_local1 < _local2.maxbad) {
if (_local2.bad[_local1].typ == 3) {
_local3++;
break;
}
_local1++;
}
if (_local3 > 0) {
_local2.bad[_local1].mode = "goback";
_local2.bad[_local1].trg = new Point(_local2.exitDoor.px, _local2.exitDoor.py);
_local2.bad[_local1].inited = false;
}
}
function accelerateEnemies() {
var _local2 = _root;
var _local1 = 0;
while (_local1 < _local2.maxbad) {
if (_local2.bad[_local1].typ != 3) {
_local2.badstep[_local1] = _local2.badstep[_local1] - 4;
if (_local2.badstep[_local1] < 10) {
_local2.badstep[_local1] = 10;
}
_local2.bad[_local1].step = _local2.badstep[_local1];
_local2.bad[_local1].speed = 32 / _local2.badstep[_local1];
}
_local1++;
}
}
Frame 9
function findPath(startpoint, endpoint) {
var points = new Array();
var sb = 0;
points[sb] = startpoint;
var st = 1;
var n;
var c;
var _local1;
var _local2;
var i;
var v;
var _local3 = new Array();
for (v in _root.table) {
_local3[v] = _root.table[v];
}
while (sb != st) {
n = points[sb];
_local2 = n - 20;
if (!_local3[_local2]) {
_local3[_local2] = n;
points[st] = _local2;
if (_local2 == endpoint) {
final = new Array();
final[0] = _local2;
c = 1;
_local1 = _local2;
while (_local3[_local1] != startpoint) {
_local1 = _local3[_local1];
final[c] = _local1;
c++;
}
final.reverse();
return(final);
}
st++;
}
_local2 = n + 20;
if (!_local3[_local2]) {
_local3[_local2] = n;
points[st] = _local2;
if (_local2 == endpoint) {
final = new Array();
final[0] = _local2;
c = 1;
_local1 = _local2;
while (_local3[_local1] != startpoint) {
_local1 = _local3[_local1];
final[c] = _local1;
c++;
}
final.reverse();
return(final);
}
st++;
}
_local2 = n + 1;
if (!_local3[_local2]) {
_local3[_local2] = n;
points[st] = _local2;
if (_local2 == endpoint) {
final = new Array();
final[0] = _local2;
c = 1;
_local1 = _local2;
while (_local3[_local1] != startpoint) {
_local1 = _local3[_local1];
final[c] = _local1;
c++;
}
final.reverse();
return(final);
}
st++;
}
_local2 = n - 1;
if (!_local3[_local2]) {
_local3[_local2] = n;
points[st] = _local2;
if (_local2 == endpoint) {
final = new Array();
final[0] = _local2;
c = 1;
_local1 = _local2;
while (_local3[_local1] != startpoint) {
_local1 = _local3[_local1];
final[c] = _local1;
c++;
}
final.reverse();
return(final);
}
st++;
}
sb++;
}
return(0);
}
table = new Array();
Frame 12
stop();
Frame 15
stop();
loadMovie ("LevelEditor/Tiles.swf", _root.livello);
Instance of Symbol 152 MovieClip "livello" in Frame 15
onClipEvent (data) {
_root.gotoAndPlay("sound");
}
onClipEvent (enterFrame) {
if (this.getBytesLoaded() == this.getBytesTotal()) {
_root.pl_sprites.status.text = "100 %";
_root.pl_sprites.progress._width = 50;
_root.pl_sprites.base.gotoAndStop(2);
this.onEnterFrame = null;
} else {
var loaded = Math.round((this.getBytesLoaded() / this.getBytesTotal()) * 100);
_root.pl_sprites.status.text = loaded + " %";
_root.pl_sprites.progress._width = loaded / 2;
}
}
onClipEvent (load) {
function scramble(ar) {
var _local2 = new Array();
var _local3 = int(ar.length / 2);
var res = (ar.length % 2);
var _local1 = 0;
while (_local1 < _local3) {
_local2.push(ar[_local1]);
_local2.push(ar[_local1 + _local3]);
_local1++;
}
if (res != 0) {
_local2.push(a[a.length - 1]);
}
return(_local2);
}
function createTiles() {
_root.tiles = new Array(63);
var i = 1;
while (i <= 63) {
var item = eval ("_root.livello.tile_" + i);
if (item != null) {
_root.tiles[item.id.charCodeAt(0)] = i;
}
i++;
}
displayLevel();
_root.play();
}
function displayLevel() {
var cnt = 0;
delete _root.maze;
_root.maze = new Array(20);
_root.items_hi = new Array();
_root.items_lo = new Array();
var cn = 1;
var cn_bomb = 0;
var cn_baule = 0;
_root.biglia = new Array();
_root.bomb = new Array();
_root.baule = new Array();
var yy = 0;
while (yy < 20) {
_root.maze[yy] = new Array(20);
var xx = 0;
while (xx < 20) {
var c = _root.levelmap.substr(cnt, 1);
_root.maze[yy][xx] = c;
var lvl = ((yy * 20) + xx);
if (c == "$") {
var target = _root.tiles[c.charCodeAt(0)];
var tilez = eval ("_root.livello.tile_" + target);
tilez.duplicateMovieClip("tile" + lvl, lvl);
_root.exitDoor = eval ("_root.livello.tile" + lvl);
_root.exitDoor._x = (xx * 32) + 600;
_root.exitDoor._y = yy * 32;
_root.exitDoor.px = xx;
_root.exitDoor.py = yy;
}
if (((((c >= "A") && (c <= "Z")) || ((c >= "f") && (c <= "l"))) || (c == "(")) || (c == ")")) {
var target = _root.tiles[c.charCodeAt(0)];
var tilez = eval ("_root.livello.tile_" + target);
tilez.duplicateMovieClip("tile" + lvl, lvl);
tmp = eval ("_root.livello.tile" + lvl);
tmp._x = (xx * 32) + 600;
tmp._y = yy * 32;
_root.table[lvl] = 1;
_root.maze[yy][xx] = "X";
} else {
switch (c) {
case "a" :
if ((_root.levelstarted == false) || ((_root.levelstarted == true) && (_root.biglia_state[cn - 1] == 1))) {
duplicateMovieClip ("tile_40", "biglia" + cn, lvl);
_root.biglia[cn - 1] = eval ("biglia" + cn);
_root.biglia[cn - 1]._x = (xx * 32) + 600;
_root.biglia[cn - 1]._y = yy * 32;
_root.items_lo.push(new Point(xx, yy));
}
cn++;
break;
case "b" :
if ((_root.levelstarted == false) || ((_root.levelstarted == true) && (_root.biglia_state[cn - 1] == 1))) {
duplicateMovieClip ("tile_42", "biglia" + cn, lvl);
_root.biglia[cn - 1] = eval ("biglia" + cn);
_root.biglia[cn - 1]._x = (xx * 32) + 600;
_root.biglia[cn - 1]._y = yy * 32;
_root.items_lo.push(new Point(xx, yy));
}
cn++;
break;
case "c" :
if ((_root.levelstarted == false) || ((_root.levelstarted == true) && (_root.biglia_state[cn - 1] == 1))) {
duplicateMovieClip ("tile_43", "biglia" + cn, lvl);
_root.biglia[cn - 1] = eval ("biglia" + cn);
_root.biglia[cn - 1]._x = (xx * 32) + 600;
_root.biglia[cn - 1]._y = yy * 32;
_root.items_hi.push(new Point(xx, yy));
}
cn++;
break;
case "d" :
if ((_root.levelstarted == false) || ((_root.levelstarted == true) && (_root.biglia_state[cn - 1] == 1))) {
duplicateMovieClip ("tile_44", "biglia" + cn, lvl);
_root.biglia[cn - 1] = eval ("biglia" + cn);
_root.biglia[cn - 1]._x = (xx * 32) + 600;
_root.biglia[cn - 1]._y = yy * 32;
_root.items_lo.push(new Point(xx, yy));
}
cn++;
break;
case "e" :
if ((_root.levelstarted == false) || ((_root.levelstarted == true) && (_root.biglia_state[cn - 1] == 1))) {
duplicateMovieClip ("tile_45", "biglia" + cn, lvl);
_root.biglia[cn - 1] = eval ("biglia" + cn);
_root.biglia[cn - 1]._x = (xx * 32) + 600;
_root.biglia[cn - 1]._y = yy * 32;
_root.items_hi.push(new Point(xx, yy));
}
cn++;
break;
case "0" :
duplicateMovieClip ("tile_82", "bomb" + cn_bomb, lvl);
_root.bomb[cn_bomb] = eval ("bomb" + cn_bomb);
_root.bomb[cn_bomb]._x = (xx * 32) + 600;
_root.bomb[cn_bomb]._y = yy * 32;
cn_bomb = cn_bomb + 1;
break;
case "1" :
set_baule(c, cn_baule, xx, yy);
cn_baule = cn_baule + 1;
break;
case "2" :
set_baule(c, cn_baule, xx, yy);
cn_baule = cn_baule + 1;
break;
case "3" :
set_baule(c, cn_baule, xx, yy);
cn_baule = cn_baule + 1;
break;
case "4" :
set_baule(c, cn_baule, xx, yy);
cn_baule = cn_baule + 1;
break;
case "5" :
set_baule(c, cn_baule, xx, yy);
cn_baule = cn_baule + 1;
break;
case "6" :
set_baule(c, cn_baule, xx, yy);
cn_baule = cn_baule + 1;
}
}
cnt = cnt + 1;
xx++;
}
yy++;
}
_root.itemTargets = scramble(_root.items_hi.concat(_root.items_lo));
_root.itemTargets.reverse();
delete _root.items_lo;
delete _root.items_hi;
_root.maxbiglia = cn - 1;
_root.maxbaule = cn_baule;
if (!_root.levelstarted) {
_root.biglia_eaten = _root.maxbiglia;
var u = 0;
while (u < _root.maxbiglia) {
_root.biglia_state[u] = 1;
u++;
}
var u = 0;
while (u < _root.maxbaule) {
_root.baule_state[u] = 1;
u++;
}
_root.levelstarted = true;
show_score(_root.score);
}
}
function set_baule(n, cn, xx, yy) {
if ((_root.levelstarted == false) || ((_root.levelstarted == true) && (_root.baule_state[cn] == 1))) {
var lvl = ((yy * 20) + xx);
duplicateMovieClip ("baule", "baule" + cn, lvl);
_root.baule[cn] = eval ("baule" + cn);
_root.baule[cn]._x = (xx * 32) + 600;
_root.baule[cn]._y = yy * 32;
_root.baule[cn].item = n;
}
}
function show_score(val) {
var _local2 = "";
var _local3 = String(val);
var _local1 = 1;
while (_local1 <= (10 - _local3.length)) {
_local2 = _local2 + "0";
_local1++;
}
_local2 = _local2 + _local3;
_root.scoreBar.scorevar.text = _local2;
}
}
Frame 19
stop();
loadMovie ("LevelEditor/soundFx.swf", "_root.soundFx");
Instance of Symbol 154 MovieClip "soundFx" in Frame 19
onClipEvent (load) {
this.onEnterFrame = function () {
var _local1 = _root;
var _local2 = this;
if (_local2.getBytesLoaded() == _local2.getBytesTotal()) {
_local1.pl_sound.status.text = "100 %";
_local1.pl_sound.progress._width = 50;
_local1.pl_sound.base.gotoAndStop(2);
_local2.onEnterFrame = null;
_local1.play();
} else {
var _local3 = Math.round((_local2.getBytesLoaded() / _local2.getBytesTotal()) * 100);
_local1.pl_sound.status.text = _local3 + " %";
_local1.pl_sound.progress._width = _local3 / 2;
}
};
}
Frame 24
stop();
_root.classicMode = new LoadVars();
_root.classicMode.onLoad = function () {
_root.play();
};
_root.classicMode.load("classicMode.conf");
Frame 25
function fPauseGame() {
if (pPause == false) {
pPause = true;
} else {
pPause = false;
}
inPause.fPause();
}
function fQuitGame() {
_root.gotoAndPlay(3);
}
pPause = false;
stop();
Frame 31
function ExtractData(success) {
var _local2 = _root;
if (success) {
_local2.badtype = new Array();
_local2.badstep = new Array();
_local2.badspd = new Array();
_local2.badposx = new Array();
_local2.badposy = new Array();
_local2.badtarget = new Array();
_local2.levelmap = "";
_local2.maxbad = 0;
LevelTag = this.lastChild.childNodes;
var _local1 = 0;
while (_local1 < LevelTag.length) {
if (LevelTag[_local1].nodeName == "stage") {
_global.stageName = LevelTag[_local1].firstChild.nodeValue;
}
if (LevelTag[_local1].nodeName == "name") {
_global.levelName = LevelTag[_local1].firstChild.nodeValue;
}
if (LevelTag[_local1].nodeName == "author") {
level_author = LevelTag[_local1].firstChild.nodeValue;
}
if (LevelTag[_local1].nodeName == "date") {
level_date = LevelTag[_local1].firstChild.nodeValue;
}
if (LevelTag[_local1].nodeName == "timer") {
level_timer = LevelTag[_local1].firstChild.nodeValue;
}
if (LevelTag[_local1].nodeName == "gigio") {
_local2.gigio_x = Number(LevelTag[_local1].attributes.posx);
_local2.gigio_y = Number(LevelTag[_local1].attributes.posy);
}
if (LevelTag[_local1].nodeName == "map") {
var line = 0;
while (line < LevelTag[_local1].childNodes.length) {
_local2.levelmap = _local2.levelmap + LevelTag[_local1].childNodes[line].firstChild.nodeValue;
line++;
}
}
if (LevelTag[_local1].nodeName == "enemies") {
_local2.maxbad = LevelTag[_local1].childNodes.length;
var _local3 = 0;
while (_local3 < _local2.maxbad) {
CurrentNode = LevelTag[_local1].childNodes[_local3];
_local2.badtype[_local3] = CurrentNode.attributes.typ;
_local2.badstep[_local3] = Number(CurrentNode.attributes.speed);
_local2.badposx[_local3] = Number(CurrentNode.attributes.posx);
_local2.badposy[_local3] = Number(CurrentNode.attributes.posy);
_local3++;
}
}
if (LevelTag[_local1].nodeName == "backGround") {
_local2.level_BG = LevelTag[_local1].firstChild.nodeValue;
}
_local1++;
}
_local2.start_bad_x = new Array();
_local2.start_bad_y = new Array();
_local2.gigio_init_x = _local2.gigio_x;
_local2.gigio_init_y = _local2.gigio_y;
var n = 0;
while (n < _local2.badposx.length) {
_local2.start_bad_x[n] = _local2.badposx[n];
_local2.start_bad_y[n] = _local2.badposy[n];
n++;
}
xmlLoader.loading._visible = false;
xmlLoader.stageName.text = ("\"" + _global.stageName) + "\"";
xmlLoader.levelName.text = _global.levelName;
xmlLoader.playButt._visible = true;
var stageCount = (((_local2.lev % _local2.classicMode.stageLevels) == 0) ? (int(_local2.lev / _local2.classicMode.stageLevels) - 1) : (int(_local2.lev / _local2.classicMode.stageLevels)));
var pstage = (1 + stageCount);
var level = (_local2.lev - ((pstage - 1) * _local2.classicMode.stageLevels));
xmlLoader.levelInfo.text = "Level " + level;
xmlLoader.stageInfo.text = "Stage " + pstage;
} else {
_local2.gotoAndPlay("netError");
}
}
xmlfile = ((_root.classicMode.mapFolder + "/level-") + _root.lev) + ".xml";
Level = new XML();
Level.onLoad = ExtractData;
Level.ignoreWhite = true;
this.onEnterFrame = function () {
var _local1 = _root;
if (Level.getBytesLoaded() == Level.getBytesTotal()) {
_local1.pl_map.status.text = "100 %";
_local1.pl_map.progress._width = 50;
this.onEnterFrame = null;
} else {
var _local2 = Math.round((Level.getBytesLoaded() / Level.getBytesTotal()) * 100);
_local1.pl_map.status.text = _local2 + " %";
_local1.pl_map.progress._width = _local2 / 2;
}
};
Level.load(xmlfile);
_root.biglia_state = new Array();
_root.baule_state = new Array();
_root.levelstarted = false;
_root.firstmove = new Array();
_root.bad = new Array();
Frame 32
stop();
Frame 36
function comboBonus(val) {
switch (val) {
case 2 :
combo1.duplicateMovieClip("Bonus", 3000);
break;
case 3 :
combo2.duplicateMovieClip("Bonus", 3000);
break;
case 4 :
combo3.duplicateMovieClip("Bonus", 3000);
}
Bonus._alpha = 78;
Bonus._x = 275;
Bonus._y = 290;
Bonus.gotoAndPlay(2);
}
_root.sfondo.createBG();
_root.livello.createTiles();
Instance of Symbol 230 MovieClip "inPause" in Frame 37
onClipEvent (load) {
function fPause() {
if (_root.pPause == true) {
this._x = pPos[0];
inBox.gotoAndPlay(2);
} else {
this._x = -200;
}
}
pPos = [this._x, this._y];
this._x = -200;
stop();
}
Instance of Symbol 262 MovieClip "enemies" in Frame 41
onClipEvent (load) {
function heuristic(px, py) {
var _local2 = _root;
var _local1 = 0;
if (px != _local2.gigio.gx) {
_local1 = _local1 + Math.abs(px - _local2.gigio.gx);
}
if (py != _local2.gigio.gy) {
_local1 = _local1 + Math.abs(py - _local2.gigio.gy);
}
return(_local1);
}
function enemyDie(i) {
var _local1 = _root;
var _local2 = i;
_local1.bad[_local2].active = false;
_local1.bad[_local2].timer = 400;
_local1.maze[_local1.bad[_local2].py][_local1.bad[_local2].px] = _local1.bad[_local2].savedMapItem;
delete _local1.table[_local1.bad[_local2].px + (_local1.bad[_local2].py * 20)];
switchBad(0, "bad" + _local2, _local1.bad[_local2].typ);
_local1.deadEnemies.showDeadEnemy(_local2);
}
function switchBad(dir, instance, type) {
enemyMov = eval (instance);
if (enemyMov.pLastDir != dir) {
trace((((enemyMov + " ") + enemyMov.pLastDir) + " switchBad ") + dir);
enemyMov.pLastDir = dir;
if (type == 1) {
switch (dir) {
case 0 :
enemyMov._visible = false;
break;
case 1 :
enemyMov.attachMovie("skeleton_sx", "badAni", 1);
badMov = eval (instance + ".badAni");
badMov._xscale = 70;
badMov._yscale = 80;
badMov._x = 12;
badMov._y = 7;
break;
case 2 :
enemyMov.attachMovie("skeleton_sx", "badAni", 1);
badMov = eval (instance + ".badAni");
badMov._xscale = -70;
badMov._yscale = 80;
badMov._x = 12;
badMov._y = 7;
break;
case 4 :
enemyMov.attachMovie("skeleton_top", "badAni", 1);
badMov = eval (instance + ".badAni");
badMov._xscale = 80;
badMov._yscale = 80;
badMov._x = 13;
badMov._y = 10;
break;
case 3 :
enemyMov.attachMovie("skeleton_back", "badAni", 1);
badMov = eval (instance + ".badAni");
badMov._xscale = 80;
badMov._yscale = 80;
badMov._x = 12;
badMov._y = 10;
}
} else if (type == 2) {
switch (dir) {
case 0 :
enemyMov._visible = false;
break;
case 1 :
enemyMov.attachMovie("papoccia_left", "badAni", 1);
badMov = eval (instance + ".badAni");
badMov._xscale = 80;
badMov._yscale = 80;
badMov._x = 12;
badMov._y = 9;
break;
case 2 :
enemyMov.attachMovie("papoccia_left", "badAni", 1);
badMov = eval (instance + ".badAni");
badMov._xscale = -80;
badMov._yscale = 80;
badMov._x = 12;
badMov._y = 9;
break;
case 4 :
enemyMov.attachMovie("papoccia_down", "badAni", 1);
badMov = eval (instance + ".badAni");
badMov._xscale = 62;
badMov._yscale = 62;
badMov._x = 13;
badMov._y = 10;
break;
case 3 :
enemyMov.attachMovie("papoccia_up", "badAni", 1);
badMov = eval (instance + ".badAni");
badMov._xscale = 62;
badMov._yscale = 62;
badMov._x = 12;
badMov._y = 10;
}
} else if (type == 3) {
switch (dir) {
case 0 :
enemyMov._visible = false;
return;
case 1 :
enemyMov.attachMovie("bouncer_side", "badAni", 1);
badMov = eval (instance + ".badAni");
badMov._xscale = 80;
badMov._yscale = 80;
badMov._x = 16;
badMov._y = 5;
return;
case 2 :
enemyMov.attachMovie("bouncer_side", "badAni", 1);
badMov = eval (instance + ".badAni");
badMov._xscale = -80;
badMov._yscale = 80;
badMov._x = 16;
badMov._y = 5;
return;
case 4 :
enemyMov.attachMovie("bouncer_up", "badAni", 1);
badMov = eval (instance + ".badAni");
badMov._xscale = 80;
badMov._yscale = 80;
badMov._x = 13;
badMov._y = 8;
return;
case 3 :
enemyMov.attachMovie("bouncer_back", "badAni", 1);
badMov = eval (instance + ".badAni");
badMov._xscale = 80;
badMov._yscale = 80;
badMov._x = 13;
badMov._y = 8;
}
}
}
}
cnt = 0;
way = new Array();
bad_obstacles = "XLWY";
_root.moving = "none";
_root.move = "none";
_root.havebomb = 0;
ai_count = new Array();
ai_steps = new Array();
addx = new Array(0, -1, 1, 0, 0);
addy = new Array(0, 0, 0, -1, 1);
avail_way = new Array();
j = 0;
while (j < _root.maxbad) {
ai_count[j] = (ai_steps[j] = -1);
j++;
}
i = 0;
while (i < _root.maxbad) {
duplicateMovieClip ("bstrd1", "bad" + i, 400 + i);
_root.bad[i] = eval ("bad" + i);
_root.bad[i].active = true;
_root.bad[i]._x = _root.badposx[i] * 32;
_root.bad[i]._y = _root.badposy[i] * 32;
_root.bad[i].px = _root.badposx[i];
_root.bad[i].py = _root.badposy[i];
_root.bad[i].startx = _root.badposx[i];
_root.bad[i].starty = _root.badposy[i];
_root.bad[i].speed = 32 / _root.badstep[i];
_root.bad[i].step = _root.badstep[i];
_root.bad[i].typ = _root.badtype[i];
_root.bad[i].dir = 1;
_root.bad[i].pLastDir = 0;
trace((_root.bad[i] + "NEW ENEMY ") + _root.bad[i].pLastDir);
_root.bad[i].cnt = 0;
_root.bad[i].firstmove = true;
_root.bad[i].savedMapItem = " ";
if (_root.bad[i].typ == 3) {
_root.bad[i].inited = false;
_root.bad[i].mode = "hunt";
if (typeof(_root.badtarget[i]) == "undefined") {
if (_root.itemTargets.length > 0) {
_root.badtarget[i] = (_root.bad[i].trg = _root.itemTargets.pop());
} else {
trace("--- NO MORE TARGETS ---");
_root.bad[i].trg = -1;
_root.bad[i].mode = "wander";
_root.bad[i].inited = true;
}
} else {
_root.bad[i].trg = _root.badtarget[i];
}
}
i++;
}
if (_root.key) {
_root.sendEnemyToDoor();
}
}
onClipEvent (enterFrame) {
if (_root.pPause == false) {
i = 0;
while (i < _root.maxbad) {
dontMove = false;
delete _root.table[_root.bad[i].px + (_root.bad[i].py * 20)];
if (_root.bad[i].active) {
var px = _root.bad[i].px;
var py = _root.bad[i].py;
var dir = _root.bad[i].dir;
var cnt = _root.bad[i].cnt;
if (_root.bad[i].firstmove) {
_root.bad[i].firstmove = false;
cnt = _root.bad[i].step;
}
if (_root.bad[i].dontMove) {
_root.bad[i].cnt++;
}
if (cnt >= _root.bad[i].step) {
cnt = 0;
_root.bad[i].dontMove = false;
switch (_root.bad[i].typ) {
case "1" :
var startPoint = (px + (py * 20));
if (ai_count[i] < 0) {
var endPoint = (_root.gigio.gx + (_root.gigio.gy * 20));
_root.bad[i].thePath = _root.findPath(startPoint, endPoint);
}
if (_root.bad[i].thePath != 0) {
var nextStep = _root.bad[i].thePath[ai_steps[i] - (ai_count[i]--)];
var nextDir = (nextStep - startPoint);
if (nextDir == -20) {
dir = 3;
} else if (nextDir == 20) {
dir = 4;
} else if (nextDir == -1) {
dir = 1;
} else if (nextDir == 1) {
dir = 2;
} else {
dir = _root.mediumAI(i);
ai_count[i] = -1;
}
} else {
dir = _root.mediumAI(i);
ai_count[i] = -1;
trace((("type=1 - dir=" + dir) + " - nextDir=") + nextDir);
}
_root.bad[i].dir = dir;
break;
case "2" :
_root.bad[i].dir = _root.mediumAI(i);
break;
case "3" :
if ((_root.bad[i].mode != "hunt") && (_root.bad[i].mode != "wander")) {
if (_root.lookForGigio(i)) {
_root.bad[i].mode = "hunt";
_root.bad[i].inited = true;
}
}
if (_root.bad[i].inited != true) {
if (typeof(_root.bad[i].trg) == "object") {
_root.bad[i].thePath = _root.findPath(px + (py * 20), _root.bad[i].trg.x + (_root.bad[i].trg.y * 20));
_root.bad[i].inited = true;
_root.bad[i].pathSteps = 0;
if (_root.bad[i].thePath == 0) {
_root.badtarget[i] = (_root.bad[i].trg = _root.itemTargets.pop());
_root.bad[i].inited = false;
_root.bad[i].mode = "goback";
}
} else {
_root.bad[i].mode == "wander";
_root.bad[i].inited = true;
}
}
if (_root.bad[i].mode == "goback") {
if (_root.maze[_root.bad[i].trg.y][_root.bad[i].trg.x] != " ") {
if (_root.bad[i].pathSteps < _root.bad[i].thePath.length) {
thisPoint = px + (py * 20);
nextPoint = _root.bad[i].thePath[_root.bad[i].pathSteps++];
nextDir = nextPoint - thisPoint;
if (nextDir == -20) {
dir = 3;
} else if (nextDir == 20) {
dir = 4;
} else if (nextDir == -1) {
dir = 1;
} else if (nextDir == 1) {
dir = 2;
} else {
dir = _root.mediumAI(i);
}
_root.bad[i].dir = dir;
} else {
_root.bad[i].mode = "goaway";
_root.bad[i].awaySteps = 5;
}
} else if (_root.itemTargets.length > 0) {
_root.badtarget[i] = (_root.bad[i].trg = _root.itemTargets.pop());
_root.bad[i].inited = false;
_root.bad[i].mode = "goback";
} else {
trace("no more targets to go to ");
_root.bad[i].mode = "wander";
_root.bad[i].inited = true;
}
} else if (_root.bad[i].mode == "goaway") {
if (_root.bad[i].awaySteps > 0) {
_root.bad[i].dir = _root.mediumAI(i);
_root.bad[i].awaySteps--;
} else {
_root.bad[i].mode = "goback";
_root.bad[i].inited = false;
}
} else if (_root.bad[i].mode == "hunt") {
if (_root.bad[i].thePath.length < 12) {
thisPoint = px + (py * 20);
nextPoint = _root.bad[i].thePath[0];
nextDir = nextPoint - thisPoint;
if (nextDir == -20) {
dir = 3;
} else if (nextDir == 20) {
dir = 4;
} else if (nextDir == -1) {
dir = 1;
} else if (nextDir == 1) {
dir = 2;
} else {
dir = _root.mediumAI(i);
}
_root.bad[i].dir = dir;
} else {
_root.bad[i].mode = "goback";
_root.bad[i].inited = false;
}
} else {
if (_root.bad[i].mode != "wander") {
break;
}
_root.bad[i].dir = _root.mediumAI(i);
trace("dir = " + _root.bad[i].dir);
}
}
_root.maze[py][px] = _root.bad[i].savedMapItem;
switchBad(_root.bad[i].dir, "bad" + i, _root.bad[i].typ);
switch (_root.bad[i].dir) {
case 1 :
if ((_root.maze[py][px - 1] != "X") && (_root.maze[py][px - 1] != "*")) {
_root.bad[i].px = _root.bad[i].px - 1;
} else {
_root.bad[i].dontMove = true;
}
break;
case 2 :
if ((_root.maze[py][px + 1] != "X") && (_root.maze[py][px + 1] != "*")) {
_root.bad[i].px = _root.bad[i].px + 1;
} else {
_root.bad[i].dontMove = true;
}
break;
case 3 :
if ((_root.maze[py - 1][px] != "X") && (_root.maze[py - 1][px] != "*")) {
_root.bad[i].py = _root.bad[i].py - 1;
} else {
_root.bad[i].dontMove = true;
}
break;
case 4 :
if ((_root.maze[py + 1][px] != "X") && (_root.maze[py + 1][px] != "*")) {
_root.bad[i].py = _root.bad[i].py + 1;
} else {
_root.bad[i].dontMove = true;
}
}
_root.bad[i].savedMapItem = _root.maze[_root.bad[i].py][_root.bad[i].px];
_root.maze[_root.bad[i].py][_root.bad[i].px] = "*";
_root.table[_root.bad[i].px + (_root.bad[i].py * 20)] = 1;
}
var speed = _root.bad[i].speed;
if (!_root.bad[i].dontMove) {
switch (_root.bad[i].dir) {
case 1 :
_root.bad[i]._x = _root.bad[i]._x - speed;
if (cnt == (_root.bad[i].step - 1)) {
_root.bad[i]._x = _root.bad[i].px * 32;
}
cnt = cnt + 1;
break;
case 2 :
_root.bad[i]._x = _root.bad[i]._x + speed;
if (cnt == (_root.bad[i].step - 1)) {
_root.bad[i]._x = _root.bad[i].px * 32;
_root.bad[i].dontMove = false;
}
cnt = cnt + 1;
break;
case 3 :
_root.bad[i]._y = _root.bad[i]._y - speed;
if (cnt == (_root.bad[i].step - 1)) {
_root.bad[i]._y = _root.bad[i].py * 32;
}
cnt = cnt + 1;
break;
case 4 :
_root.bad[i]._y = _root.bad[i]._y + speed;
if (cnt == (_root.bad[i].step - 1)) {
_root.bad[i]._y = _root.bad[i].py * 32;
}
cnt = cnt + 1;
}
_root.bad[i].cnt = cnt;
}
} else if (_root.bad[i].timer > 0) {
_root.bad[i].timer--;
} else {
_root.bad[i].active = true;
this.rebirth.duplicateMovieClip("rebirth" + i, 2000 + i);
this["rebirth" + i]._x = _root.bad[i]._x + 16;
this["rebirth" + i]._y = _root.bad[i]._y + 16;
this["rebirth" + i].gotoAndPlay(2);
var tmpItem = eval ("_root.deadEnemies.dead" + i);
tmpItem.removeMovieClip();
_root.bad[i]._visible = true;
_root.bad[i].gotoAndStop(1);
}
i++;
}
}
}
Instance of Symbol 268 MovieClip "gigio" in Frame 41
onClipEvent (load) {
function switch_gigio(dir) {
switch (dir) {
case 1 :
this.attachMovie("gigio_left", "gigio_ani", 1);
gigioMov = gigio_ani;
gigioMov._xscale = 100;
gigioMov._yscale = 100;
gigioMov._x = 0;
gigioMov._y = -9;
break;
case 2 :
this.attachMovie("gigio_right", "gigio_ani", 1);
gigioMov = gigio_ani;
gigioMov._xscale = 100;
gigioMov._yscale = 100;
gigioMov._x = 0;
gigioMov._y = -9;
break;
case 3 :
this.attachMovie("gigio_back", "gigio_ani", 1);
gigioMov = gigio_ani;
gigioMov._xscale = 100;
gigioMov._yscale = 100;
gigioMov._x = 1;
gigioMov._y = -9;
break;
case 4 :
this.attachMovie("gigio_top", "gigio_ani", 1);
gigioMov = gigio_ani;
gigioMov._xscale = 100;
gigioMov._yscale = 100;
gigioMov._x = 1;
gigioMov._y = -9;
}
gigioMov.stopped = false;
}
function stopGigio() {
gigioMov.gotoAndStop(1);
gigioMov.stopped = true;
}
function runGigio() {
gigioMov.gotoAndPlay(2);
gigioMov.stopped = false;
}
function put_door(x, y, id) {
check_door = 1;
q = 1;
while ((_root.door[q] != 0) && (q <= maxdoor)) {
q++;
}
_root.door[q] = 1;
duplicateMovieClip ("_root.livello.porta_" + id, "porta" + q, 510 + q);
var pino = eval ("_root.livello.porta" + q);
pino._x = (x * 32) + 600;
pino._y = y * 32;
pino.cx = x;
pino.cy = y;
pino.timer = 200;
pino.index = q;
pino.nextFrame();
_root.soundFX.doors.play();
_root.maze[y][x] = "X";
_root.table[(y * 20) + x] = 1;
_root.door_cnt = _root.door_cnt - 1;
}
function put_bomb(x, y, bombType) {
var ind = 0;
while (bomb_layer[ind]) {
ind++;
}
bomb_layer[ind] = true;
if (bombType == 0) {
_root.scoreBar.gotthebomb.gotoAndStop(1);
}
duplicateMovieClip ("_root.livello.tile_41", "bomba" + ind, 515 + ind);
var bomba = eval ("_root.livello.bomba" + ind);
bomba.ind = ind;
bomba._x = (x * 32) + 600;
bomba._y = y * 32;
bomba.cx = x;
bomba.cy = y;
bomba.timer = 100;
bomba.nextFrame();
bomba.active = true;
_root.soundFX.bomb_hiss.play();
}
function kill_gigio() {
var _local1 = this;
var _local2 = _root;
_local2.detonate = false;
_local1.die_counter = 100;
_local1.active = false;
_local1.gigio_ani.removeMovieClip();
_local1.gotoAndStop(2);
_local2.soundFx.dickDie.play();
_local2.soundFx.fMusic("lose");
}
function playItem(it, x, y) {
clip = eval ("_root.item_" + it);
clip._x = 40;
clip._y = 620;
clip.gotoAndPlay(2);
switch (it) {
case "1" :
item_bomb();
return;
case "2" :
item_xtraLife();
return;
case "3" :
item_poison();
return;
case "4" :
item_pepperone();
return;
case "5" :
item_nuke();
return;
case "6" :
item_key();
}
}
function item_xtraLife() {
_root.lives++;
_root.soundFX.life.play();
}
function item_bomb() {
put_bomb(gx, gy, 1);
}
function item_poison() {
g_speed_new = 2;
g_step_new = 15;
speed_timer = 100;
_root.soundFX.rutto.play();
}
function item_pepperone() {
g_speed_new = 8;
g_step_new = 3;
speed_timer = 100;
_root.soundFX.perepepe.play();
}
function item_nuke() {
_root.nuke.gotoAndPlay(2);
}
function item_key() {
var _local1 = _root;
_local1.soundFX.exitDoor.play();
_local1.key = true;
_local1.scoreBar.gotthekey.gotoAndStop(2);
_local1.exitDoor.nextFrame();
_local1.sendEnemyToDoor();
_local1.accelerateEnemies();
}
gx = _root.gigio_x;
gy = _root.gigio_y;
g_speed = 4;
g_step = 7;
g_speed_new = 4;
g_step_new = 7;
speed_timer = -1;
this._x = (gx * 32) + 16;
this._y = (gy * 32) + 16;
this.die_counter = -1;
this.active = true;
gigio_obstacles = "XLWY";
bomb_layer = new Array();
i = 0;
while (i < 20) {
bomb_layer[i] = false;
i++;
}
switch_gigio(4);
maxdoor = 3;
_root.door = new Array();
i = 1;
while (i <= maxdoor) {
_root.door[i] = 0;
i++;
}
_root.door_cnt = maxdoor;
check_door = 0;
}
onClipEvent (enterFrame) {
if (_root.pPause == false) {
if ((_root.moving == "none") && (this.active)) {
if (Key.isDown(90) && (_root.havebomb == 1)) {
put_bomb(gx, gy, 0);
_root.havebomb = 0;
_root.scoreBar.gotthebomb.gotoAndStop(1);
gigioMov.inBall.gotoAndPlay(1);
}
if ((Key.isDown(65) && (_root.door_cnt > 0)) && (check_door == 0)) {
switch (dir) {
case "dx" :
if (((_root.maze[gy + 1][gx - 1] == "X") && (_root.maze[gy - 1][gx - 1] == "X")) && (_root.maze[gy][gx - 1] != "*")) {
put_door(gx - 1, gy, "v");
}
break;
case "sx" :
if (((_root.maze[gy + 1][gx + 1] == "X") && (_root.maze[gy - 1][gx + 1] == "X")) && (_root.maze[gy][gx + 1] != "*")) {
put_door(gx + 1, gy, "v");
}
break;
case "up" :
if (((_root.maze[gy + 1][gx - 1] == "X") && (_root.maze[gy + 1][gx + 1] == "X")) && (_root.maze[gy + 1][gx] != "*")) {
put_door(gx, gy + 1, "h");
}
break;
case "dw" :
if (!(((_root.maze[gy - 1][gx - 1] == "X") && (_root.maze[gy - 1][gx + 1] == "X")) && (_root.maze[gy - 1][gx] != "*"))) {
break;
}
put_door(gx, gy - 1, "h");
}
} else if (Key.isDown(39) && (_root.maze[gy][gx + 1] != "X")) {
_root.move = "dx";
if (dir != "dx") {
switch_gigio(2);
}
if (gigioMov.stopped) {
runGigio();
}
dir = "dx";
frame_cnt = 0;
_root.moving = "true";
gx = gx + 1;
} else if (Key.isDown(37) && (_root.maze[gy][gx - 1] != "X")) {
_root.move = "sx";
if (dir != "sx") {
switch_gigio(1);
}
if (gigioMov.stopped) {
runGigio();
}
dir = "sx";
frame_cnt = 0;
_root.moving = "true";
gx = gx - 1;
} else if (Key.isDown(38) && (_root.maze[gy - 1][gx] != "X")) {
_root.move = "up";
if (dir != "up") {
switch_gigio(3);
}
if (gigioMov.stopped) {
runGigio();
}
dir = "up";
frame_cnt = 0;
_root.moving = "true";
gy = gy - 1;
} else if (Key.isDown(40) && (_root.maze[gy + 1][gx] != "X")) {
_root.move = "dw";
if (dir != "dw") {
switch_gigio(4);
}
if (gigioMov.stopped) {
runGigio();
}
dir = "dw";
frame_cnt = 0;
_root.moving = "true";
gy = gy + 1;
} else {
stopGigio();
}
g_speed = g_speed_new;
g_step = g_step_new;
if (speed_timer == 0) {
g_speed_new = 4;
}
if (speed_timer == 0) {
g_step_new = 7;
}
if (speed_timer >= 0) {
speed_timer--;
}
if (speed_timer == 15) {
_root.soundFX.alert.play();
}
}
if (_root.move == "dx") {
check_door = 0;
if (frame_cnt > g_step) {
_root.move = "none";
_root.moving = "none";
} else {
_root.gigio._x = _root.gigio._x + g_speed;
frame_cnt = frame_cnt + 1;
}
}
if (_root.move == "sx") {
check_door = 0;
if (frame_cnt > g_step) {
_root.move = "none";
_root.moving = "none";
} else {
_root.gigio._x = _root.gigio._x - g_speed;
frame_cnt = frame_cnt + 1;
}
}
if (_root.move == "up") {
check_door = 0;
if (frame_cnt > g_step) {
_root.move = "none";
_root.moving = "none";
} else {
_root.gigio._y = _root.gigio._y - g_speed;
frame_cnt = frame_cnt + 1;
}
}
if (_root.move == "dw") {
check_door = 0;
if (frame_cnt > g_step) {
_root.move = "none";
_root.moving = "none";
} else {
_root.gigio._y = _root.gigio._y + g_speed;
frame_cnt = frame_cnt + 1;
}
}
cnt = _root.maxbiglia;
i = 0;
while (i < cnt) {
if (_root.biglia[i].hit.hitTest(_root.gigio.hit)) {
_root.maze[gy][gx] = " ";
_root.biglia[i].play(2);
_root.biglia_state[i] = 0;
_root.biglia_eaten--;
_root.score = _root.score + _root.biglia[i].value;
_root.livello.show_score(_root.score);
}
i++;
}
i = 0;
while (i < _root.maxbaule) {
if (_root.baule[i].hit.hitTest(_root.gigio.hit)) {
_root.baule[i].play(2);
_root.baule_state[i] = 0;
playitem(_root.baule[i].item, _root.baule[i]._x - 600, _root.baule[i]._y);
}
i++;
}
if (_root.key) {
if (_root.exitDoor.hit.hitTest(_root.gigio.hit)) {
trace("walkout");
_root.exitDoor.exit.gotoAndPlay("walk");
_root.gotoAndPlay("nextLevel");
}
}
if (this.die_counter == -1) {
i = 0;
while (i < _root.maxbad) {
if (_root.bad[i].hit.hitTest(_root.gigio.hit) && (_root.bad[i].active == true)) {
kill_gigio();
}
i++;
}
}
i = 0;
while (i <= _root.bomb.length) {
if (_root.bomb[i].hit.hitTest(_root.gigio.hit) && (_root.havebomb == 0)) {
_root.bomb[i].gotoAndStop(2);
_root.havebomb = 1;
_root.scoreBar.gotthebomb.gotoAndStop(2);
_root.soundFX.takeBomb.play();
gigioMov.inBall.gotoAndPlay(1);
}
i++;
}
if (this.die_counter > 0) {
this.die_counter--;
} else if (this.die_counter == 0) {
this.die_counter = -1;
_root.gotoAndStop("dickDie");
}
}
}
Frame 43
pPause = true;
_root.soundFx.fMusic("game");
_root.dickIndicator._x = (_root.gigio_x * 32) + 16;
_root.dickIndicator._y = (_root.gigio_y * 32) + 16;
_root.dickIndicator.gotoAndPlay(2);
Frame 92
_root.livello.show_score(_root.score);
if (_root.testMode == "ok") {
_root.scoreBar.testMode._visible = true;
} else if (_root.gameMode == "classic") {
trace("ok");
_root.scoreBar.classicMode._visible = true;
} else if (_root.gameMode == "arena") {
_root.scoreBar.arenaMode._visible = true;
}
pPause = false;
stop();
Frame 106
function wait2seconds() {
if (countDown > 0) {
countDown--;
} else {
clearInterval(_root.wait);
if (_root.lives < 1) {
gotoAndStop ("gameOver");
} else {
restoreGame();
}
}
}
function restoreGame() {
_root.havebomb = false;
_root.scoreBar.gotthebomb.gotoAndStop(1);
resumeGame();
}
function resumeGame() {
var _local2 = _root;
_local2.maze[_local2.gigio.gy][_local2.gigio.gx] = " ";
var _local1 = 0;
while (_local1 < _local2.maxbad) {
_local2.maze[_local2.bad[_local1].py][_local2.bad[_local1].px] = _local2.bad[_local1].savedMapItem;
_local2.bad[_local1].px = _local2.bad[_local1].startx;
_local2.bad[_local1].py = _local2.bad[_local1].starty;
_local1++;
}
_local2.gigio.gx = _local2.gigio_init_x;
_local2.gigio.gy = _local2.gigio_init_y;
_local2.gigio._x = (_local2.gigio.gx * 32) + 16;
_local2.gigio._y = (_local2.gigio.gy * 32) + 16;
gotoAndPlay ("startGame");
}
stop();
_root.lives--;
countDown = 2;
_root.wait = setInterval(wait2seconds, 1000);
Frame 112
stop();
gotoAndStop ("hs_classic_U");
Frame 120
function wait2seconds() {
var _local1 = _root;
if (countDown > 0) {
countDown--;
} else {
clearInterval(_local1.wait);
if ((_local1.gameMode != "arena") && (_local1.lev == _local1.classicMode.lastLevel)) {
_local1.gotoAndPlay("gameOver");
} else if (_local1.testMode == "ok") {
nextLvl();
} else if ((_local1.gameMode == "arena") && (_local1.userID != "")) {
gotoAndStop ("hs_arena_U");
} else if ((_local1.gameMode == "arena") && (_local1.userID == "")) {
gotoAndStop ("hs_guest");
} else {
nextLvl();
}
}
}
function nextLvl() {
_root.lev++;
_root.key = false;
var i = 0;
while (i < 6) {
tmpItem = eval ("_root.deadEnemies.dead" + i);
tmpItem.removeMovieClip();
i++;
}
clearMap();
_root.gotoAndStop("mapXML");
}
function clearMap() {
var _local2 = _root;
var _local1 = 0;
while (_local1 < 500) {
_local2.livello["tile" + _local1].removeMovieClip();
_local2.livello["biglia" + _local1].removeMovieClip();
_local2.livello["bomb" + _local1].removeMovieClip();
_local2.livello["baule" + _local1].removeMovieClip();
_local2.livello["porta" + _local1].removeMovieClip();
_local1++;
}
_local2.table = new Array();
}
_root.soundFx.fMusic("win");
stop();
countDown = 2;
_root.wait = setInterval(wait2seconds, 1000);
Frame 128
function show_hscore(val) {
var _local2 = "";
var _local3 = String(val);
var _local1 = 1;
while (_local1 <= (10 - _local3.length)) {
_local2 = _local2 + "0";
_local1++;
}
_local2 = _local2 + _local3;
return(_local2);
}
_quality = "HIGH";
yourScore.text = show_hscore(_root.score) + " pts.";
_root.soundFx.fMusic("gameover");
if (((_root.gameMode == "classic") && (_root.lev == _root.classicMode.lastLevel)) && (_root.lives > 0)) {
gotoAndPlay ("ending");
}
stop();
Instance of Symbol 332 MovieClip "comHighscores" in Frame 144
//component parameters
onClipEvent (initialize) {
scoreLocation = "_root.score";
gamename = "thunderplunder";
saveScore = true;
scoreIsTime = false;
scoreReversed = false;
negativeScoreAllowed = false;
}
Frame 150
stop();
Frame 151
stop();
Symbol 6 MovieClip Frame 1
this._visible = false;
Symbol 12 Button
on (release) {
getURL ("http://www.miniclip.com/", "_blank");
}
Symbol 17 MovieClip Frame 1
pushSWF1 = "http://www.miniclip.com/swfcontent/push/didyouknow.swf";
totalAds = 1;
gotoAndPlay ("ReadCookie");
Symbol 17 MovieClip Frame 9
so = SharedObject.getLocal("MiniclipLoaderAd");
showThisAd = so.data.showThisAd + 1;
if (showThisAd > totalAds) {
showThisAd = 1;
}
so.data.showThisAd = showThisAd;
gotoAndPlay ("prepareAd");
Symbol 17 MovieClip Frame 20
doReadCookie();
showAd = ((this["pushSWF" + showThisAd] + "?cacheBuster=") + getTimer()) + random(999999);
gotoAndPlay ("loadAd");
Symbol 17 MovieClip Frame 31
if (_url.indexOf(http) > 0) {
mcAd.loadMovie(showAd);
}
mcCookie.doWriteCookie(showThisAd);
Symbol 17 MovieClip Frame 33
if ((mcAd.getBytesTotal() != 0) && (mcAd.getBytesLoaded() == mcAd.getBytesTotal())) {
lastAdShown = showThisAd;
doWriteCookie();
gotoAndStop ("showAd");
} else {
gotoAndPlay(_currentframe - 1);
}
Symbol 17 MovieClip Frame 41
stop();
Symbol 27 MovieClip Frame 1
stop();
Symbol 27 MovieClip Frame 100
stop();
Symbol 29 MovieClip Frame 1
stop();
Symbol 29 MovieClip Frame 12
_root.play();
_root.isFinished = true;
_parent.stop();
stop();
Symbol 33 Button
on (release) {
getURL ("http://www.miniclip.com/", "_blank");
}
Symbol 34 MovieClip Frame 2
_parent.mcAnimation.play();
stop();
Symbol 34 MovieClip Frame 13
_parent.gotoAndPlay("preload");
stop();
Symbol 48 MovieClip Frame 1
stop();
Symbol 48 MovieClip Frame 60
Symbol 48 MovieClip Frame 121
_parent.mcBackground.play();
stop();
Symbol 49 MovieClip Frame 1
_root.stop();
play();
Instance of Symbol 6 MovieClip "mcIntro" in Symbol 49 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 49 MovieClip Frame 2
xPos = _x;
yPos = _y;
mcBackground._x = mcBackground._x - xPos;
mcBackground._y = mcBackground._y - yPos;
mcAnimation._x = mcAnimation._x - xPos;
mcAnimation._y = mcAnimation._y - yPos;
var stageWidth = Stage.width;
var stageHeight = Stage.height;
var centerStageX = (stageWidth / 2);
var centerStageY = (stageHeight / 2);
mcBackground._width = stageWidth;
mcBackground._height = stageHeight;
mcAnimation._x = mcAnimation._x + centerStageX;
mcAnimation._y = mcAnimation._y + (centerStageY - (stageHeight / 10));
stop();
Instance of Symbol 29 MovieClip "mcLoadingAnimated" in Symbol 49 MovieClip Frame 2
onClipEvent (load) {
_visible = false;
}
Symbol 49 MovieClip Frame 3
var loadedPercent = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (loadedPercent == 100) {
_root.play();
stop();
} else {
mcLoadingAnimated._visible = true;
}
Symbol 49 MovieClip Frame 5
var loadedPercent = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (loadedPercent < 100) {
mcLoadingAnimated.mcLoading.gotoAndStop(loadedPercent);
mcLoadingAnimated.mcLoading.txtPercentLoaded1 = ("The game is loading (" + loadedPercent) + "%)";
mcLoadingAnimated.mcLoading.txtPercentLoaded2 = ("The game is loading (" + loadedPercent) + "%)";
gotoAndPlay(_currentframe - 1);
} else {
mcLoadingAnimated.play();
stop();
}
Symbol 54 MovieClip Frame 1
gotoAndPlay(random(20) + 2);
Symbol 54 MovieClip Frame 36
stop();
Symbol 56 Button
on (release) {
getURL ("http://www.miniclip.com", "_blank");
}
Symbol 58 MovieClip Frame 1
gotoAndPlay (2);
Symbol 58 MovieClip Frame 44
stop();
Symbol 62 MovieClip Frame 1
stop();
Symbol 62 MovieClip Frame 2
stop();
Instance of Symbol 65 MovieClip "progress" in Symbol 70 MovieClip Frame 1
onClipEvent (load) {
this._width = 1;
}
Instance of Symbol 65 MovieClip "progress" in Symbol 73 MovieClip Frame 1
onClipEvent (load) {
this._width = 1;
}
Instance of Symbol 65 MovieClip "progress" in Symbol 77 MovieClip Frame 1
onClipEvent (load) {
this._width = 1;
}
Instance of Symbol 65 MovieClip "progress" in Symbol 81 MovieClip Frame 1
onClipEvent (load) {
this._width = 1;
}
Symbol 86 MovieClip [bouncer_back] Frame 26
gotoAndPlay (3);
Symbol 90 MovieClip [bouncer_side] Frame 26
gotoAndPlay (3);
Symbol 94 MovieClip [bouncer_up] Frame 26
gotoAndPlay (3);
Symbol 100 MovieClip [dead_enemy] Frame 22
stop();
Symbol 104 MovieClip Frame 1
gotoAndPlay(random(50) + 1);
Symbol 104 MovieClip Frame 63
gotoAndPlay(random(20) + 1);
Symbol 125 MovieClip [skeleton_back] Frame 26
gotoAndPlay (3);
Symbol 127 MovieClip [skeleton_sx] Frame 26
gotoAndPlay (3);
Symbol 129 MovieClip [skeleton_top] Frame 26
gotoAndPlay (3);
Symbol 135 MovieClip Frame 1
if (_root.havebomb == 0) {
gotoAndStop (2);
} else {
stop();
}
Symbol 136 MovieClip [gigio_back] Frame 26
gotoAndPlay (2);
Symbol 139 MovieClip [gigio_right] Frame 26
gotoAndPlay (2);
Symbol 142 MovieClip Frame 1
if (_root.havebomb == 0) {
gotoAndStop (2);
} else {
stop();
}
Symbol 143 MovieClip [gigio_left] Frame 26
gotoAndPlay (2);
Symbol 147 MovieClip Frame 1
if (_root.havebomb == 0) {
gotoAndStop (2);
} else {
stop();
}
Symbol 150 MovieClip [gigio_top] Frame 26
gotoAndPlay (2);
Symbol 160 Button
on (release) {
if (keys._visible) {
keys._visible = false;
} else {
keys._visible = true;
}
}
Symbol 164 Button
on (release) {
_root.play();
}
Symbol 173 MovieClip Frame 38
if (random(5) == 2) {
gotoAndPlay ("skip");
} else if (random(3) == 1) {
} else {
gotoAndPlay ("still");
}
Symbol 173 MovieClip Frame 70
if (random(2) == 1) {
gotoAndPlay ("still");
}
Symbol 183 Button
on (release) {
play();
}
Symbol 184 Button
on (release) {
gotoAndPlay ("bg");
}
Symbol 187 MovieClip Frame 1
gotoAndPlay (2);
Symbol 187 MovieClip Frame 13
stop();
Symbol 187 MovieClip Frame 20
stop();
Symbol 188 MovieClip Frame 1
gotoAndPlay (2);
Symbol 188 MovieClip Frame 10
stop();
Symbol 188 MovieClip Frame 16
stop();
Symbol 192 Button
on (release) {
play();
}
Symbol 201 MovieClip Frame 1
if (_root.lev > 1) {
gotoAndPlay ("stillbg");
} else {
gotoAndPlay ("menu");
}
Symbol 201 MovieClip Frame 34
_root.soundFx.fMusic("title");
stop();
Symbol 201 MovieClip Frame 49
stop();
Symbol 201 MovieClip Frame 50
inBox.play();
Symbol 201 MovieClip Frame 58
gotoAndPlay ("menu2");
Symbol 201 MovieClip Frame 70
_root.play();
stop();
Symbol 206 Button
on (release) {
inBox.inPattern.play();
_root.play();
}
on (keyPress "z") {
inBox.inPattern.play();
_root.play();
}
on (keyPress "Z") {
inBox.inPattern.play();
_root.play();
}
Symbol 211 MovieClip Frame 1
playButt._visible = false;
levelInfo.text = "";
stageName.text = "";
levelName.text = "";
levelInfo._visible = false;
stageName._visible = false;
levelName._visible = false;
Symbol 211 MovieClip Frame 11
levelInfo._visible = true;
stageName._visible = true;
levelName._visible = true;
stop();
Symbol 218 MovieClip Frame 1
stop();
Symbol 218 MovieClip Frame 2
this.play();
Symbol 218 MovieClip Frame 55
_root.soundFX.yeah.play();
Symbol 218 MovieClip Frame 70
_root.score = _root.score + 10000;
_root.livello.show_score(_root.score);
Symbol 223 MovieClip Frame 1
stop();
Symbol 223 MovieClip Frame 2
this.play();
Symbol 223 MovieClip Frame 55
_root.soundFX.yeah.play();
Symbol 223 MovieClip Frame 70
_root.score = _root.score + 20000;
_root.livello.show_score(_root.score);
Symbol 228 MovieClip Frame 1
stop();
Symbol 228 MovieClip Frame 2
this.play();
Symbol 228 MovieClip Frame 55
_root.soundFX.yeah.play();
Symbol 228 MovieClip Frame 70
_root.score = _root.score + 30000;
_root.livello.show_score(_root.score);
Symbol 230 MovieClip Frame 2
inBox.stop();
Symbol 234 MovieClip Frame 1
stop();
Symbol 234 MovieClip Frame 2
stop();
Symbol 238 MovieClip Frame 1
stop();
Symbol 238 MovieClip Frame 2
stop();
Symbol 248 Button
on (release) {
_root.fQuitGame();
}
Symbol 249 MovieClip Frame 1
gotoAndPlay (2);
Symbol 249 MovieClip Frame 29
stop();
Symbol 249 MovieClip Frame 36
stop();
Symbol 254 Button
on (release) {
_root.fPauseGame();
}
Symbol 255 MovieClip Frame 1
testMode._visible = false;
arenaMode._visible = false;
classicMode._visible = false;
Symbol 255 MovieClip Frame 21
stop();
Symbol 256 MovieClip Frame 1
function showDeadEnemy(i) {
this.skull.duplicateMovieClip("dead" + i, 1 + i);
var badMov = eval ("dead" + i);
badMov._xscale = 57;
badMov._yscale = 57;
badMov._x = (_root.bad[i].px * 32) + 2;
badMov._y = (_root.bad[i].py * 32) + 6;
}
Instance of Symbol 100 MovieClip [dead_enemy] "skull" in Symbol 256 MovieClip Frame 1
/* no clip actions */
Symbol 258 MovieClip Frame 1
stop();
Symbol 259 MovieClip Frame 1
pLastDir = 0;
stop();
Symbol 260 MovieClip Frame 24
stop();
Symbol 261 MovieClip Frame 2
_root.soundFX.rebirth.play();
Symbol 261 MovieClip Frame 27
stop();
Symbol 262 MovieClip Frame 1
rebirth.stop();
stop();
Symbol 267 MovieClip Frame 27
stop();
Symbol 268 MovieClip Frame 1
stop();
Symbol 268 MovieClip Frame 2
stop();
Symbol 270 MovieClip Frame 1
stop();
Symbol 270 MovieClip Frame 2
this.play();
Symbol 270 MovieClip Frame 39
this._x = -100;
this._y = -100;
stop();
Symbol 273 MovieClip Frame 1
stop();
Symbol 273 MovieClip Frame 50
stop();
Symbol 276 MovieClip Frame 1
stop();
Symbol 276 MovieClip Frame 50
stop();
Symbol 279 MovieClip Frame 1
stop();
Symbol 279 MovieClip Frame 50
stop();
Symbol 282 MovieClip Frame 1
stop();
Symbol 282 MovieClip Frame 50
stop();
Symbol 285 MovieClip Frame 1
stop();
Symbol 285 MovieClip Frame 50
stop();
Symbol 287 MovieClip Frame 1
stop();
Symbol 287 MovieClip Frame 50
stop();
Symbol 296 MovieClip Frame 1
stop();
Symbol 296 MovieClip Frame 2
startx = _root.gigio.gx;
starty = _root.gigio.gy;
_root.SoundFX.nukeBeep.play();
Symbol 296 MovieClip Frame 52
_root.SoundFX.nukeBeep.play();
Symbol 296 MovieClip Frame 103
_root.SoundFX.nukeBeep.play();
Symbol 296 MovieClip Frame 153
_root.SoundFX.nukeBeep.play();
Symbol 296 MovieClip Frame 197
_root.SoundFX.nukeBeep.play();
Symbol 296 MovieClip Frame 203
Symbol 296 MovieClip Frame 260
_root.SoundFX.nukeExplode.play();
Symbol 296 MovieClip Frame 269
function killEveryOne() {
var _local2 = _root;
var _local1 = 0;
while (_local1 < _local2.maxbad) {
_local2.score = _local2.score + 3000;
_local2.enemies.enemyDie(_local1);
_local1++;
}
_local2.livello.show_score(_local2.score);
}
nukeRes = _root.findPath(startx + (starty * 20), _root.gigio.gx + (_root.gigio.gy * 20));
killEveryOne();
if (nukeRes != 0) {
_root.gigio.kill_gigio();
}
Symbol 296 MovieClip Frame 299
stop();
Symbol 302 Button
on (release) {
_root.fQuitGame();
}
Symbol 305 Button
on (release) {
_root.gotoAndPlay("highscore");
}
Symbol 311 MovieClip Frame 1
this._visible = false;
Symbol 326 Button
on (release) {
gameURL = ("http://www.miniclip.com/" + gamename) + ".htm";
getURL (gameURL, "_blank");
}
Instance of Symbol 311 MovieClip "mcHighscores" in Symbol 332 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 332 MovieClip Frame 2
if (_url.indexOf("miniclip.com") == -1) {
gotoAndStop(_currentframe + 1);
} else {
var noCache = (getTimer() + random(100000));
mcTarget.loadMovie("http://www.miniclip.com/swfcontent/highscore.swf?" + noCache);
stop();
}
Symbol 332 MovieClip Frame 3
stop();