Frame 1
setProperty("_root.Bar", _yscale , 0);
_level0.load = "Hunga Hatch word geladen";
Instance of Symbol 17 MovieClip "Size" in Frame 1
onClipEvent (load) {
total = int(_root.getBytesTotal());
}
onClipEvent (enterFrame) {
StatusColor = new Color(_root.Bar);
Loaded = int(_root.getBytesLoaded());
Percent = int((loaded / total) * 100);
if (percent > 20) {
_level0.load = "Als de eitjes";
StatusColor.setRGB(16777215);
}
if (percent > 40) {
_level0.load = " uitkomen";
StatusColor.setRGB(16777215);
}
if (percent > 60) {
_level0.load = "dan heb je";
StatusColor.setRGB(16777215);
}
if (percent > 80) {
_level0.load = " de poppetjes";
StatusColor.setRGB(16777215);
}
if (percent == 90) {
_level0.load = "aan het dansen";
StatusColor.setRGB(16777215);
}
_root.Percent = Percent + " %";
setProperty("_root.Bar", _yscale , Percent);
if (Percent >= 100) {
tellTarget ("_root") {
play();
};
}
}
Frame 2
stop();
Frame 219
Stage.showMenu = false;
Stage.scaleMode = "noScale";
this.stop();
preloader = this.preloader_mc;
preloader.onEnterFrame = function () {
var _local1 = this;
var _local3 = _local1._parent.getBytesTotal();
var loaded = _local1._parent.getBytesLoaded();
var _local2 = int((loaded / _local3) * 100);
_local1.bar_mc._xscale = _local2;
if (_local2 >= 100) {
delete _local1.onEnterFrame;
_local1._parent.gotoAndPlay("start");
}
};
Frame 228
this.stop();
_global.range = function (t, a, b) {
var _local1 = new Array(t, a, b);
return(_local1);
};
_global.roll = function () {
var _local3;
var _local2 = random(300);
var _local1 = levelControl[player.level - 1];
if ((_local1[2][1] <= _local2) and (_local2 <= _local1[2][2])) {
_local3 = _local1[2][0];
} else if ((_local1[3][1] <= _local2) and (_local2 <= _local1[3][2])) {
_local3 = _local1[3][0];
} else if ((_local1[4][1] <= _local2) and (_local2 <= _local1[4][2])) {
_local3 = _local1[4][0];
} else if ((_local1[5][1] <= _local2) and (_local2 <= _local1[5][2])) {
_local3 = _local1[5][0];
} else if ((_local1[6][1] <= _local2) and (_local2 <= _local1[6][2])) {
_local3 = _local1[6][0];
}
return(_local3);
};
_global.xcube = 10;
_global.ycube = 13;
_global.cubeCount = 0;
_global.gameplay = false;
_global.allowClick = false;
_global.master = this;
_global.cubes = this.cubes_mc;
cubes.cube_mc._visible = false;
_global.player = this.player_mc;
_global.timer = this.timer_mc;
_global.msg = this.msg_mc;
_global.bonus = this.createEmptyMovieClip("bonus_mc", 4000);
_global.line = new Array();
_global.list = new Array();
_global.levelScore = new Array(3, 5, 7, 11, 13, 17, 24, 31, 39, 48, 52, 55, 60, 65, 70, 78, 86, 96, 100, 130, 145, 155, 160, 175, 200);
_global.levelControl = new Array();
levelControl.push(new Array(5, 250, range("bottle", 0, 99), range("can", 100, 199), range("cap", 200, 299), range("mug", 300, 300), range("bomb", 300, 300)));
levelControl.push(new Array(10, 250, range("bottle", 0, 99), range("can", 100, 199), range("cap", 200, 299), range("mug", 300, 300), range("bomb", 300, 300)));
levelControl.push(new Array(15, 250, range("bottle", 0, 97), range("can", 98, 194), range("cap", 195, 289), range("mug", 300, 300), range("bomb", 290, 299)));
levelControl.push(new Array(20, 250, range("bottle", 0, 70), range("can", 71, 141), range("cap", 142, 212), range("mug", 213, 283), range("bomb", 284, 299)));
levelControl.push(new Array(25, 250, range("bottle", 0, 68), range("can", 69, 138), range("cap", 139, 208), range("mug", 209, 279), range("bomb", 280, 299)));
levelControl.push(new Array(30, 220, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array(35, 220, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array(40, 220, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array(45, 200, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array(50, 200, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array(55, 200, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array(60, 170, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array(65, 170, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array(70, 170, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array(75, 170, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array(80, 130, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array(85, 130, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array(85, 130, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array(85, 110, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array(90, 110, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array(90, 110, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array(95, 50, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array(100, 50, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array(150, 40, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
levelControl.push(new Array("unlimited", 40, range("bottle", 0, 67), range("can", 68, 136), range("cap", 137, 206), range("mug", 207, 275), range("bomb", 276, 299)));
function hideFocus() {
for (n in list) {
list[n].focus_mc._visible = false;
}
list = new Array();
}
this.createCubes = function (x, y) {
cubes._visible = false;
for (var n in cubes) {
removeMovieClip(cubes[n]);
}
var _local3 = 0;
while (_local3 < x) {
var tmp = new Array();
var _local2 = 0;
while (_local2 < y) {
cubeCount = cubeCount + 1;
var _local1 = cubes.cube_mc.duplicateMovieClip("cube_" add cubeCount, cubeCount);
_local1._x = _local3 * 40;
_local1._y = ((ycube - 1) - _local2) * 40;
_local1.x = _local3;
_local1.y = _local2;
_local1.focus_mc._visible = false;
_local1.c = roll();
_local1.gotoAndStop(_local1.c);
tmp.push(_local1);
_local2++;
}
line[_local3] = tmp;
_local3++;
}
};
this.kill = function () {
var _local2 = this;
if (list.length > 2) {
timer.pause();
if (list[0].c == "bomb") {
snd.play("bomb");
player.score = player.score + 50;
cubeCount = cubeCount + 1;
var _local3 = cubes.attachMovie("boom", "boom" add cubeCount, cubeCount);
_local3._x = list[0]._x + 20;
_local3._y = list[0]._y + 20;
} else {
snd.play("3ormore2");
player.score = player.score + (levelScore[player.level - 1] * ((Math.pow(list.length, 2) - list.length) / 2));
trace(levelScore[player.level - 1] * ((Math.pow(list.length, 2) - list.length) / 2));
}
for (n in list) {
var _local1 = list[n];
line[_local1.x].splice(_local1.y, 1);
_local2.collapseY(_local1.x);
removeMovieClip(_local1);
}
list = new Array();
_local2.joinCol();
timer.start();
}
};
this.collapseX = function (x) {
var _local2 = x;
var _local1 = 0;
while (_local1 <= line[_local2].length) {
var _local3 = line[_local2][_local1];
_local3.x = _local2;
_local3._x = _local2 * 40;
_local1++;
}
return(line[_local2].length);
};
this.collapseY = function (x) {
var _local3 = x;
var _local1 = 0;
while (_local1 <= line[_local3].length) {
var _local2 = line[_local3][_local1];
_local2.y = _local1;
_local2._y = ((ycube - 1) - _local1) * 40;
_local1++;
}
return(line[_local3].length);
};
this.joinCol = function () {
var _local1 = 1;
while (_local1 <= int(xcube / 2)) {
if (line[_local1].length <= 0) {
line.splice(_local1, 1);
line.unshift(new Array());
}
_local1++;
}
_local1 = xcube - 1;
while (_local1 > int(xcube / 2)) {
if (line[_local1].length <= 0) {
line.splice(_local1, 1);
line.push(new Array());
}
_local1--;
}
var _local3 = true;
var _local2 = 0;
while (_local2 < xcube) {
if (line[_local2].length >= ycube) {
_local3 = false;
}
this.collapseX(_local2);
_local2++;
}
gameplay = _local3;
};
this.addList = function (obj) {
obj.focus_mc._visible = true;
list.push(obj);
};
this.isBomb = function (obj) {
var _local1 = obj;
var _local2 = this;
_local2.addList(line[_local1.x - 1][_local1.y + 1]);
_local2.addList(line[_local1.x][_local1.y + 1]);
_local2.addList(line[_local1.x + 1][_local1.y + 1]);
_local2.addList(line[_local1.x - 1][_local1.y]);
_local2.addList(line[_local1.x + 1][_local1.y]);
_local2.addList(line[_local1.x - 1][_local1.y - 1]);
_local2.addList(line[_local1.x][_local1.y - 1]);
_local2.addList(line[_local1.x + 1][_local1.y - 1]);
};
this.setFocus = function (obj) {
var _local1 = obj;
var _local2 = this;
if (allowClick) {
_local2.addList(_local1);
if (_local1.c == "bomb") {
_local2.isBomb(_local1);
}
var right = line[_local1.x + 1][_local1.y];
if (right.c == _local1.c) {
if (!right.focus_mc._visible) {
_local2.setFocus(right);
}
}
var left = line[_local1.x - 1][_local1.y];
if (left.c == _local1.c) {
if (!left.focus_mc._visible) {
_local2.setFocus(left);
}
}
var up = line[_local1.x][_local1.y + 1];
if (up.c == _local1.c) {
if (!up.focus_mc._visible) {
_local2.setFocus(up);
}
}
var _local3 = line[_local1.x][_local1.y - 1];
if (_local3.c == _local1.c) {
if (!_local3.focus_mc._visible) {
_local2.setFocus(_local3);
}
}
}
};
this.addNew = function () {
var pass = true;
var _local2 = 0;
while (_local2 < line.length) {
cubeCount = cubeCount + 1;
var _local1 = cubes.cube_mc.duplicateMovieClip("cube_" add cubeCount, cubeCount);
_local1._x = _local2 * 40;
_local1._y = ((ycube - 1) - j) * 40;
_local1.x = _local2;
_local1.focus_mc._visible = false;
_local1.c = roll();
_local1.gotoAndStop(_local1.c);
line[_local2].unshift(_local1);
var _local3 = this.collapseY(_local2);
if (_local3 >= ycube) {
pass = false;
}
_local2++;
}
gameplay = pass;
};
this.newGame = function () {
var _local1 = this;
highscore.removeMovieClip();
if (_local1.Bonus != undefined) {
clearInterval(_local1.Bonus.id);
delete _local1.Bonus;
}
player.score = 0;
player.level = 1;
player.lineLeft = levelControl[0][0];
master.createCubes(xcube, 4);
msg._visible = true;
msg.gotoAndPlay("getready");
};
this.start = function () {
cubes._visible = true;
msg._visible = false;
gameplay = true;
allowClick = true;
timer.start(levelControl[player.level - 1][1]);
};
this.gameover = function () {
var _local1 = this;
var _local2 = _root;
gameplay = false;
allowClick = false;
timer.pause();
master.hideFocus();
msg._visible = true;
msg.gotoAndPlay("gameover");
_local2.score = player.score;
System.security.allowDomain("http://www.totallygame.com/");
_local1.createEmptyMovieClip("highscore", _local1.getNextHighestDepth());
_local2.thisgamefile = "highscore_hungahatch.php";
_local2.thisgameid = "4";
_local2.loadmovie = true;
highscore.loadMovie("http://www.totallygame.com/swf/highscore.swf");
_local1.highscore._x = 100;
_local1.highscore._y = 370;
};
this.levelUp = function () {
msg._visible = true;
snd.play("nextlevel");
msg.gotoAndPlay("complete");
timer.pause();
allowClick = false;
master.hideFocus();
bonus.chkBonus();
};
this.nextlevel = function () {
if (player.level == maxLevel) {
master.gameover();
} else {
player.lineLeft = levelControl[player.level][0];
player.level = player.level + 1;
master.createCubes(xcube, Math.min(3 + player.level, 7));
msg._visible = true;
msg.gotoAndPlay("getready");
}
};
bonus.chkBonus = function () {
var _local1 = this;
delete _local1.onEnterFrame;
_local1.numcubes = 0;
_local1.finish = false;
_local1.x = 0;
_local1.y = ycube - 1;
_local1.onEnterFrame = _local1.checkingBonus;
};
bonus.checkingBonus = function () {
var _local1 = this;
if (_local1.finish) {
delete _local1.onEnterFrame;
master.nextlevel();
} else {
cubeCount = cubeCount + 1;
newObj = cubes.attachMovie("focus_mc", "f_" add cubeCount, cubeCount);
newObj._x = _local1.x * 40;
newObj._y = ((ycube - 1) - _local1.y) * 40;
if (line[_local1.x][_local1.y] == undefined) {
newObj.gotoAndStop(1);
} else {
newObj.gotoAndStop(2);
_local1.numcubes = _local1.numcubes + 1;
}
if ((_local1.x % 2) == 0) {
snd.play("3ormore");
}
_local1.x = _local1.x + 1;
if (_local1.x >= xcube) {
if (_local1.numcubes == 0) {
player.score = player.score + 100;
cubeCount = cubeCount + 1;
bb = cubes.attachMovie("bonus_100", "b_" add cubeCount, cubeCount);
bb._x = _local1.x * 40;
bb._y = ((ycube - 1) - _local1.y) * 40;
trace(100);
} else {
player.score = player.score + (xcube - _local1.numcubes);
trace(xcube - _local1.numcubes);
}
_local1.x = 0;
_local1.numcubes = 0;
_local1.y = _local1.y - 1;
if (_local1.y < 0) {
_local1.finish = true;
}
}
}
};
timer.start = function (n) {
var _local1 = this;
delete _local1.onEnterFrame;
if (n != null) {
_local1.time = getTimer();
_local1.timer = n;
_local1.counter = -1;
_local1.onEnterFrame = _local1.counting;
} else {
_local1.time = getTimer();
_local1.onEnterFrame = _local1.counting;
}
};
timer.counting = function () {
var _local1 = this;
if ((getTimer() - _local1.time) >= _local1.timer) {
_local1.counter = _local1.counter + 1;
_local1.gotoAndStop(_local1.counter + 1);
updateAfterEvent();
if (_local1.counter > _local1._totalframes) {
_local1.counter = -1;
if (gameplay) {
if ((player.lineLeft - 1) < 0) {
master.levelUp();
} else {
_local1.pause();
master.addNew();
_local1.start();
if (typeof(player.lineLeft) == "number") {
player.lineLeft = player.lineLeft - 1;
snd.play("newrow");
}
}
} else {
master.gameover();
}
}
if ((_local1.counter > 0) && (_local1.counter < _local1._totalframes)) {
snd.play("timer");
}
_local1.time = getTimer();
}
};
timer.pause = function () {
delete this.onEnterFrame;
};
_global.snd = new Object();
snd.play = function (n) {
var _local1 = n;
var _local2 = this;
if (_local2[_local1] == undefined) {
_local2[_local1] = new Sound(_root);
_local2[_local1].attachSound(_local1);
}
_local2[_local1].start();
};
Symbol 4 MovieClip [bonus_100] Frame 20
removeMovieClip(this);
Symbol 7 MovieClip [boom] Frame 5
removeMovieClip(this);
Symbol 63 Button
on (press) {
getURL ("http://www.totallygame.com", "_blank");
}
Symbol 85 Button
on (press) {
getURL ("http://www.totallygame.com", "_blank");
}
Symbol 98 Button
on (press) {
master.kill();
}
on (rollOver) {
master.setFocus(this);
}
on (rollOut, releaseOutside) {
master.hideFocus();
}
Symbol 101 MovieClip [focus_mc] Frame 1
this.stop();
Symbol 122 MovieClip Frame 50
stop();
Symbol 125 MovieClip Frame 1
this.stop();
Symbol 133 Button
on (release) {
master.newGame();
}
Symbol 183 Button
on (release) {
master.newGame();
}
Symbol 184 MovieClip Frame 1
this.stop();
Symbol 184 MovieClip Frame 25
this.stop();
Symbol 184 MovieClip Frame 66
this.gotoAndStop(1);
master.start();
Symbol 184 MovieClip Frame 95
this.stop();