Combined Code
movieClip 19 part_star {
frame 1 {
speed = 5 + random(5);
timer = 10 + random(15);
rot = choose(2, -2);
dir = random(360);
onEnterFrame = function () {
_rotation = _rotation + rot;
if (speed > 2) {
_x = _x + lengthdir_x(speed, dir);
_y = _y + lengthdir_y(speed, dir);
speed -= 1;
}
if (timer > 0) {
--timer;
if (timer < 10) {
_alpha = _alpha - 10;
}
} else {
this.removeMovieClip();
}
};
}
}
movieClip 54 part_explo {
frame 1 {
gotoAndPlay(2 + random(5));
}
frame 23 {
this.removeMovieClip();
}
}
movieClip 56 part_comb {
frame 1 {
dir = random(360);
timer = 15;
_rotation = random(360);
onEnterFrame = function () {
_rotation = _rotation + 10;
if (timer > 0) {
--timer;
if (timer < 10) {
_alpha = _alpha - 10;
}
} else {
this.removeMovieClip();
}
};
}
}
movieClip 59 part_bee {
frame 1 {
if (_root.player.left == true) {
hspeed = random(5) + 4;
} else {
hspeed = random(-5) - 4;
}
vspeed = -5;
rot = choose(20, -20);
onEnterFrame = function () {
_rotation = _rotation + rot;
_y = _y + vspeed;
vspeed += 1;
_x = _x + hspeed;
hspeed /= 1.1;
if (_y > 500) {
this.removeMovieClip();
}
};
}
}
movieClip 61 {
}
movieClip 67 {
frame 1 {
stop();
}
}
movieClip 69 {
}
movieClip 74 {
frame 1 {
stop();
}
}
movieClip 75 linepart {
frame 1 {
stop();
img2._xscale = (100 / _xscale) * 100;
timer = 0;
onEnterFrame = function () {
if (timer > 0) {
_alpha = _alpha - 10;
_yscale = _yscale - 10;
--timer;
} else {}
};
}
}
movieClip 78 part_fill {
frame 15 {
this.removeMovieClip();
}
}
movieClip 103 {
}
movieClip 104 {
}
movieClip 105 starobj {
frame 1 {
stop();
}
frame 2 {
img.stop();
}
}
// unknown tag 88 length 14
movieClip 108 {
}
movieClip 109 scoreobj {
frame 35 {
this.removeMovieClip();
}
}
button 111 {
on (press) {
if (_root.editor == false) {
_root.startDraw();
}
}
}
movieClip 115 {
}
movieClip 116 pointobj {
frame 1 {
stop();
}
}
movieClip 117 lineobj {
frame 1 {
stop();
i = 1;
while (i < 6) {
xx = img['d' + i]._x * _xscale / 100;
yy = img['d' + i]._y * _yscale / 100;
this['xd' + i] = _x + lengthdir_x(xx, -_rotation) - lengthdir_y(yy, -_rotation);
this['yd' + i] = _y + lengthdir_y(xx, -_rotation) + lengthdir_x(yy, -_rotation);
++i;
}
if (img2.star != undefined) {
xx = img2.star._x * _xscale / 100;
yy = img2.star._y * _yscale / 100;
xstar = _x + lengthdir_x(xx, -_rotation) - lengthdir_y(yy, -_rotation);
ystar = _y + lengthdir_y(xx, -_rotation) + lengthdir_x(yy, -_rotation);
_root.createNamedPart(xstar, ystar, 'starobj', _name + 's');
onEnterFrame = function () {
if (_root.isdraw == true) {
if (img2.star._visible == true) {
dist = point_distance(xstar, ystar, _root.player._x, _root.player._y);
if (dist < 15) {
img2.star._visible = false;
++_root.gemHave;
addStat(2, 1);
_root.createPart(xstar, ystar, 'part_star', 8);
_root.createScore(xstar, ystar, _root.starscore);
_root.partmap[_name + 's'].removeMovieClip();
playSound('star1', 'star2');
}
}
}
};
}
img2._xscale = (100 / _xscale) * 100;
}
}
movieClip 119 {
}
movieClip 120 cursorobj {
}
movieClip 139 {
}
movieClip 164 beeobj {
frame 1 {
_alpha = 0;
timer = 0;
left = true;
curleft = true;
onEnterFrame = function () {
if (_alpha != 100) {
if (_alpha < 100) {
_alpha = _alpha + 20;
} else {
_alpha = 100;
}
}
if (timer == 0) {
timer = 30 + random(60);
flyx = 10 + random(620);
flyy = 10 + random(460);
dir = -1 * point_direction(_x, _y, flyx, flyy);
if (dir < 90 & dir > -90) {
left = false;
} else {
left = true;
}
if (curleft != left) {
play();
}
} else {
--timer;
dist = point_distance(_x, _y, flyx, flyy);
if (dist > 5) {
flydist = Math.min(dist, dist / 30);
_x = _x + lengthdir_x(flydist, dir);
_y = _y + lengthdir_y(flydist, dir);
}
}
};
onPress = function () {
obj = _root.partmap.attachMovie('part_bee', 'part', _root.partmap.getNextHighestDepth());
obj._x = _x;
obj._y = _y;
++_root.beeDone;
this.removeMovieClip();
};
gotoAndPlay(2);
}
frame 4 {
if (left == true) {
stop();
curleft = true;
}
}
frame 10 {
if (left == false) {
stop();
curleft = false;
}
}
frame 18 {
gotoAndPlay(2);
}
}
movieClip 167 {
}
movieClip 170 portalpart {
}
frame 1 {
function goTo() {
getURL(_global.sponsorurl, '_blank');
}
function goTo2() {
getURL(_global.sponsorachi, '_blank');
}
function goTo3() {
getURL(_global.walkurl, '_blank');
}
function goTo4() {
getURL(_global.devurl, '_blank');
}
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = '__mochibot__';
mbc = 'mochibot.com';
g = _global ? _global : _level0._root;
if (g[mb + swfid]) {
return g[mb + swfid];
}
s = System.security;
x = mc._root.getSWFVersion;
fv = x ? mc.getSWFVersion() : (_global ? 6 : 5);
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == 'localWithFile') {
return null;
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = (fv == 5) ? /:$version : System.capabilities.version;
u = 'http://' + mbc + '/my/core.swf?mv=8&fv=' + fv + '&v=' + escape(pv) + '&swfid=' + escape(swfid) + '&l=' + lv + '&f=' + mc + (sb ? '&sb=' + sb : '') + (trk ? '&t=1' : '');
lv = fv > 6 ? mc.getNextHighestDepth() : (g[mb + 'level'] ? g[mb + 'level'] + 1 : lv);
g[mb + 'level'] = lv;
if (fv == 5) {
res = '_level' + lv;
if (!eval(res)) {
loadMovieNum(u, lv);
}
return res;
}
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
return res;
}
_global.sponsorurl = 'http://www.MoFunZone.com/';
_global.walkurl = 'http://www.mofunzone.com/game_cheats/pc_cheats/bee_way_walkthrough.shtml';
_global.devurl = 'http://www.silengames.com';
_global.morepuzzlegames = 'http://www.mofunzone.com/online_puzzles_games.shtml';
_global.sponsorachi = 'http://www.mofunzone.com/online_games/bee_way.shtml';
stop();
var newMenu = new ContextMenu();
newMenu.hideBuiltInItems();
newMenu.customItems.push(new ContextMenuItem('Play More Games', goTo));
newMenu.customItems.push(new ContextMenuItem('Get Achievements', goTo2));
newMenu.customItems.push(new ContextMenuItem('Video Walkthrough', goTo3));
newMenu.customItems.push(new ContextMenuItem('Developer Site', goTo4));
this.menu = newMenu;
_global.lengthdir_x = function (len, dir) {
return Math.cos(dir * Math.PI / 180) * len;
};
_global.lengthdir_y = function (len, dir) {
return -Math.sin(dir * Math.PI / 180) * len;
};
_global.point_distance = function (x1, y1, x2, y2) {
return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
};
_global.point_direction = function (x1, y1, x2, y2) {
return (Math.atan2(y2 - y1, x2 - x1) / Math.PI) * 180;
};
_global.choose = function () {
return arguments[random(arguments.length)];
};
urlStart = _url.indexOf('://') + 3;
urlEnd = _url.indexOf('/', urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf('.') - 1;
domEnd = domain.lastIndexOf('.', LastDot) + 1;
domain = domain.substring(domEnd, domain.length);
if (domain == 'kongregate.com') {
kongregate.services.connect();
kongapi = true;
}
kongsend = function (kng1, kng2) {
trace(kng1 + '=' + kng2);
kongregate.stats.submit(kng1, kng2);
};
__com_mochibot__('51fc13c5', this, 10301, true);
}
movieClip 172 {
}
movieClip 174 {
}
movieClip 176 {
}
movieClip 178 {
}
movieClip 179 {
}
movieClip 181 {
}
movieClip 183 {
}
movieClip 185 {
}
movieClip 187 {
}
movieClip 189 {
}
movieClip 191 {
}
movieClip 192 {
}
movieClip 193 {
}
movieClip 195 {
}
movieClip 196 {
frame 11 {
_parent.gotoAndStop(2);
}
}
movieClip 197 {
}
movieClip 199 {
}
movieClip 202 {
}
movieClip 204 {
}
movieClip 205 {
}
movieClip 206 {
frame 1 {
this.onEnterFrame = function () {
bytesloaded = Math.round(_root.getBytesLoaded());
bytestotal = Math.round(_root.getBytesTotal());
percent = bytesloaded / bytestotal;
barmask._xscale = percent * 100;
};
}
}
movieClip 208 {
}
movieClip 213 {
}
// unknown tag 88 length 63
movieClip 233 {
}
movieClip 238 {
frame 1 {
if (Math.random() > 0.5) {
_xscale = -_xscale;
_x = _x - _parent.shiftamt;
}
}
frame 90 {
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
}
}
movieClip 246 {
}
movieClip 248 {
}
movieClip 249 {
frame 1 {
if (Math.random() > 0.5) {
_xscale = -_xscale;
_x = _x - _parent.shiftamt;
}
}
frame 90 {
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
}
}
movieClip 256 {
}
movieClip 257 {
frame 1 {
if (Math.random() > 0.5) {
_xscale = -_xscale;
_x = _x - _parent.shiftamt;
}
}
frame 90 {
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
}
}
movieClip 264 {
}
movieClip 265 {
frame 1 {
if (Math.random() > 0.5) {
_xscale = -_xscale;
_x = _x - _parent.shiftamt;
}
}
frame 90 {
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
}
}
movieClip 272 {
}
movieClip 273 {
frame 1 {
if (Math.random() > 0.5) {
_xscale = -_xscale;
_x = _x - _parent.shiftamt;
}
}
frame 90 {
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
}
}
movieClip 280 {
}
movieClip 281 {
frame 1 {
if (Math.random() > 0.5) {
_xscale = -_xscale;
_x = _x - _parent.shiftamt;
}
}
frame 90 {
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
}
}
movieClip 288 {
}
movieClip 289 {
frame 1 {
if (Math.random() > 0.5) {
_xscale = -_xscale;
_x = _x - _parent.shiftamt;
}
}
frame 90 {
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.nextFrame();
} else {
_parent.gotoAndStop(thenextframe);
}
}
}
}
movieClip 296 {
}
movieClip 297 {
frame 1 {
if (Math.random() > 0.5) {
_xscale = -_xscale;
_x = _x - _parent.shiftamt;
}
}
frame 90 {
if (_parent.isloaded) {
_parent.gotoAndStop(10);
} else {
thenextframe = Math.ceil(Math.random() * 8) + 1;
if (thenextframe == _parent._currentframe) {
_parent.gotoAndStop(2);
} else {
_parent.gotoAndStop(thenextframe);
}
}
}
}
movieClip 298 {
}
movieClip 303 {
}
movieClip 304 {
frame 133 {
_root.play();
}
}
movieClip 305 {
frame 1 {
stop();
_root.stop();
shiftamt = 17;
isloaded = false;
this.onEnterFrame = function () {
bytesloaded = Math.round(_root.getBytesLoaded());
bytestotal = Math.round(_root.getBytesTotal());
percent = bytesloaded / bytestotal;
if (bytesloaded == bytestotal) {
isloaded = true;
}
};
this.onRelease = function () {
getURL('http://www.mofunzone.com/', '_blank');
};
}
}
frame 2 {
gotoAndStop(3);
}
frame 3 {
maps = new Array();
maps[0] = '';
maps[1] = '0303050811080803080311080102110805080102050808030102';
maps[2] = '04050802081004061206080212060103120608100101081004060101040612060202040608020103';
maps[3] = '07080806050305090206110311091406020605030103050308060101080611030101110314060103140611090103110908060101080605090101050902060103';
maps[4] = '07081306110311090509050308060306050308060202110308060202050311030402030605030401050903060401110313060401130611090401110905090402';
maps[5] = '081006060803080913041308030803041006060608030404060608090201080910060201130413080404100613040201100613080101060603040201060603080101030803040404080310060404';
maps[6] = '07080810080204041204040812080806040408020404120412080402120808100404081004080404040804040402080608020402080608100402080212040404';
maps[7] = '0609080213090309110505050810030905050401050508020401080211050401110513090401110505050304130908100401081003090401110508100103081005050103';
maps[8] = '07090806040612060609100906031003080612060201080604060201080610030201080610090201060908060201060904060402060310030402120610090402060308060201';
maps[9] = '081006050609080710051009080203071307060508020403080210050403100513070401130710090401060903070401030706050401080706050201080710090204080710050201060908070204';
maps[10] = '10110302031013021310050405081104110808020805031013100201050811080203130213100404031003020404050805040402050408050201080511040201080508020201080213020401030208020401110411080402';
maps[11] = '10121406020606100602100610021010060608080804020606020501060208040201080410060404100608080404080806100201061002060501100208040201080810100201060608040404080806060404140610100501100214060501';
maps[12] = '1216140608020810060410041202121004100402020610080608040208020403080212020403120214060405140612100405121008100403081004100403041002060405020604020405020606080201060808100301100808100301100814060201140610040201100408020301080206040301060402060201';
maps[13] = '07100802080508101203040303081308080208050102080508100302040308020403080212030403120308050202080504030202130808100403081003080403080503080403130808050403';
maps[14] = '1216080406060808100606020404100212041208101006100408080410020201100212040105120410060201100612080201120810100105101008080201080806100201061004080105040806060201060604040201040406020105060208040201080410060301100608080301080806060201060608040301';
maps[15] = '10150802081006061006150601060309030313091303010606060202060610060102100615060202150613090301150613030301010603090301010603030301030306060404100613030404130910060404060603090404060608100201081010060201100608020201060608020201';
maps[16] = '081308100802040612061202040204101210120608100603081004060603080212020401120212060401120612100401121008100401081004100401041004060401040604020401040208020401040612060602040608020603080212060603';
maps[17] = '0912060510050808111013071002060203070510060510050402100508080401080806050401030706050401111008080501100210050404051003070506060210020402060506020404080805100501130711100506100513070401';
maps[18] = '111508100802130203020807140602060504110413100310080702060201020605040301050408070303020603020401130214060401080711040303110414060301080714060201030208020203080213020203031002060401140613100401031008100404081013100404081008070101';
maps[19] = '0915081005080504110411081406080202060807050411040302080211040404110414060403050408020404140611080403081005080404110808100404050802060403020605040403050808070201080711080201110408070201050408070201050805040401110411080401';
maps[20] = '141806020610101010020408120412081504150801040108040408040808010401080504150815040504150812080501120415040501010404040501040801080501060210020403101006100403120810100401061004080401040406020401100212040401040408040201080812080201080404080402080812040402120812040201040804040201';
maps[21] = '1220081008021008060410040608040612061202121004020410040606080301060808100301081010080301100812060301120610040301100408020301080206040301060404060301121012060302120612020302120208020302080204020302040204060302040604100302041008100302081012100302060406080303100406040303100810040303060810080303';
maps[22] = '111608100802121004100108080510070607050411041508041001080401100712100401060708050501080510070501050408020407050408050201110408050201080211040407150811040402150812100401050401080402041006070401081006070401100708100401060705040301100711040301';
maps[23] = '0610121004100807040412040802080712100201080704100201041004040404040408020404080212040404120412100404120408070404121004100402080704040404120404040203';
maps[24] = '1520080604060604040208021004120212061008081012100410060815060106100408060301080610080301080606040301060808060301040606040104060408020201080210040201100412060104120610080104100808100201081006080201060804060104120215060404150612100404041001060404010604020404040206040401100412020401060804100401121010080401';
maps[25] = '081608080804130213100310030205061106031005060301031008080301131008080301131011060301110613020301080413020301080403020301050603020301031003020403130213100403131003100403030213020403110608040202080405060202050608080202080811060202';
maps[26] = '0914080611041108050805040302130203101310050411040401110411080407080611040201080605040201050808060201080611080201110805080401050805040407030213020401050403020305110813100305131003100401130211040305031005080305';
maps[27] = '0914140408040204050711070810080705021102081005070405050702040405140411070405110708100405050708040405080411070405050708070201080711070201081008070201080708040201080411020401110214040401020405020401050208040401';
maps[28] = '1218060408021004060810080204020804061408140412060810060408020201100408020201100808100201081006080201060802080407020406040407100414040407140810080407140412060201120614080201020804060201040602040201120610040201100812060201060804060201040606040201100406040403060810080403';
maps[29] = '081311020806050202061306050611100510050208060401110213060405130611100405111005100402080613060302050211020402020605020405051002060405020605060301050608060301051005060201050605020201080605100401';
maps[30] = '1220110208100804050211070507140502051210010804101508080405020202080411020202050211020403081008040302080411070302110708100403020505020407110214050407140511070502081005070403110712100301050704100301041001080403150812100403050708040302150811070203050701080203050702050502050705020303110211070303';
maps[31] = '1217080408070505050811031106140702040207140406021009020405050201050508040201080411030207110314040206140414070404140711060201110608070201080705080207050802070206020702040404060208040201050506020405100908070201110610090405050805050201080708040201110611030201';
maps[32] = '081408021210041008071507010712040404150712100401041001070401010704040407040412040301120415070407080712100301120408070601040408020407080212040407041004040401080704040301120412100401121004100401041008070601';
maps[33] = '1518081008020106040615061206020302091403140906041004060810080806010604060202150612060202020304060403040602090403120614030403140912060403020308020403080214030403140908100403081002090403040608060302080612060302080606040301060410040302100408060301080606080301060810080302100808060301';
maps[34] = '172206080604080610081004040612060802121004021202041008101404140802040208040208020403040206040301100812100301120610040301100408060301080606040301040606080301060808100201060808060301100808060301100408020201041006080301100412020301120612020201041004060201120614040301120614080301040602040301040602080301020802040403140414080403121008100403';
maps[35] = '172608100410121006080806040610081206140802080204040206040802100412021404041006080301100812100301020804060306040606080301080610080304100812060301120614080306120614040301140412020304100412020301100408020301080206040301060404020301040202040304020404060301080610040304040208020303080212020303100808100304081006080304120610040301060404060301020804100305121014080305080606080304080606040304';
gotoAndStop(4);
}
movieClip 310 {
}
movieClip 312 {
}
movieClip 314 {
}
movieClip 316 {
}
movieClip 318 {
}
movieClip 319 {
frame 115 {
_root.gotoAndStop('init');
}
}
frame 5 {
back.gotoAndStop(1);
combscore = 1000;
tunnelscore = 750;
starscore = 500;
questscore = 2500;
lvlcount = 35;
gachi = new Array();
gachitxt = new Array();
newachi = new Array();
setGachi = function () {
gachi[0] = [12, 50, 150, 300, 500, 700];
gachitxt[0] = ['Fill', 'Cells'];
gachi[1] = [20, 80, 250, 500, 750, 1000];
gachitxt[1] = ['Close', 'Tunnels'];
gachi[2] = [3, 40, 100, 200, 300, 450];
gachitxt[2] = ['Collect', 'Stars'];
gachi[3] = [10, 25, 50, 100, 150, 200];
gachitxt[3] = ['Fly More Than', 'Meters'];
gachi[4] = [3, 2, 1];
gachitxt[4] = ['Finish any level in', 'Seconds'];
gachi[5] = [25000, 100000, 250000, 500000, 750000, 1000000, 1250000];
gachitxt[5] = ['Earn', 'Points'];
gachi[6] = [5, 10, 15, 20, 25, 30, 35];
gachitxt[6] = ['Complete', 'Level'];
gachi[7] = [3, 20, 60, 90, 120, 150, 175];
gachitxt[7] = ['Get', 'Awards'];
gachi[8] = [2, 4, 6, 8, 10, 12];
gachitxt[8] = ['Finish', 'Levels Without Replay'];
gachi[9] = [10, 20, 40];
gachitxt[9] = ['Play', 'Minutes'];
gachi[10] = [10, 50, 120];
gachitxt[10] = ['Use', 'Bees'];
};
setGachi();
atxt = new Array();
atxt2 = new Array();
i = 0;
while (i < gachi.length) {
atxt[i] = new Array();
atxt2[i] = new Array();
j = 0;
while (j < gachi[i].length) {
atxt[i][j] = gachitxt[i][0] + '\n' + gachi[i][j] + '\n' + gachitxt[i][1];
atxt2[i][j] = gachitxt[i][0] + ' ' + gachi[i][j] + ' ' + gachitxt[i][1];
++j;
}
++i;
}
var my_so = SharedObject.getLocal('bee-way-s', '/');
lvlmedal = new Array();
lvlrec = new Array();
stat = new Array();
i = 0;
while (i < gachi.length) {
stat[i] = 0;
++i;
}
newGameInit = function () {
my_so.data.lvlmedal = new Array();
my_so.data.lvlrec = new Array();
i = 1;
while (i <= lvlcount) {
my_so.data.lvlmedal[i] = [undefined, 0, 0, 0, 0];
my_so.data.lvlrec[i] = 0;
++i;
}
my_so.data.lvlmedal[1][0] = 0;
my_so.data.lvlmedal[2][0] = 0;
my_so.data.sound = true;
my_so.data.music = true;
my_so.data.stat = new Array();
my_so.data.gachi = new Array();
i = 0;
while (i < gachi.length) {
my_so.data.gachi[i] = new Array();
j = 0;
while (j < gachi[i].length) {
my_so.data.gachi[i][j] = gachi[i][j];
++j;
}
my_so.data.stat[i] = 0;
++i;
}
my_so.data.stat[4] = 99;
norestart = true;
norestartcount = 0;
};
loadStat = function () {
sound = my_so.data.sound;
music = my_so.data.music;
totalscore = 0;
i = 1;
while (i <= lvlcount) {
lvlmedal[i] = new Array();
lvlrec[i] = new Array();
j = 0;
while (j < 5) {
lvlmedal[i][j] = my_so.data.lvlmedal[i][j];
++j;
}
lvlrec[i] = my_so.data.lvlrec[i];
totalscore += lvlrec[i];
if (lvlmedal[i][0] == undefined) {
if (unlocklevels == true) {
lvlmedal[i][0] = 0;
}
}
++i;
}
i = 0;
while (i < gachi.length) {
j = 0;
while (j < gachi[i].length) {
if (my_so.data.gachi[i][j] != undefined) {
gachi[i][j] = my_so.data.gachi[i][j];
} else {
break;
}
++j;
}
stat[i] = my_so.data.stat[i];
++i;
}
totaltime = stat[9] + ':00';
};
_global.saveStat = function () {
trace('SAVE STAT...');
i = 1;
while (i <= lvlcount) {
j = 0;
while (j < 5) {
my_so.data.lvlmedal[i][j] = lvlmedal[i][j];
++j;
}
my_so.data.lvlrec[i] = lvlrec[i];
++i;
}
i = 0;
while (i < gachi.length) {
j = 0;
while (j < gachi[i].length) {
my_so.data.gachi[i][j] = gachi[i][j];
++j;
}
my_so.data.stat[i] = stat[i];
trace(gachitxt[i][0] + ' ' + stat[i] + ' ' + gachitxt[i][1]);
++i;
}
trace('SAVE STAT END...');
my_so.data.sound = sound;
my_so.data.music = music;
my_so.flush();
};
if (my_so.data.lvlmedal[1][0] == undefined) {
newGameInit();
trace('!clear all saved data!');
}
loadStat();
_global.addStat = function (type, amount) {
stat[type] += amount;
testGachi(type);
};
_global.setStat = function (type, amount) {
if (amount > stat[type]) {
stat[type] = amount;
}
testGachi(type);
};
_global.minStat = function (type, amount) {
if (amount < stat[type]) {
stat[type] = amount;
}
testGachi(type);
};
_global.testGachi = function (type) {
j = 0;
while (j < gachi[type].length) {
if (gachi[type][j] != -1) {
addgachi = false;
if (type == 4) {
if (stat[type] <= gachi[type][j]) {
addgachi = true;
}
} else {
if (stat[type] >= gachi[type][j]) {
addgachi = true;
}
}
if (addgachi == true) {
gachilogo.desc = atxt2[type][j];
gachilogo.img.gotoAndStop(j + 1);
gachilogo.img.img.gotoAndStop(type + 1);
gachilogo.gotoAndPlay(2);
gachi[type][j] = -1;
newachi.push('a' + type + j);
}
}
++j;
}
};
gotoAndStop('functions');
}
movieClip 323 {
}
movieClip 325 {
}
movieClip 327 {
}
movieClip 330 {
}
movieClip 333 {
}
movieClip 334 {
}
movieClip 335 {
}
movieClip 340 {
}
movieClip 341 {
}
movieClip 342 {
}
movieClip 343 {
frame 1 {
stop();
}
}
movieClip 345 {
}
movieClip 346 {
}
// unknown tag 88 length 50
movieClip 360 {
}
movieClip 362 {
}
movieClip 365 {
}
movieClip 366 {
frame 1 {
stop();
}
frame 16 {
gotoAndPlay(2);
}
}
movieClip 369 {
}
movieClip 370 {
}
button 374 {
on (rollOver) {
playSound('mouseon');
}
on (release) {
playSound('click');
}
}
movieClip 376 {
}
button 379 {
on (rollOver) {
playSound('mouseon');
}
}
movieClip 382 {
}
movieClip 385 {
frame 1 {
stop();
}
}
movieClip 386 {
frame 1 {
if (_root.sound == false) {
b3.gotoAndStop(2);
}
if (_root.music == false) {
b4.gotoAndStop(2);
}
b0.title = 'Restart Level';
b1.title = 'Walkthrough';
b2.title = 'Level Select';
b3.desc.text = 'SOUND';
b4.desc.text = 'MUSIC';
b3.desc._visible = false;
b4.desc._visible = false;
b3.ico.gotoAndStop(1);
b4.ico.gotoAndStop(2);
b0.but.onRelease = function () {
if (_root.victory == true) {
_root.finishLevel();
} else {
_root.trans.gotoAndPlay(2);
_root.norestart = false;
}
};
b1.but.onRelease = function () {
getURL(walkurl, '_blank');
};
b2.but.onRelease = function () {
_root.paused = true;
_root.trans2.gotoAndPlay(2);
_root.opt.menuin = 'select';
playMusic();
};
b3.but.onRelease = function () {
if (_root.sound == true) {
_root.sound = false;
b3.gotoAndStop(2);
_root.intersnd.b3.gotoAndStop(2);
} else {
_root.sound = true;
b3.gotoAndStop(1);
_root.intersnd.b3.gotoAndStop(1);
}
};
b4.but.onRelease = function () {
if (_root.music == true) {
_root.music = false;
playMusic();
b4.gotoAndStop(2);
_root.intersnd.b4.gotoAndStop(2);
} else {
_root.music = true;
playMusic();
b4.gotoAndStop(1);
_root.intersnd.b4.gotoAndStop(1);
}
};
b3.but.onRollOver = function () {
b3.desc._visible = true;
};
b3.but.onRollOut = function () {
b3.desc._visible = false;
};
b4.but.onRollOver = function () {
b4.desc._visible = true;
};
b4.but.onRollOut = function () {
b4.desc._visible = false;
};
}
}
movieClip 387 {
frame 1 {
_visible = false;
_alpha = 0;
onEnterFrame = function () {
if (_root.paused == true) {
if (_alpha > 0) {
_alpha = _alpha - 10;
} else {
_alpha = 0;
_visible = false;
}
} else {
if (_alpha < 100) {
_visible = true;
_alpha = _alpha + 10;
show = true;
inter2._alpha = 100;
inter2._visible = true;
} else {
_alpha = 100;
}
}
if (show == false) {
if (inter2._alpha > 0) {
inter2._alpha -= 10;
} else {
inter2._alpha = 0;
inter2._visible = false;
}
} else {
if (inter2._alpha < 100) {
inter2._visible = true;
inter2._alpha += 10;
if (_root.victory == true) {
inter2.b0.title = 'FINISH LEVEL';
} else {
inter2.b0.title = 'Replay Level';
}
} else {
inter2._alpha = 100;
}
}
};
}
}
movieClip 389 {
frame 1 {
stop();
}
}
movieClip 390 {
frame 1 {
if (_root.sound == false) {
b3.gotoAndStop(2);
}
if (_root.music == false) {
b4.gotoAndStop(2);
}
b3.desc.text = 'SOUND';
b4.desc.text = 'MUSIC';
b3.desc._visible = false;
b4.desc._visible = false;
b3.ico.gotoAndStop(1);
b4.ico.gotoAndStop(2);
b3.but.onRelease = function () {
if (_root.sound == true) {
_root.sound = false;
b3.gotoAndStop(2);
_root.inter.inter2.b3.gotoAndStop(2);
} else {
_root.sound = true;
b3.gotoAndStop(1);
_root.inter.inter2.b3.gotoAndStop(1);
}
};
b4.but.onRelease = function () {
if (_root.music == true) {
_root.music = false;
playMusic();
b4.gotoAndStop(2);
_root.inter.inter2.b4.gotoAndStop(2);
} else {
_root.music = true;
playMusic();
b4.gotoAndStop(1);
_root.inter.inter2.b4.gotoAndStop(1);
}
};
b3.but.onRollOver = function () {
b3.desc._visible = true;
};
b3.but.onRollOut = function () {
b3.desc._visible = false;
};
b4.but.onRollOver = function () {
b4.desc._visible = true;
};
b4.but.onRollOut = function () {
b4.desc._visible = false;
};
}
}
movieClip 394 {
}
movieClip 396 {
}
movieClip 397 {
}
movieClip 404 {
frame 1 {
stop();
}
}
movieClip 437 {
}
movieClip 439 {
}
button 443 {
on (release) {
getURL(sponsorurl, '_blank');
}
}
movieClip 446 {
}
button 460 {
on (rollOver) {
playSound('mouseon');
rec._visible = true;
}
on (rollOut) {
rec._visible = false;
}
on (press) {
playSound('click');
_root.lvl = id;
if (_root.trans._currentframe == 1) {
_root.trans.gotoAndPlay(2);
}
}
}
movieClip 462 {
}
movieClip 466 {
}
button 468 {
on (rollOver) {
playSound('mouseon');
rec._visible = true;
}
on (rollOut) {
rec._visible = false;
}
on (press) {
playSound('click');
_root.lvl = id;
if (_root.trans._currentframe == 1) {
_root.trans.gotoAndPlay(2);
}
}
}
movieClip 474 {
frame 1 {
stop();
}
}
movieClip 475 {
}
button 478 {
on (rollOver) {
playSound('mouseon');
rec._visible = true;
}
on (rollOut) {
rec._visible = false;
}
on (press) {
playSound('click');
_root.lvl = id;
if (_root.trans._currentframe == 1) {
_root.trans.gotoAndPlay(2);
}
}
}
movieClip 480 {
}
movieClip 482 {
}
movieClip 483 {
}
movieClip 485 {
}
movieClip 491 {
frame 1 {
if (_parent.type == undefined) {
gotoAndStop(type + 1);
} else {
gotoAndStop(_parent.type + 1);
}
}
}
movieClip 494 {
frame 1 {
stop();
onEnterFrame = function () {
if (timer > 0) {
--timer;
if (timer == 1) {
gotoAndPlay(3);
playSound('quest');
}
}
};
}
frame 13 {
_root.createQuestScore(_x + 320, _y + 240);
gotoAndStop(2);
}
}
button 518 {
on (rollOver) {
playSound('mouseon');
}
on (release) {
getURL(devurl, '_blank');
playSound('click');
}
}
button 534 {
on (rollOver) {
desc._visible = true;
}
on (rollOut) {
desc._visible = false;
}
}
movieClip 537 {
frame 1 {
_yscale = _parent.perc;
_xscale = _parent.perc;
}
}
movieClip 540 {
}
movieClip 541 {
frame 1 {
stop();
}
}
movieClip 544 {
}
movieClip 545 {
frame 1 {
stop();
}
}
movieClip 547 {
frame 1 {
stop();
onEnterFrame = function () {
if (timer > 0) {
--timer;
if (timer == 1) {
img2._visible = true;
img._visible = img2._visible;
img2.gotoAndPlay('anim');
_root.createInterPart(_x + 320, _y + 240, 'part_star', 5);
playSound('star1', 'star2');
}
}
};
}
}
movieClip 548 {
frame 1 {
stop();
timer = 0;
close = true;
tar = 'exit';
gotoAndStop('exit');
onEnterFrame = function () {
if (close == false) {
if (_xscale != 100) {
if (_xscale < 100) {
_yscale = _yscale + 30;
_xscale = _yscale + 30;
} else {
_yscale = _yscale - 10;
_xscale = _yscale - 10;
}
}
} else {
if (_xscale > 30) {
_yscale = _yscale - 40;
_xscale = _yscale - 40;
} else {
if (_currentframe != tar) {
close = false;
gotoAndStop(tar);
}
}
}
if (_currentframe == 72) {
if (timer == 0) {
timer = 50 + random(40);
_root.createPart(124, -140, 100, 'star', this, 1);
} else {
--timer;
if (timer == 10) {
_root.createPart(-123, -200, 100, 'star', this, 1);
}
}
}
};
}
frame 2 {
b1.title = 'START GAME';
b2.title = 'Video Walkthrough';
b3.title = 'Credits';
b4.title = 'More Puzzle Games';
b5.title = 'Reset Game';
bee.gotoAndPlay(8);
b1.but.onRelease = function () {
_root.trans2.gotoAndPlay(2);
menuin = 'select';
};
b2.but.onRelease = function () {
getURL(walkurl, '_blank');
};
b3.but.onRelease = function () {
_root.openMenu('credit');
};
b4.but.onRelease = function () {
getURL(morepuzzlegames, '_blank');
};
b5.but.onRelease = function () {
_root.openMenu('clear');
};
}
frame 11 {
_root.norestart = true;
_root.norestartcount = 0;
b1.title = 'More Puzzle Games';
b2.title = 'Back To Menu';
b3.title = 'Get Achievements';
b4.title = 'Video Walkthrough';
b1.but.onRelease = function () {
getURL(morepuzzlegames, '_blank');
};
b2.but.onRelease = function () {
_root.openMenu('main');
};
b3.but.onRelease = function () {
getURL(sponsorachi, '_blank');
};
b4.but.onRelease = function () {
getURL(walkurl, '_blank');
};
stat_star = _root.stat[7];
stat_lvl = _root.stat[6];
i = 1;
while (i <= _root.lvlcount) {
z = this['l' + i];
z.id = i;
if (_root.lvlmedal[i][0] == undefined) {
z.gotoAndStop(4);
} else {
levelstars = _root.lvlmedal[i][0] + _root.lvlmedal[i][1] + _root.lvlmedal[i][2] + _root.lvlmedal[i][3] + _root.lvlmedal[i][4];
if (levelstars == 0) {
z.gotoAndStop(1);
} else {
if (levelstars == 5) {
z.gotoAndStop(3);
} else {
z.gotoAndStop(2);
}
z.star.gotoAndStop(2);
j = 0;
while (j < 5) {
if (_root.lvlmedal[i][j] == 1) {
z['s' + j].gotoAndStop(2);
} else {
z['s' + j].gotoAndStop(1);
}
z['s' + j].img.gotoAndStop(j + 1);
++j;
}
}
z.rec.txt.text = _root.lvlrec[i];
z.rec._visible = false;
}
if (i > 30) {
if (_root.secretlevel != true) {
z.gotoAndStop(5);
}
}
++i;
}
gachis = 0;
i = 0;
while (i < _root.gachi.length) {
j = 0;
while (j < _root.gachi[i].length) {
if (_root.gachi[i][j] == -1) {
++gachis;
}
++j;
}
++i;
}
if (gachis == 60) {
_root.challengemode = true;
}
if (_root.kongapi == true) {
i = 0;
while (i < 8) {
_root.kongsend('stat' + i, _root.stat[i]);
++i;
}
}
}
frame 21 {
leveltxt.text = 'LEVEL ' + _root.lvl + ' PASSED!';
q3.text = 'Fill All Cells in ' + _root.secondNeed + ' Seconds';
bee.gotoAndPlay(8);
playSound('win');
if (_root.norestart == true) {
++_root.norestartcount;
setStat(8, _root.norestartcount);
} else {
_root.norestart = true;
_root.norestartcount = 0;
}
b1.title = 'CONTINUE';
b2.title = 'Submit Score';
b3.title = 'More Puzzle Games';
b4.title = 'Replay Level';
b5.title = 'Level Select';
b1.but.onRelease = function () {
if (_root.lvl == 30 || _root.lvl == _root.lvlcount) {
_root.openMenu('congrat');
} else {
if (_root.newachi.length > 0) {
_root.trans2.gotoAndPlay(2);
menuin = 'achi';
menuback = 'exit';
} else {
++_root.lvl;
_root.trans.gotoAndPlay(2);
}
}
};
b2.but.onRelease = function () {
_root.openMenu('submit');
};
b3.but.onRelease = function () {
getURL(morepuzzlegames, '_blank');
};
b4.but.onRelease = function () {
_root.trans.gotoAndPlay(2);
_root.norestart = false;
};
b5.but.onRelease = function () {
_root.trans2.gotoAndPlay(2);
menuin = 'select';
};
s0t.type = 0;
s0.type = 0;
s1t.type = 1;
s1.type = 1;
s2t.type = 2;
s2.type = 2;
s3t.type = 3;
s3.type = 3;
s4t.type = 4;
s4.type = 4;
if (_root.combNeed <= _root.combHave) {
star0 = 1;
s0.timer = 15;
_root.score += _root.questscore;
} else {
star0 = 0;
s0.timer = 0;
}
if (_root.gemNeed <= _root.gemHave) {
star1 = 1;
s1.timer = 25;
_root.score += _root.questscore;
} else {
star1 = 0;
s1.timer = 0;
}
if (_root.tunnelNeed <= _root.tunnelHave) {
star2 = 1;
s2.timer = 35;
_root.score += _root.questscore;
} else {
star2 = 0;
s2.timer = 0;
}
if (_root.secondHave <= _root.secondNeed) {
star3 = 1;
s3.timer = 45;
_root.score += _root.questscore;
} else {
star3 = 0;
s3.timer = 0;
}
if (_root.lives == 3) {
star4 = 1;
s4.timer = 55;
_root.score += _root.questscore;
} else {
star4 = 0;
s4.timer = 0;
}
i = 0;
while (i < 5) {
if (_root.lvlmedal[_root.lvl][i] == 1) {
this['s' + i].gotoAndStop(2);
this['q' + i]._visible = false;
} else {
this['s' + i].gotoAndStop(1);
this['q' + i]._visible = true;
if (this['star' + i] == 1) {
_root.lvlmedal[_root.lvl][i] = 1;
}
}
++i;
}
rectxt._visible = false;
addtxt._visible = false;
levelscore.text = _root.score;
totaladd = 0;
if (_root.score > _root.lvlrec[_root.lvl]) {
totaladd = _root.score - _root.lvlrec[_root.lvl];
_root.lvlrec[_root.lvl] = _root.score;
rectxt._visible = true;
addtxt._visible = true;
addtxt.text = '+' + totaladd;
}
_root.totalscore += totaladd;
totalscore.text = _root.totalscore;
setStat(5, _root.totalscore);
if (_root.lvlmedal[_root.lvl + 1][0] == undefined) {
_root.lvlmedal[_root.lvl + 1][0] = 0;
}
if (_root.lvlmedal[_root.lvl + 2][0] == undefined) {
_root.lvlmedal[_root.lvl + 2][0] = 0;
}
stat_star = 0;
i = 1;
while (i <= _root.lvlcount) {
if (_root.lvlmedal[i][0] != undefined) {
stat_star += _root.lvlmedal[i][0] + _root.lvlmedal[i][1] + _root.lvlmedal[i][2] + _root.lvlmedal[i][3] + _root.lvlmedal[i][4];
}
++i;
}
if (stat_star >= 150) {
if (_root.secretlevel != true) {
_root.unlocklogo.gotoAndPlay(2);
_root.unlocklogo.img.gotoAndStop(2);
_root.secretlevel = true;
}
}
setStat(6, _root.lvl);
setStat(7, stat_star);
saveStat();
if (_root.kongapi == true) {
_root.kongsend('hiscore', _root.totalscore);
}
}
frame 31 {
leveltxt.text = 'LEVEL ' + _root.lvl + ' FAILED!';
b1.title = 'TRY AGAIN';
b2.title = 'Walkthrough';
b3.title = 'Level Select';
b4.title = 'More Puzzle Games';
norestart = false;
b1.but.onRelease = function () {
_root.trans.gotoAndPlay(2);
_root.norestart = false;
};
b2.but.onRelease = function () {
getURL(walkurl, '_blank');
};
b3.but.onRelease = function () {
_root.trans2.gotoAndPlay(2);
menuin = 'select';
playMusic();
};
b4.but.onRelease = function () {
getURL(morepuzzlegames, '_blank');
};
saveStat();
}
frame 41 {
b1.title = 'SUBMIT!';
b2.title = 'Cancel';
b1.but.onRelease = function () {
_root.openMenu('select');
};
b2.but.onRelease = function () {
_root.openMenu('select');
};
}
frame 51 {
playSound('achi');
if (_root.stat[7] < 150) {
secret._visible = true;
} else {
secret._visible = false;
}
b1.title = 'CONTINUE';
b2.title = 'Level Select';
b3.title = 'Main Menu';
b4.title = 'More Puzzle Games';
b1.but.onRelease = function () {
_root.openMenu('select');
};
b2.but.onRelease = function () {
_root.openMenu('select');
};
b3.but.onRelease = function () {
_root.openMenu('main');
};
b4.but.onRelease = function () {
getURL(morepuzzlegames, '_blank');
};
}
frame 61 {
b1.title = 'Back To Menu';
b1.but.onRelease = function () {
_root.openMenu('main');
};
}
frame 71 {
b1.title = 'YES!';
b2.title = 'Cancel';
b1.but.onRelease = function () {
_root.setGachi();
_root.newGameInit();
_root.loadStat();
_root.openMenu('main');
};
b2.but.onRelease = function () {
_root.openMenu('main');
};
}
frame 81 {
_root.initAchi();
switch (menuback) {
case 'exit':
b1.title = 'NEXT LEVEL';
break;
case 'main':
b1.title = 'Main Menu';
break;
case 'select':
b1.title = 'Level Select';
}
b2.title = 'Get Achievements';
b2.but.onRelease = function () {
getURL(sponsorachi, '_blank');
};
b1.but.onRelease = function () {
if (menuback == 'exit') {
++_root.lvl;
_root.trans.gotoAndPlay(2);
} else {
_root.trans2.gotoAndPlay(2);
menuin = menuback;
}
};
gachis = 0;
i = 0;
while (i < _root.gachi.length) {
j = 0;
while (j < _root.gachi[i].length) {
if (_root.gachi[i][j] == -1) {
++gachis;
}
++j;
}
++i;
}
if (gachis >= 60) {
if (_root.challengemode != true) {
_root.unlocklogo.gotoAndPlay(2);
_root.unlocklogo.img.gotoAndStop(3);
_root.challengemode = true;
}
}
_root.gachis = gachis;
}
}
movieClip 549 {
frame 3 {
if (left == true) {
stop();
curleft = true;
}
}
frame 9 {
if (left == false) {
stop();
curleft = false;
}
}
}
movieClip 553 {
frame 1 {
stop();
}
frame 6 {
_root.clearLevel();
_root.clearAllPart();
_root.intersnd._visible = true;
_root.back.gotoAndStop(1);
_root.opt.gotoAndStop(_root.opt.menuin);
}
}
movieClip 557 {
frame 1 {
stop();
}
frame 6 {
_root.createLevel();
}
}
movieClip 560 {
frame 1 {
stop();
}
}
movieClip 562 {
}
movieClip 563 {
frame 1 {
stop();
_visible = false;
}
frame 2 {
_visible = true;
playSound('achi');
}
}
movieClip 567 {
frame 1 {
stop();
}
}
movieClip 568 {
frame 1 {
stop();
_visible = false;
}
frame 2 {
_visible = true;
playSound('achi');
}
frame 20 {
playSound('unlock');
}
}
frame 15 {
total_ms = 0;
total_sec = 0;
total_sm = 0;
paused = true;
isdraw = false;
editor = false;
editor_grid._visible = false;
editnum = 1;
objcount = 0;
norestart = true;
norestartcount = 0;
player._visible = false;
player.left = false;
bankPoint = new Array();
bankLine = new Array();
bankBackLine = new Array();
if (stat[7] < 150) {
_root.secretlevel = false;
} else {
_root.secretlevel = true;
}
var keyListener = new Object();
Key.addListener(keyListener);
keyListener.onKeyDown = function () {
if (paused == false) {
if (Key.isDown(32)) {
if (victory == true) {
finishLevel();
}
}
if (Key.isDown(82)) {
_root.trans.gotoAndPlay(2);
norestart = false;
}
}
};
getStringTwo = function () {
k += 2;
return Number(map.substr(k, 2));
};
createLevel = function () {
clearLevel();
closeMenu();
paused = false;
victory = false;
back.gotoAndStop(2);
back.img.gotoAndStop(Math.ceil(lvl % 7) + 1);
back.img.img.gotoAndStop(Math.ceil(lvl % 3) + 1);
inter.leveltxt.text = 'Level ' + lvl;
inter.inter2.b0.title = 'Replay Level';
inter.pressto._visible = false;
lives = 3;
score = 0;
secondHave = 0;
msecHave = 0;
tunnelHave = 0;
tunnelNeed = 0;
gemHave = 0;
gemNeed = 0;
combHave = 0;
combNeed = 0;
if (editor == true) {
map = maps[0];
} else {
map = maps[lvl];
}
k = -2;
points = getStringTwo();
lines = getStringTwo();
i = 0;
while (i < points) {
x = getStringTwo();
y = getStringTwo();
editCreatePoint(x, y);
obj.img._visible = false;
obj.but._visible = true;
++combNeed;
createNamedPart(obj._x, obj._y, 'cursorobj', obj._name + 'p');
++i;
}
secondNeed = combNeed + Math.round(combNeed / 2);
j = 0;
while (j < lines) {
x1 = getStringTwo();
y1 = getStringTwo();
x2 = getStringTwo();
y2 = getStringTwo();
editCreateLine(x1, y1, x2, y2);
obj.type = getStringTwo();
obj.img.gotoAndStop(obj.type);
obj.info = getStringTwo();
obj.img2.gotoAndStop(obj.info);
++tunnelNeed;
if (obj.img2._currentframe > 1) {
++gemNeed;
}
++j;
}
if (lvl == 1) {
tutor.gotoAndStop(2);
}
if (lvl == 2) {
tutor.gotoAndStop(5);
}
if (lvl == 3) {
tutor.gotoAndStop(6);
}
if (lvl == 4) {
tutor.gotoAndStop(7);
}
playMusic();
};
clearLevel = function () {
tutor.gotoAndStop(1);
intersnd._visible = false;
objcount = 0;
scorecount = 0;
isdraw = false;
player._visible = false;
curpoint = undefined;
curline = undefined;
clearStartMarker();
i = 1;
while (i < 4) {
inter['l' + i].gotoAndStop(2);
++i;
}
i = 0;
while (i < bankPoint.length) {
bankPoint[i].removeMovieClip();
++i;
}
i = 0;
while (i < bankLine.length) {
if (bankLine[i].img2.star != undefined) {
partmap[bankLine[i]._name + 's'].removeMovieClip();
}
bankLine[i].removeMovieClip();
++i;
}
i = 0;
while (i < bankBackLine.length) {
if (bankBackLine[i].img2.star != undefined) {
partmap[bankBackLine[i]._name + 's'].removeMovieClip();
}
bankBackLine[i].removeMovieClip();
++i;
}
bankPoint.length = 0;
bankLine.length = 0;
bankBackLine.length = 0;
};
finishLevel = function () {
isdraw = false;
paused = true;
trans2.gotoAndPlay(2);
opt.menuin = 'win';
playMusic();
};
clearStartMarker = function () {
i = 0;
while (i < bankPoint.length) {
bankPoint[i].but._visible = false;
partmap[bankPoint[i]._name + 'p'].removeMovieClip();
++i;
}
};
clearAllPart = function () {
while (partmap.part) {
partmap.part.removeMovieClip();
}
};
startDraw = function () {
isdraw = true;
inter.show = false;
player._visible = true;
player._x = _root._xmouse;
player._y = _root._ymouse;
player._yscale = 200;
player._xscale = 200;
clearStartMarker();
addStat(10, 1);
playSound('beein1', 'beein2');
if (lvl == 1) {
tutor.gotoAndStop(3);
}
};
testDeadEnd = function () {
i = 0;
while (i < bankLine.length) {
z = bankLine[i];
trace(curpoint._x);
if (z.hitTest(curpoint._x, curpoint._y, true)) {
return false;
}
++i;
}
return true;
};
testPlacePoint = function () {
i = 0;
while (i < bankPoint.length) {
z = bankPoint[i];
if (z.hitTest(_root._xmouse, _root._ymouse, true)) {
return z;
}
++i;
}
return undefined;
};
testPlaceLine = function () {
i = 0;
while (i < bankLine.length) {
z = bankLine[i];
if (z.hitTest(_root._xmouse, _root._ymouse, true)) {
return z;
}
++i;
}
return undefined;
};
editCreatePoint = function (x, y) {
++objcount;
obj = levelmap.attachMovie('pointobj', 'point' + objcount, 1000 + objcount);
obj.x = x;
obj.y = y;
obj._x = x * 40;
obj._y = y * 40;
obj.but._visible = false;
bankPoint.push(obj);
};
editDeletePoint = function (obj) {
j = 0;
while (j < bankPoint.length) {
if (bankPoint[j] == obj) {
bankPoint.splice(j, 1);
obj.removeMovieClip();
break;
}
++j;
}
};
editCreateLine = function (x1, y1, x2, y2) {
++objcount;
obj = levelmap.attachMovie('lineobj', 'line' + objcount, objcount);
obj.x1 = x1;
obj.y1 = y1;
obj.x2 = x2;
obj.y2 = y2;
x1 *= 40;
y1 *= 40;
x2 *= 40;
y2 *= 40;
dir = point_direction(x1, y1, x2, y2);
dist = point_distance(x1, y1, x2, y2);
obj._rotation = dir;
obj._xscale = dist;
obj._x = x1 + (x2 - x1) / 2;
obj._y = y1 + (y2 - y1) / 2;
bankLine.push(obj);
};
editDeleteLine = function (obj) {
j = 0;
while (j < bankLine.length) {
if (bankLine[j] == obj) {
bankLine.splice(j, 1);
obj.removeMovieClip();
break;
}
++j;
}
};
lineDisappear = function (obj1) {
obj = disap.attachMovie('linepart', obj1._name, disap.getNextHighestDepth());
obj._x = obj1._x;
obj._y = obj1._y;
obj._xscale = obj1._xscale;
obj._rotation = obj1._rotation;
obj.img.gotoAndStop(obj1.img._currentframe);
obj.img2.gotoAndStop(obj1.img2._currentframe);
if (obj1.img2.star._visible == true) {
partmap[obj1._name + 's'].gotoAndStop(2);
}
bankBackLine.push(obj);
};
createPart = function (xx, yy, type, count) {
j = 1;
while (j <= count) {
obj = partmap.attachMovie(type, 'part', partmap.getNextHighestDepth() + j);
obj._x = xx;
obj._y = yy;
++j;
}
};
createInterPart = function (xx, yy, type, count) {
j = 1;
while (j <= count) {
obj = partintermap.attachMovie(type, 'part', partintermap.getNextHighestDepth() + j);
obj._x = xx;
obj._y = yy;
++j;
}
};
createNamedPart = function (xx, yy, type, info) {
obj = partmap.attachMovie(type, info, partmap.getNextHighestDepth());
obj._x = xx;
obj._y = yy;
};
createScore = function (xx, yy, type) {
score += type;
++scorecount;
obj = partmap.attachMovie('scoreobj', 'score' + scorecount, partmap.getNextHighestDepth());
obj._x = xx;
obj._y = yy;
obj.type = '+' + type;
};
createQuestScore = function (xx, yy) {
++scorecount;
obj = partintermap.attachMovie('scoreobj', 'score' + scorecount, partintermap.getNextHighestDepth());
obj._x = xx;
obj._y = yy;
obj.type = '+' + questscore;
};
closeMenu = function () {
opt.tar = 'exit';
opt.gotoAndStop('exit');
gumtitle.gotoAndStop(1);
};
openMenu = function (info) {
opt.tar = info;
opt.close = true;
if (info == 'exit') {
gumtitle.gotoAndStop(1);
} else {
if (gumtitle._currentframe == 1) {
gumtitle.gotoAndPlay(2);
}
}
};
_global.playSound = function () {
if (sound == true) {
_root['snd_' + arguments[random(arguments.length)]].start();
}
};
_global.playMusic = function () {
_root['snd_' + currMuz].stop();
if (music == true) {
if (paused == true) {
if (_root.opt.menuin == 'win') {
currMuz = 'muzmain';
} else {
currMuz = 'muzpre';
}
_root['snd_' + currMuz].start(0, 1);
} else {
currMuz = 'muzgame';
_root['snd_' + currMuz].start(0, 999);
}
}
};
initAchi = function () {
i = 0;
while (i < _root.gachi.length) {
j = 0;
while (j < _root.gachi[i].length) {
z = opt['a' + i + j];
z.timer = 0;
z.desc.text = _root.atxt[i][j];
z.desc._visible = false;
if (_root.gachi[i][j] == -1) {
z.gotoAndStop(j + 1);
z.img.gotoAndStop(i + 1);
} else {
z.perc = Math.min(100, 40 + Math.floor((_root.stat[i] / _root.gachi[i][j]) * 60));
z.gotoAndStop(8);
}
++j;
}
++i;
}
trace('newachi=' + newachi.toString());
while (newachi.length) {
z = opt[newachi[0]];
z.img2._visible = false;
z.img._visible = z.img2._visible;
z.timer = 10 + newachi.length * 10;
newachi.splice(0, 1);
}
};
stringTwo = function (num) {
if (num < 10) {
return '0' + num;
} else {
return '' + num;
}
};
levelCompile = function () {
temp = '';
temp += stringTwo(bankPoint.length);
temp += stringTwo(bankLine.length);
i = 0;
while (i < bankPoint.length) {
z = bankPoint[i];
temp += stringTwo(z.x);
temp += stringTwo(z.y);
++i;
}
j = 0;
while (j < bankLine.length) {
z = bankLine[j];
temp += stringTwo(z.x1);
temp += stringTwo(z.y1);
temp += stringTwo(z.x2);
temp += stringTwo(z.y2);
temp += stringTwo(z.img._currentframe);
temp += stringTwo(z.img2._currentframe);
++j;
}
return temp;
};
var snd_achi = new Sound(_root);
snd_achi.attachSound('achi');
var snd_achi1 = new Sound(_root);
snd_achi1.attachSound('achi1');
var snd_achi2 = new Sound(_root);
snd_achi2.attachSound('achi2');
var snd_beedie1 = new Sound(_root);
snd_beedie1.attachSound('beedie1');
var snd_beedie2 = new Sound(_root);
snd_beedie2.attachSound('beedie2');
var snd_beein1 = new Sound(_root);
snd_beein1.attachSound('beein1');
var snd_beein2 = new Sound(_root);
snd_beein2.attachSound('beein2');
var snd_achi = new Sound(_root);
snd_achi.attachSound('achi');
var snd_click = new Sound(_root);
snd_click.attachSound('click');
var snd_comb1 = new Sound(_root);
snd_comb1.attachSound('comb1');
var snd_comb2 = new Sound(_root);
snd_comb2.attachSound('comb2');
var snd_mouseon = new Sound(_root);
snd_mouseon.attachSound('mouseon');
var snd_quest = new Sound(_root);
snd_quest.attachSound('quest');
var snd_star1 = new Sound(_root);
snd_star1.attachSound('star1');
var snd_star2 = new Sound(_root);
snd_star2.attachSound('star2');
var snd_tunnel1 = new Sound(_root);
snd_tunnel1.attachSound('tunnel1');
var snd_tunnel2 = new Sound(_root);
snd_tunnel2.attachSound('tunnel2');
var snd_unlock = new Sound(_root);
snd_unlock.attachSound('unlock');
var snd_muzpre = new Sound(_root);
snd_muzpre.attachSound('muzpre');
var snd_muzmain = new Sound(_root);
snd_muzmain.attachSound('muzmain');
var snd_muzgame = new Sound(_root);
snd_muzgame.attachSound('muzgame');
snd_muzpre.onSoundComplete = function () {
snd_muzmain.start(0, 1);
};
snd_muzmain.onSoundComplete = function () {
snd_muzpre.start(0, 1);
};
gotoAndStop('controller');
}
frame 25 {
onMouseDown = function () {
if (paused == false) {
if (editor == true) {
if (editnum == 1) {
pointselect = testPlacePoint();
if (pointselect == undefined) {
obj = testPlaceLine();
if (obj != undefined) {
clickup = true;
editDeleteLine(obj);
}
}
}
}
}
};
onMouseUp = function () {
if (paused == false) {
if (editor == true) {
if (clickup != true) {
if (editnum == 1) {
obj = testPlacePoint();
if (obj == undefined) {
editCreatePoint(Math.round(_xmouse / 40), Math.round(_ymouse / 40));
} else {
if (obj == pointselect) {
editDeletePoint(obj);
} else {
if (pointselect != undefined) {
editCreateLine(pointselect.x, pointselect.y, obj.x, obj.y);
}
}
}
_root.pointselect = undefined;
}
}
clickup = false;
}
}
};
onEnterFrame = function () {
++total_ms;
if (total_ms == 30) {
total_ms = 0;
++total_sec;
if (total_sec == 60) {
total_sec = 0;
addStat(9, 1);
}
if (total_sec < 10) {
totaltime = stat[9] + ':0' + total_sec;
} else {
totaltime = stat[9] + ':' + total_sec;
}
}
if (total_sm > 1000) {
addStat(3, 1);
total_sm = 0;
}
if (paused == false) {
if (editor == true) {
lineselect = testPlaceLine();
} else {
if (isdraw == true) {
if (player._xscale > 100) {
player._xscale -= 10;
player._yscale = player._xscale;
player._alpha = 200 - player._xscale;
}
if (victory == false) {
if (msecHave < 30) {
++msecHave;
} else {
msecHave = 0;
++secondHave;
}
}
iscol = false;
dist = point_distance(player._x, player._y, _root._xmouse, _root._ymouse);
dir = point_direction(_root._xmouse, _root._ymouse, player._x, player._y);
if (dist > 0) {
flydist = Math.min(dist, dist / 2);
total_sm += dist;
player._x -= lengthdir_x(dist, dir);
player._y += lengthdir_y(dist, dir);
if (dir < 90 & dir > -90) {
player.left = true;
} else {
player.left = false;
}
if (player.curleft != player.left) {
player.play();
}
}
i = 0;
while (i < bankPoint.length) {
z = bankPoint[i];
if (z.hitTest(player._x, player._y, true)) {
iscol = true;
if (z != curpoint) {
curpoint = z;
if (curpoint.img._visible == false) {
curpoint.img._visible = true;
++combHave;
addStat(0, 1);
createPart(curpoint._x, curpoint._y, 'part_fill', 1);
createPart(curpoint._x, curpoint._y, 'part_comb', 1);
createScore(curpoint._x, curpoint._y, combscore);
if (combHave == combNeed) {
victory = true;
inter.pressto._visible = true;
minStat(4, secondHave);
createPart(220, 45, 'part_star', 4);
createPart(260, 45, 'part_star', 4);
createPart(300, 45, 'part_star', 4);
createPart(340, 45, 'part_star', 4);
createPart(380, 45, 'part_star', 4);
createPart(420, 45, 'part_star', 4);
playSound('achi');
if (lvl == 1) {
tutor.gotoAndStop(4);
}
}
}
if (curline != undefined) {
lineDisappear(curline);
createPart(curline.xd1, curline.yd1, 'part_explo', 1);
createPart(curline.xd2, curline.yd2, 'part_explo', 1);
createPart(curline.xd3, curline.yd3, 'part_explo', 1);
createPart(curline.xd4, curline.yd4, 'part_explo', 1);
createPart(curline.xd5, curline.yd5, 'part_explo', 1);
if (curline.img2.star != undefined) {
createPart(curline.xstar, curline.ystar, 'part_explo', 1);
}
createScore(curline._x, curline._y, tunnelscore);
editDeleteLine(curline);
++tunnelHave;
addStat(1, 1);
playSound('tunnel1', 'tunnel2');
if (tunnelHave == tunnelNeed) {
finishLevel();
}
}
}
}
++i;
}
i = 0;
while (i < bankLine.length) {
z = bankLine[i];
if (z.hitTest(player._x, player._y, true)) {
iscol = true;
if (z != curline) {
curline = z;
}
}
++i;
}
if (iscol == false) {
isdraw = false;
player._visible = false;
createPart(player._x, player._y, 'part_bee', 1);
playSound('beedie1', 'beedie2');
if (lives == 1) {
paused = true;
openMenu('def');
} else {
inter['l' + lives].gotoAndPlay('die');
--lives;
if (lives == 1) {
inter.l1.gotoAndPlay('last');
}
inter.show = true;
curpoint.but._visible = true;
createNamedPart(curpoint._x, curpoint._y, 'cursorobj', curpoint._name + 'p');
curline = undefined;
}
}
}
}
}
};
gotoAndStop('game');
}
frame 35 {
openMenu('main');
if (music == true) {
snd_muzpre.start(0, 1);
currMuz = 'muzpre';
}
clearAllPart();
}