Frame 1
stop();
Frame 8
function populateScoreArray() {
trace("score");
if (so.data.scoreQty != undefined) {
var i = 0;
while (i < so.data.scoreQty) {
var scoreObj = eval ("so.data.scoreObj" + i);
scoreArray.push(scoreObj);
i++;
}
} else {
addScore("Lucas", 650000);
addScore("Hova", 600000);
addScore("Zoc", 530000);
addScore("Spindle", 450000);
addScore("Kreela", 380000);
addScore("Fugax", 300000);
addScore("Beetle", 230000);
addScore("Stan", 150000);
addScore("Nicky", 80000);
addScore("Steve", 50000);
updateSO();
}
}
function updateSO() {
so.clear();
if (scoreArray.length) {
var _local1 = 0;
while (_local1 < scoreArray.length) {
Set("so.data.scoreObj" + _local1, scoreArray[_local1]);
_local1++;
}
so.data.scoreQty = scoreArray.length;
}
}
function refreshScoreField() {
trace(scoreArray.length);
var i = 0;
while (i < scoreArray.length) {
trace((("usr: " + scoreArray[i].userName) + " scr: ") + scoreArray[i].score);
eval (("highscore.userName" + i) + "_txt").text = scoreArray[i].userName;
eval (("highscore.score" + i) + "_txt").text = scoreArray[i].score;
i++;
}
}
function addScore(userName, score) {
if (!scoreArray.length) {
scoreArray.push({userName:userName, score:score});
return(true);
}
var _local1 = 0;
while (_local1 < scoreArray.length) {
trace((scoreArray[_local1].score + " ") + score);
if (scoreArray[_local1].score < score) {
scoreArray.splice(_local1, 0, {userName:userName, score:score});
posScoreFinale = _local1;
if (scoreArray.length > maxScoreQty) {
scoreArray.splice(maxScoreQty, 1);
}
return(true);
}
_local1++;
}
if (scoreArray.length < maxScoreQty) {
scoreArray.push({userName:userName, score:score});
return(true);
}
return(false);
}
trace("initMain");
_global.main = this;
var instruction = 0;
var scoreFinale = 0;
var posScoreFinale = 0;
var nomUser = " ";
var gameInstruction = false;
if (_global.sound == undefined) {
_global.sound = new Sound(this);
}
Stage.showMenu = false;
_focusrect = false;
gameID = "Silk_Em_Up";
so = SharedObject.getLocal(gameID);
maxScoreQty = 10;
scoreArray = new Array();
Frame 37
stop();
Frame 53
trace("gotoGame");
Frame 54
stop();
mcSilkShooter.init();
Symbol 39 MovieClip Frame 16
stop();
Instance of Symbol 32 MovieClip "barMask" in Symbol 39 MovieClip Frame 16
onClipEvent (load) {
var root = _parent._parent;
totalbytes = root.getBytesTotal();
}
onClipEvent (enterFrame) {
bytesloaded = root.getBytesLoaded();
percentage = bytesloaded / totalbytes;
percent = Math.round(percentage * 100);
trace(percent);
this._width = 217 * percentage;
if (percentage >= 1) {
_parent.gotoAndPlay("out");
}
}
Symbol 39 MovieClip Frame 65
_parent.gotoAndStop("initMenu");
Symbol 42 MovieClip Frame 1
stop();
Symbol 42 MovieClip Frame 3
stop();
Symbol 59 MovieClip Frame 1
stop();
Symbol 73 Button
on (rollOver) {
over = true;
gotoAndPlay ("open");
}
on (rollOut) {
over = false;
((!joue) ? (gotoAndPlay ("close")) : null);
}
on (press) {
gotoAndPlay ("click");
}
on (release) {
main.instruction = 1;
_parent.gotoAndPlay("out");
main.sfx.gotoAndPlay("click");
}
Symbol 84 MovieClip Frame 7
stop();
Symbol 89 MovieClip Frame 7
stop();
Symbol 90 MovieClip Frame 5
stop();
Symbol 92 MovieClip Frame 1
stop();
var over = false;
var joue = false;
Symbol 92 MovieClip Frame 13
joue = true;
Symbol 92 MovieClip Frame 25
joue = false;
if (!over) {
gotoAndPlay ("close");
}
stop();
Symbol 92 MovieClip Frame 26
play();
Symbol 92 MovieClip Frame 38
gotoAndStop (1);
Symbol 92 MovieClip Frame 42
gotoAndStop (1);
Symbol 95 Button
on (rollOver) {
over = true;
gotoAndPlay ("open");
}
on (rollOut) {
over = false;
((!joue) ? (gotoAndPlay ("close")) : null);
}
on (press) {
gotoAndPlay ("click");
}
on (release) {
_parent.gotoAndPlay("out");
main.sfx.gotoAndPlay("click");
}
Symbol 102 MovieClip Frame 7
stop();
Symbol 109 MovieClip Frame 7
stop();
Symbol 110 MovieClip Frame 5
stop();
Symbol 112 MovieClip Frame 1
stop();
var over = false;
var joue = false;
Symbol 112 MovieClip Frame 13
joue = true;
Symbol 112 MovieClip Frame 25
joue = false;
if (!over) {
gotoAndPlay ("close");
}
stop();
Symbol 112 MovieClip Frame 26
play();
Symbol 112 MovieClip Frame 38
gotoAndStop (1);
Symbol 112 MovieClip Frame 42
gotoAndStop (1);
Symbol 115 Button
on (release) {
main.instruction = 2;
gotoAndPlay ("out");
}
Symbol 116 MovieClip Frame 19
title.gotoAndStop("game");
Instance of Symbol 92 MovieClip in Symbol 116 MovieClip Frame 23
/* no clip actions */
Instance of Symbol 112 MovieClip in Symbol 116 MovieClip Frame 25
/* no clip actions */
Symbol 116 MovieClip Frame 34
stop();
Symbol 116 MovieClip Frame 63
if (main.instruction == 1) {
_parent.gotoAndStop("instruc");
} else if (main.instruction == 2) {
_parent.gotoAndStop("highscores");
} else {
_parent.gotoAndPlay("game");
}
Instance of Symbol 112 MovieClip in Symbol 150 MovieClip Frame 16
/* no clip actions */
Symbol 150 MovieClip Frame 32
stop();
Symbol 150 MovieClip Frame 60
_parent.gotoAndPlay("game");
Symbol 157 Button
on (rollOver) {
over = true;
gotoAndPlay ("open");
}
on (rollOut) {
over = false;
((!joue) ? (gotoAndPlay ("close")) : null);
}
on (press) {
gotoAndPlay ("click");
}
on (release) {
_parent.gotoAndPlay("out");
main.sfx.gotoAndPlay("click");
}
Symbol 164 MovieClip Frame 7
stop();
Symbol 171 MovieClip Frame 7
stop();
Symbol 172 MovieClip Frame 5
stop();
Symbol 174 MovieClip Frame 1
stop();
var over = false;
var joue = false;
Symbol 174 MovieClip Frame 13
joue = true;
Symbol 174 MovieClip Frame 25
joue = false;
if (!over) {
gotoAndPlay ("close");
}
stop();
Symbol 174 MovieClip Frame 26
play();
Symbol 174 MovieClip Frame 38
gotoAndStop (1);
Symbol 174 MovieClip Frame 42
gotoAndStop (1);
Symbol 177 MovieClip Frame 1
stop();
Instance of Symbol 174 MovieClip in Symbol 216 MovieClip Frame 16
/* no clip actions */
Symbol 216 MovieClip Frame 19
title.gotoAndStop("game");
Symbol 216 MovieClip Frame 23
main.populateScoreArray();
if (main.addScore(main.nomUser, main.scoreFinale)) {
main.updateSO();
mcPosScore._y = mcPosScore._y + (main.posScoreFinale * 21);
}
main.refreshScoreField();
Key.addListener(this);
onKeyDown = function () {
if (Key.isDown(13)) {
gotoAndPlay ("out");
Key.removeListener(this);
}
};
Symbol 216 MovieClip Frame 30
stop();
Symbol 216 MovieClip Frame 39
Key.removeListener(this);
Symbol 216 MovieClip Frame 58
_parent.gotoAndStop("menu");
Symbol 223 Button
on (rollOver) {
over = true;
gotoAndPlay ("open");
}
on (rollOut) {
over = false;
((!joue) ? (gotoAndPlay ("close")) : null);
}
on (press) {
gotoAndPlay ("click");
}
on (release) {
_parent.option = false;
_parent.gotoAndPlay("out");
main.sfx.gotoAndPlay("click");
}
Symbol 224 MovieClip Frame 5
stop();
Symbol 225 MovieClip Frame 1
stop();
var over = false;
var joue = false;
Symbol 225 MovieClip Frame 13
joue = true;
Symbol 225 MovieClip Frame 25
joue = false;
if (!over) {
gotoAndPlay ("close");
}
stop();
Symbol 225 MovieClip Frame 26
play();
Symbol 225 MovieClip Frame 38
gotoAndStop (1);
Symbol 225 MovieClip Frame 42
gotoAndStop (1);
Instance of Symbol 225 MovieClip in Symbol 227 MovieClip Frame 13
/* no clip actions */
Instance of Symbol 174 MovieClip in Symbol 227 MovieClip Frame 15
/* no clip actions */
Symbol 227 MovieClip Frame 21
stop();
var option = true;
Key.addListener(itName);
itName.onSetFocus = function () {
itName.onKeyDown = function () {
if (Key.isDown(13)) {
gotoAndPlay ("out");
Key.removeListener(itName);
}
};
};
itName.onKillFocus = function () {
itName.onKeyDown = null;
};
Symbol 227 MovieClip Frame 32
main.nomUser = txt_name;
Symbol 227 MovieClip Frame 49
if (option) {
_parent.gotoAndStop("highscores");
} else {
_parent.gotoAndStop("menu");
}
Symbol 244 MovieClip Frame 1
stop();
Symbol 247 Button
on (rollOver) {
over = true;
gotoAndPlay ("open");
}
on (rollOut) {
over = false;
((!joue) ? (gotoAndPlay ("close")) : null);
}
on (press) {
gotoAndPlay ("click");
}
on (release) {
_parent.gotoAndPlay("out");
main.sfx.gotoAndPlay("click");
}
Symbol 248 MovieClip Frame 5
stop();
Symbol 253 MovieClip Frame 7
stop();
Symbol 255 MovieClip Frame 1
stop();
var over = false;
var joue = false;
Symbol 255 MovieClip Frame 13
joue = true;
Symbol 255 MovieClip Frame 25
joue = false;
if (!over) {
gotoAndPlay ("close");
}
stop();
Symbol 255 MovieClip Frame 26
play();
Symbol 255 MovieClip Frame 38
gotoAndStop (1);
Symbol 255 MovieClip Frame 42
gotoAndStop (1);
Symbol 258 Button
on (rollOver) {
over = true;
gotoAndPlay ("open");
}
on (rollOut) {
over = false;
((!joue) ? (gotoAndPlay ("close")) : null);
}
on (press) {
gotoAndPlay ("click");
}
on (release) {
_parent.selectionWin = 1;
_parent.gotoAndPlay("out");
main.sfx.gotoAndPlay("click");
}
Symbol 259 MovieClip Frame 5
stop();
Symbol 260 MovieClip Frame 1
stop();
var over = false;
var joue = false;
Symbol 260 MovieClip Frame 13
joue = true;
Symbol 260 MovieClip Frame 25
joue = false;
if (!over) {
gotoAndPlay ("close");
}
stop();
Symbol 260 MovieClip Frame 26
play();
Symbol 260 MovieClip Frame 38
gotoAndStop (1);
Symbol 260 MovieClip Frame 42
gotoAndStop (1);
Symbol 263 MovieClip Frame 12
mcTitle.gotoAndStop(main.gameOverMessage);
Instance of Symbol 255 MovieClip in Symbol 263 MovieClip Frame 13
/* no clip actions */
Instance of Symbol 260 MovieClip in Symbol 263 MovieClip Frame 15
/* no clip actions */
Symbol 263 MovieClip Frame 17
main.populateScoreArray();
pointage = main.scoreFinale;
mcTitle.gotoAndStop(main.gameOverMessage);
Symbol 263 MovieClip Frame 22
stop();
var selectionWin = 0;
Symbol 263 MovieClip Frame 36
mcTitle.gotoAndStop(main.gameOverMessage);
Symbol 263 MovieClip Frame 39
mcTitle.gotoAndStop(main.gameOverMessage);
Symbol 263 MovieClip Frame 53
if (selectionWin == 0) {
_parent.gotoAndStop("menu");
} else {
_parent.gotoAndStop("name");
}
Symbol 282 MovieClip Frame 1
function hitBg(x, y) {
return(!mcBgColl.hitTest(x, y, true));
}
function hitBgWithMovieClip(mc) {
return(!mcBgColl.hitTest(mc));
}
function shake(tx, ty, bg) {
mcBg[bg]._x = positionBase.x + tx;
mcBg[bg]._y = positionBase.y + ty;
}
function replace(bg) {
mcBg[bg]._x = positionBase.x;
mcBg[bg]._y = positionBase.y;
}
function gotoBg(from, to) {
nextBg = to;
gotoAndPlay("outBg" + from);
}
function gotoDirectBg(n) {
gotoAndStop("bg" + n);
}
mcBgColl._visible = false;
stop();
var positionBase = new Object();
positionBase.x = mcBg1._x;
positionBase.y = mcBg1._y;
var mcBg = new Array();
mcBg[1] = mcBg1;
var nextBg = 1;
mcBgColl._visible = false;
Symbol 282 MovieClip Frame 2
mcBgColl._visible = false;
Symbol 282 MovieClip Frame 8
mcBgColl._visible = false;
_parent.onBgReady();
stop();
Symbol 282 MovieClip Frame 18
gotoAndPlay("inBg" + nextBg);
Symbol 282 MovieClip Frame 19
mcBgColl._visible = false;
mcBg[2] = mcBg2;
Symbol 282 MovieClip Frame 25
mcBgColl._visible = false;
_parent.onBgReady();
stop();
Symbol 282 MovieClip Frame 39
gotoAndPlay("inBg" + nextBg);
Symbol 282 MovieClip Frame 40
mcBgColl._visible = false;
mcBg[3] = mcBg3;
Symbol 282 MovieClip Frame 46
mcBgColl._visible = false;
_parent.onBgReady();
stop();
Symbol 282 MovieClip Frame 59
gotoAndPlay("inBg" + nextBg);
Symbol 287 MovieClip Frame 34
stop();
Symbol 288 MovieClip Frame 1
function gotoBg(n) {
if (decor != n) {
mcBg.gotoBg(decor, n);
decor = n;
}
gotoAndStop ("normal");
}
function gotoDirectBg(n) {
mcBg.gotoDirectBg(n);
decor = n;
gotoAndStop ("normal");
}
function hitBg(x, y) {
return(mcBg.hitBg(x, y, decor));
}
function hitBgWithMovieClip(mc) {
return(mcBg.hitBgWithMovieClip(mc, decor));
}
function onBgReady() {
if (bgReadyCallBack != null) {
bgReadyCallBack.call();
}
}
function setBgReadyCallBack(f) {
bgReadyCallBack = f;
}
var decor = 1;
var positionBase = new Object();
positionBase.x = mcBg._x;
positionBase.y = mcBg._y;
var impactPosition = new Object();
var impactAnimation = new Array();
var currentImpactFrame = 0;
var impactIterator = 0;
var impactInterval = 3;
var impactNb = 3;
var bgReadyCallBack = null;
mcBg.gotoAndStop("bg1");
Symbol 288 MovieClip Frame 2
stop();
impactPosition.x = 0;
impactPosition.y = 0;
mcBg.replace(decor);
this.onEnterFrame = null;
Symbol 288 MovieClip Frame 12
stop();
currentImpactFrame = 0;
impactIterator = 0;
impactNb = 100;
impactInterval = 20;
impactAnimation[0] = {x:-1, y:0};
impactAnimation[1] = {x:-1, y:0};
impactAnimation[2] = {x:0, y:0};
impactAnimation[3] = {x:0, y:0};
impactAnimation[4] = {x:-1, y:0};
impactAnimation[5] = {x:-1, y:0};
impactAnimation[6] = {x:0, y:0};
impactAnimation[7] = {x:0, y:0};
this.onEnterFrame = function () {
if ((impactNb > 0) && (currentImpactFrame == (impactInterval - 1))) {
impactPosition.x = impactAnimation[impactIterator].x;
impactPosition.y = impactAnimation[impactIterator].y;
mcBg.shake(impactPosition.x, impactPosition.y, decor);
impactIterator++;
if (impactIterator == 8) {
impactIterator = 0;
impactNb--;
currentImpactFrame = 0;
}
} else {
currentImpactFrame++;
}
};
Symbol 288 MovieClip Frame 22
stop();
stop();
currentImpactFrame = 0;
impactIterator = 0;
impactNb = 6;
impactInterval = 4;
impactAnimation[0] = {x:-1, y:1};
impactAnimation[1] = {x:-1, y:-1};
impactAnimation[2] = {x:1, y:0};
impactAnimation[3] = {x:-1, y:1};
impactAnimation[4] = {x:-1, y:-1};
impactAnimation[5] = {x:1, y:0};
impactAnimation[6] = {x:-1, y:1};
impactAnimation[7] = {x:-1, y:-1};
impactAnimation[8] = {x:1, y:0};
this.onEnterFrame = function () {
if ((impactNb > 0) && (currentImpactFrame == (impactInterval - 1))) {
impactPosition.x = impactAnimation[impactIterator].x;
impactPosition.y = impactAnimation[impactIterator].y;
mcBg.shake(impactPosition.x, impactPosition.y, decor);
impactIterator++;
if (impactIterator == 9) {
impactIterator = 0;
impactNb--;
currentImpactFrame = 0;
}
} else {
currentImpactFrame++;
}
};
Symbol 297 MovieClip Frame 5
stop();
Symbol 298 MovieClip Frame 1
function light(b) {
l = b;
}
mcHit._visible = false;
var l = false;
mcTrou._visible = true;
mcTrouLight._visible = false;
Symbol 298 MovieClip Frame 2
mcTrou._visible = !l;
mcTrouLight._visible = l;
stop();
Symbol 298 MovieClip Frame 3
mcTrou._visible = !l;
mcTrouLight._visible = l;
mcTrou.gotoAndStop(1);
mcTrouLight.gotoAndStop(1);
Symbol 298 MovieClip Frame 7
mcTrou._visible = !l;
mcTrouLight._visible = l;
mcTrou.gotoAndStop(1);
mcTrouLight.gotoAndStop(1);
stop();
Symbol 298 MovieClip Frame 8
mcTrou._visible = !l;
mcTrouLight._visible = l;
mcTrou.gotoAndPlay(1);
mcTrouLight.gotoAndPlay(1);
Symbol 298 MovieClip Frame 17
mcTrou._visible = !l;
mcTrouLight._visible = l;
Symbol 298 MovieClip Frame 23
mcTrou._visible = !l;
mcTrouLight._visible = l;
Symbol 298 MovieClip Frame 24
gotoAndStop ("stop");
Symbol 347 MovieClip Frame 1
flying = true;
Symbol 347 MovieClip Frame 37
gotoAndPlay(stop);
Symbol 347 MovieClip Frame 38
function isFlying() {
return(flying);
}
var flying = false;
stop();
Symbol 357 MovieClip Frame 1
stop();
Symbol 357 MovieClip Frame 37
stop();
Symbol 357 MovieClip Frame 38
var base = (Math.round(Math.random() * 360) - 360);
this._rotation = base;
var calcTmp;
Symbol 357 MovieClip Frame 44
stop();
Symbol 363 MovieClip Frame 6
stop();
Symbol 366 MovieClip Frame 1
function shoot() {
mcSilk.play();
}
function getCannonPosition(orig) {
pos.x = mcTail1._x;
pos.y = mcTail1._y;
localToGlobal(pos);
return(pos);
}
function adjust(x, y) {
leng = (x * x) + (y * y);
leng = Math.sqrt(leng);
if (leng > maxLength) {
var _local1 = maxLength / leng;
objX = x * _local1;
objY = y * _local1;
leng = maxLength;
} else {
objX = x;
objY = y;
}
generateAnimation(mcSilk, prop[mcSilk]);
generateAnimation(mcTail1, prop[mcTail1]);
generateAnimation(mcTail2, prop[mcTail2]);
generateAnimation(mcTail3, prop[mcTail3]);
curFrame = 1;
}
function generateAnimation(mc, p) {
var _local3 = (objX * p) - mc._x;
var _local2 = (objY * p) - mc._y;
animX[mc][1] = mc._x + (0.5 * _local3);
animX[mc][2] = mc._x + (0.25 * _local3);
animX[mc][3] = mc._x + (0.125 * _local3);
animX[mc][4] = mc._x + (0.0625 * _local3);
animX[mc][5] = mc._x + (0.0625 * _local3);
animY[mc][1] = mc._y + (0.5 * _local2);
animY[mc][2] = mc._y + (0.25 * _local2);
animY[mc][3] = mc._y + (0.125 * _local2);
animY[mc][4] = mc._y + (0.0625 * _local2);
animY[mc][5] = mc._y + (0.0625 * _local2);
nbFrame = 5;
}
function animer(mc) {
mc._x = animX[mc][curFrame];
mc._y = animY[mc][curFrame];
}
function moveCannon() {
adjust(_xmouse, _ymouse);
}
mcSilk.gotoAndStop("stop");
var pos = new Object();
var maxLength = (mcTail4._y - mcTail1._y);
var prop = new Array();
var animX = new Array();
var animY = new Array();
var objX;
var objY;
var leng;
var mult;
var nbFrame;
var curFrame = 9999;
animX[mcTail1] = new Array();
animX[mcTail2] = new Array();
animX[mcTail3] = new Array();
animX[mcTail4] = new Array();
animX[mcSilk] = new Array();
animY[mcTail1] = new Array();
animY[mcTail2] = new Array();
animY[mcTail3] = new Array();
animY[mcTail4] = new Array();
animY[mcSilk] = new Array();
prop[mcTail4] = 0;
prop[mcTail3] = 0.1;
prop[mcTail2] = 0.52;
prop[mcTail1] = 1;
prop[mcSilk] = 1.35;
onEnterFrame = function () {
if ((curFrame <= nbFrame) && (curFrame > 0)) {
animer(mcTail1);
animer(mcTail2);
animer(mcTail3);
animer(mcSilk);
curFrame++;
}
};
Symbol 384 MovieClip Frame 1
stop();
Symbol 390 MovieClip Frame 1
stop();
Symbol 390 MovieClip Frame 13
stop();
Symbol 400 MovieClip Frame 1
stop();
Symbol 400 MovieClip Frame 15
stop();
Symbol 412 MovieClip Frame 1
stop();
Symbol 412 MovieClip Frame 73
stop();
Symbol 420 MovieClip Frame 6
stop();
Symbol 434 MovieClip Frame 1
function gotoLevel(l) {
level = l;
if (l == 1) {
gotoAndPlay ("play1st");
} else {
gotoAndPlay ("play");
}
}
var level = 1;
stop();
Symbol 434 MovieClip Frame 18
dtLevel.text = level;
Symbol 434 MovieClip Frame 51
_parent.onSettedGoal();
Symbol 434 MovieClip Frame 55
stop();
Symbol 438 MovieClip Frame 1
trace("start");
Symbol 438 MovieClip Frame 47
stop();
Symbol 439 MovieClip Frame 1
function muteVolume() {
muted = true;
}
function unmuteVolume() {
muted = false;
}
function setPoints(n) {
dtPoints.text = n;
}
function addPoints(n) {
dtPoints.text = dtPoints.text + n;
}
function setHoles(n) {
dtHoles.text = n;
}
function subHoles(n) {
addHoles(-n);
}
function addHoles(n) {
dtHoles.text = Number(dtHoles.text) + n;
}
function getHoles() {
return(Number(dtHoles.text));
}
function setSilk(n) {
if (n > silkMax) {
return(false);
}
if (n < 0) {
n = 0;
}
mcBar.gotoAndStop((silkMax + 1) - n);
if (n == 0) {
mcReload.gotoAndPlay("in");
mcReload.hitArea = mcReload.mcPanel;
}
return(true);
}
function addSilk(n) {
return(setSilk(n + ((silkMax + 1) - mcBar._currentFrame)));
}
function subSilk(n) {
return(addSilk(-n));
}
function getSilk() {
return((silkMax + 1) - mcBar._currentframe);
}
function shoot(mc, x, y) {
var _local8 = mcCannon.getCannonPosition();
var _local7 = _local8.x;
var _local6 = _local8.y;
var _local3 = (x - _local7) / 7;
var _local4 = (y - _local6) / 7;
var _local1;
_local1 = 0;
while (_local1 <= 6) {
animX[mc][_local1] = _local7 + (_local3 * _local1);
animY[mc][_local1] = _local6 + (_local4 * _local1);
animScale[mc][_local1] = ((_local1 == 0) ? 100 : (animScale[mc][_local1 - 1] - 5));
_local1++;
}
if (mcDecor.hitBg(x, y)) {
animX[mc][_local1] = x;
animY[mc][_local1] = y;
animScale[mc][_local1] = undefined;
_local1++;
} else {
var _local5 = false;
while ((animScale[mc][_local1 - 1] != undefined) && (_local1 <= 20)) {
animX[mc][_local1] = animX[mc][_local1 - 1] + _local3;
animY[mc][_local1] = animY[mc][_local1 - 1] + _local4;
if (_local5) {
animScale[mc][_local1] = animScale[mc][_local1 - 1] - 5;
} else if (animX[mc][_local1] == animX[mc][_local1 - 1]) {
_local5 = true;
if (mcDecor.hitBg(animX[mc][_local1], animY[mc][_local1])) {
animScale[mc][_local1] = undefined;
} else {
animScale[mc][_local1] = animScale[mc][_local1 - 1] - 5;
}
} else {
_local3 = Math.floor(_local3 / 2);
_local4 = Math.floor(_local4 / 2);
animScale[mc][_local1] = animScale[mc][_local1 - 1] - 5;
}
_local1++;
}
}
animX[mc][_local1] = undefined;
animY[mc][_local1] = undefined;
currentFrame[mc] = 0;
}
function animateShoot(mc) {
if ((currentFrame != undefined) && (currentFrame[mc] != -1)) {
var _local2 = currentFrame[mc];
if (_local2 == 0) {
mc.gotoAndPlay("playSound");
}
if (animX[mc][_local2] == undefined) {
currentFrame[mc] = -1;
} else if (animScale[mc][_local2] == undefined) {
mc._x = animX[mc][_local2];
mc._y = animY[mc][_local2];
var _local3 = hitHole(mc._x, mc._y);
if (_local3 == null) {
mc.gotoAndPlay("splat");
if (hitsInARow > bestHitsInARow) {
bestHitsInARow = hitsInARow;
}
hitsInARow = 0;
if (inFuryMode) {
stopHoleEngine();
holePlacingINterval = holePlacingINterval * 2;
startHoleEngine();
}
inFuryMode = false;
} else {
hitsInARow++;
if ((!inFuryMode) && (hitsInARow >= hitsToFuryMode)) {
stopHoleEngine();
holePlacingInterval = holePlacingInterval / 2;
startHoleEngine();
inFuryMode = true;
}
dtPoints.text = (Number(dtPoints.text) + 1231) + (57 * hitsInARow);
mc.gotoAndStop("out");
var _local4 = getEndingHole(_local3);
_local4._x = _local3._x;
_local4._y = _local3._y;
_local4.light(holePositions[_local3].light);
holePositions[_local4] = holePositions[_local3];
_local4.gotoAndPlay("anim");
hideHole(_local3);
placeHole(_local3);
subHoles(1);
}
currentFrame[mc] = -1;
} else {
mc._x = animX[mc][_local2];
mc._y = animY[mc][_local2];
mc._xscale = animScale[mc][_local2];
mc._yscale = animScale[mc][_local2];
currentFrame[mc] = _local2 + 1;
}
}
}
function hitHole(x, y) {
if (holeIsShown(mcHole1) && (mcHole1.hitTest(x, y, false))) {
return(mcHole1);
}
if (holeIsShown(mcHole2) && (mcHole2.hitTest(x, y, false))) {
return(mcHole2);
}
if (holeIsShown(mcHole3) && (mcHole3.hitTest(x, y, false))) {
return(mcHole3);
}
if (holeIsShown(mcHole4) && (mcHole4.hitTest(x, y, false))) {
return(mcHole4);
}
if (holeIsShown(mcHole5) && (mcHole5.hitTest(x, y, false))) {
return(mcHole5);
}
if (holeIsShown(mcHole6) && (mcHole6.hitTest(x, y, false))) {
return(mcHole6);
}
if (holeIsShown(mcHole7) && (mcHole7.hitTest(x, y, false))) {
return(mcHole7);
}
return(null);
}
function mouseOverMenu() {
return(_ymouse >= 360);
}
function onEverySecond() {
currentTime = getTimer();
var _local2 = maxTime - (currentTime - startTime);
if (_local2 <= 0) {
clearInterval(iID);
iID = undefined;
} else {
var _local1 = Math.floor(_local2 / 60000);
dtTime.text = _local1 + ":";
_local1 = Math.floor(_local2 / 1000);
_local1 = _local1 % 60;
if (_local1 < 10) {
dtTime.text = (dtTime.text + "0") + _local1;
} else {
dtTime.text = dtTime.text + _local1;
}
}
}
function startTimer() {
iID = setInterval(onEverySecond, 250);
}
function stopTimer() {
clearInterval(iID);
}
function setTimer(m, s) {
maxTime = ((1000 * s) + (m * 60000)) + 1000;
if (iID != undefined) {
clearInterval(iID);
}
}
function newSilk() {
nextSilkBall = nextSilk[nextSilkBall];
}
function silkReady(mc) {
return(currentFrame[mc] == -1);
}
function holeEngine() {
var _local2;
var _local3 = false;
var _local1 = 1;
var _local4 = Math.min(simultaneousHoles, holesToShow);
while ((!_local3) && (_local1 <= _local4)) {
_local2 = getNthHole(_local1);
if (!holeIsShown(_local2)) {
showHole(_local2);
holesToShow--;
_local3 = true;
if (((_local1 == 1) || (_local1 == 4)) && (!mcWasp1.isFlying())) {
mcWasp1._x = _local2._x;
mcWasp1._y = _local2._y;
mcWasp1.gotoAndPlay("play");
}
} else {
_local1++;
}
}
}
function startHoleEngine() {
ihID = setInterval(holeEngine, holePlacingInterval);
}
function stopHoleEngine() {
clearInterval(ihID);
}
function getNthHole(n) {
if (n == null) {
return(null);
}
var _local1;
switch (n) {
case 1 :
_local1 = mcHole1;
break;
case 2 :
_local1 = mcHole2;
break;
case 3 :
_local1 = mcHole3;
break;
case 4 :
_local1 = mcHole4;
break;
case 5 :
_local1 = mcHole5;
break;
case 6 :
_local1 = mcHole6;
break;
case 7 :
_local1 = mcHole7;
break;
default :
_local1 = null;
}
return(_local1);
}
function getNthEndingHole(n) {
if (n == null) {
return(null);
}
var _local1;
switch (n) {
case 1 :
_local1 = mcHole1End;
break;
case 2 :
_local1 = mcHole2End;
break;
case 3 :
_local1 = mcHole3End;
break;
case 4 :
_local1 = mcHole4End;
break;
case 5 :
_local1 = mcHole5End;
break;
case 6 :
_local1 = mcHole6End;
break;
case 7 :
_local1 = mcHole7End;
break;
default :
_local1 = null;
}
return(_local1);
}
function getEndingHole(mc) {
if (mc == null) {
return(null);
}
var _local1;
switch (mc) {
case mcHole1 :
_local1 = mcHole1End;
break;
case mcHole2 :
_local1 = mcHole2End;
break;
case mcHole3 :
_local1 = mcHole3End;
break;
case mcHole4 :
_local1 = mcHole4End;
break;
case mcHole5 :
_local1 = mcHole5End;
break;
case mcHole6 :
_local1 = mcHole6End;
break;
case mcHole7 :
_local1 = mcHole7End;
break;
default :
_local1 = null;
}
return(_local1);
}
function onReload() {
mcReload.gotoAndPlay("out");
setSilk(silkMax);
}
function onGameOver() {
_global.main.scoreFinale = Number(dtPoints.text);
var _local2 = new String();
if ((level >= 4) && (hitsInARow >= 10)) {
_local2 = "youRock";
} else if ((level >= 3) && (hitsInARow >= 5)) {
_local2 = "goodJob";
} else {
_local2 = "youCanDoBetter";
}
main.gameOverMessage = _local2;
Mouse.show();
mcDecor.gotoAndPlay("doom2");
gotoAndPlay ("gameover");
}
function setGoal(h, sh, hi, m, s, bg, l) {
if ((((((h <= 0) || (m < 0)) || (s > 59)) || (s < 0)) || ((s + m) == 0)) || (hi <= 0)) {
return(false);
}
setHoles(h);
setTimer(m, s);
simultaneousHoles = sh;
holePlacingInterval = hi;
currentBg = bg;
lastLevel = level;
level = l;
var _local1 = 1;
while (_local1 <= 7) {
placeHole(getNthHole(_local1));
_local1++;
}
return(true);
}
function goalCompleted() {
return(getHoles() == 0);
}
function placeHole(mc) {
var _local2 = holePlaces[currentBg];
var _local1 = Math.round(Math.random() * (_local2.length - 1));
while (_local2[_local1].user != null) {
_local1++;
if (_local1 >= _local2.length) {
_local1 = 0;
}
}
mc._x = _local2[_local1].x;
mc._y = _local2[_local1].y;
mc.light(_local2[_local1].light);
_local2[_local1].user = mc;
if (holePositions[mc] != null) {
holePositions[mc].user = null;
}
holePositions[mc] = _local2[_local1];
}
function showHole(mc) {
mc.gotoAndPlay("in");
}
function holeIsShown(mc) {
return(mc._currentframe != 2);
}
function hideHole(mc) {
mc.gotoAndStop("stop");
}
function startStage(n) {
if (n <= 0) {
return(false);
}
stage = n;
var _local6 = 20 + (10 * n);
var _local9 = 7;
var _local4 = 1100 - (100 * n);
if (_local4 < 200) {
_local4 = 200;
}
var _local2 = 80 - (5 * n);
if (_local2 < 30) {
_local2 = 30;
}
var _local7 = Math.floor(_local2 / 60);
var _local10 = _local2 - (_local7 * 60);
var _local8 = n % 3;
var _local5 = ((_local8 == 0) ? 3 : (_local8));
if (n > 3) {
var _local3 = Math.floor((n - 1) / 3) + 2;
} else if ((n == 2) || (n == 3)) {
var _local3 = 2;
} else {
var _local3 = 1;
}
holesToShow = _local6;
mcDecor.setBgReadyCallBack(onSettedGoal);
setGoal(_local6, _local9, _local4, _local7, _local10, _local5, _local3);
mcDecor.gotoAndStop("normal");
if (lastLevel != level) {
mcLevel.gotoLevel(_local3);
} else {
mcDecor.gotoBg(_local5);
}
return(true);
}
function onSettedGoal() {
if (lactLevel != level) {
mcDecor.gotoDirectBg(currentBg);
}
startTime = getTimer();
startTimer();
startHoleEngine();
inGame = true;
inFuryMode = false;
inDangerMode = false;
lastImpact.x = 0;
lastImpact.y = 0;
}
function stopStage() {
inGame = false;
stopTimer();
stopHoleEngine();
mcDecor.gotoAndStop("normal");
var _local1 = 1;
while (_local1 <= 7) {
hideHole(getNthEndingHole(_local1));
hideHole(getNthHole(_local1));
_local1++;
}
mcSilkBall1.gotoAndStop("out");
mcSilkBall2.gotoAndStop("out");
mcSilkBall3.gotoAndStop("out");
mcSilkBall4.gotoAndStop("out");
mcSilkBall5.gotoAndStop("out");
}
function goalReached() {
return((Number(dtHoles.text) == 0) && (dtTime.text != "0:00"));
}
function goalFailed() {
return((maxTime - (currentTime - startTime)) < 0);
}
function cursorOnRollOver() {
if (inGame) {
mcCursor.gotoAndPlay("anim");
}
}
function cursorOnRollOut() {
if (inGame) {
mcCursor.gotoAndStop("stop");
}
}
function init() {
var _local2;
var _local1 = 1;
while (_local1 <= 7) {
_local2 = getNthHole(_local1);
_local2.onRollOver = cursorOnRollOver;
_local2.onRollOut = cursorOnRollOut;
_local1++;
}
startStage(1);
}
stop();
_global.game = this;
var par = _parent;
var muted = false;
var silkMax = (mcBar._totalframes - 1);
var thisMc = this;
var startTime;
var currentTime;
var maxTime;
var iID = undefined;
var holdSpace = false;
var currentBg = 1;
var stage;
var lastLevel = 0;
var level = 0;
var inDangerMode = false;
var lastImpact = Object();
var inFuryMode = false;
var hitsToFuryMode = 3;
var bestHitsInARow = 0;
var hitsInARow = 0;
var holesToShow = 0;
var inGame = false;
var simultaneousHoles = 3;
var holePlacingInterval = 1000;
var ihID = null;
var holePositions = new Array();
var holePlaces = new Array();
holePlaces[1] = [{x:33, y:39, user:null, light:false}, {x:38, y:86, user:null, light:false}, {x:78, y:90, user:null, light:false}, {x:78, y:48, user:null, light:false}, {x:88, y:120, user:null, light:false}, {x:111, y:161, user:null, light:false}, {x:96, y:205, user:null, light:false}, {x:145, y:223, user:null, light:false}, {x:107, y:258, user:null, light:false}, {x:157, y:253, user:null, light:false}, {x:108, y:298, user:null, light:false}, {x:153, y:309, user:null, light:false}, {x:463, y:223, user:null, light:false}, {x:420, y:205, user:null, light:false}, {x:375, y:168, user:null, light:false}, {x:323, y:132, user:null, light:false}, {x:311, y:63, user:null, light:false}, {x:359, y:77, user:null, light:false}, {x:439, y:72, user:null, light:false}, {x:459, y:112, user:null, light:false}, {x:455, y:169, user:null, light:false}, {x:484, y:322, user:null, light:false}, {x:489, y:282, user:null, light:false}, {x:548, y:268, user:null, light:false}, {x:532, y:223, user:null, light:false}, {x:537, y:174, user:null, light:false}, {x:533, y:98, user:null, light:false}, {x:534, y:51, user:null, light:false}];
holePlaces[2] = [{x:29, y:29, user:null, light:true}, {x:111, y:31, user:null, light:true}, {x:105, y:205, user:null, light:true}, {x:116, y:259, user:null, light:true}, {x:32, y:209, user:null, light:false}, {x:49, y:249, user:null, light:false}, {x:59, y:293, user:null, light:false}, {x:103, y:309, user:null, light:false}, {x:151, y:322, user:null, light:false}, {x:212, y:223, user:null, light:false}, {x:266, y:209, user:null, light:false}, {x:201, y:183, user:null, light:false}, {x:246, y:159, user:null, light:false}, {x:198, y:153, user:null, light:false}, {x:209, y:108, user:null, light:false}, {x:175, y:70, user:null, light:false}, {x:214, y:36, user:null, light:false}, {x:298, y:113, user:null, light:false}, {x:462, y:146, user:null, light:false}, {x:522, y:86, user:null, light:false}, {x:538, y:195, user:null, light:false}, {x:548, y:238, user:null, light:false}, {x:502, y:263, user:null, light:false}, {x:524, y:307, user:null, light:false}, {x:484, y:344, user:null, light:false}, {x:460, y:197, user:null, light:false}, {x:407, y:218, user:null, light:false}];
holePlaces[3] = [{x:68, y:79, user:null, light:false}, {x:110, y:87, user:null, light:false}, {x:64, y:118, user:null, light:false}, {x:107, y:119, user:null, light:false}, {x:162, y:102, user:null, light:false}, {x:156, y:134, user:null, light:false}, {x:140, y:169, user:null, light:false}, {x:220, y:134, user:null, light:false}, {x:238, y:169, user:null, light:false}, {x:271, y:143, user:null, light:false}, {x:301, y:186, user:null, light:false}, {x:338, y:166, user:null, light:false}, {x:375, y:191, user:null, light:false}, {x:409, y:201, user:null, light:false}, {x:453, y:218, user:null, light:false}, {x:108, y:325, user:null, light:true}, {x:34, y:32, user:null, light:false}, {x:519, y:32, user:null, light:false}, {x:525, y:69, user:null, light:false}, {x:572, y:29, user:null, light:false}];
var nextSilkBall;
nextSilkBall = mcSilkBall1;
var nextSilk = new Array();
nextSilk[mcSilkBall1] = mcSilkBall2;
nextSilk[mcSilkBall2] = mcSilkBall3;
nextSilk[mcSilkBall3] = mcSilkBall4;
nextSilk[mcSilkBall4] = mcSilkBall5;
nextSilk[mcSilkBall5] = mcSilkBall1;
var animX = new Array();
animX[mcSilkBall1] = new Array();
animX[mcSilkBall4] = new Array();
animX[mcSilkBall5] = new Array();
animX[mcSilkBall2] = new Array();
animX[mcSilkBall3] = new Array();
var animY = new Array();
animY[mcSilkBall1] = new Array();
animY[mcSilkBall4] = new Array();
animY[mcSilkBall5] = new Array();
animY[mcSilkBall2] = new Array();
animY[mcSilkBall3] = new Array();
var animScale = new Array();
animScale[mcSilkBall1] = new Array();
animScale[mcSilkBall4] = new Array();
animScale[mcSilkBall5] = new Array();
animScale[mcSilkBall2] = new Array();
animScale[mcSilkBall3] = new Array();
var silkRotation = new Array();
var currentFrame = new Array();
currentFrame[mcSilkBall1] = -1;
currentFrame[mcSilkBall4] = -1;
currentFrame[mcSilkBall5] = -1;
currentFrame[mcSilkBall2] = -1;
currentFrame[mcSilkBall3] = -1;
dtHoles.text = 0;
dtPoints.text = 0;
onKeyDown = function () {
var _local1 = Key.getCode();
if (inGame) {
switch (_local1) {
case 32 :
if ((!holdSpace) && (getSilk() == 0)) {
onReload();
}
holdSpace = true;
break;
case 13 :
}
}
};
onKeyUp = function () {
if (inGame) {
holdSpace = false;
}
};
onMouseMove = function () {
if (inGame) {
if (mouseOverMenu()) {
Mouse.show();
} else {
Mouse.hide();
mcCursor._x = _xmouse;
mcCursor._y = _ymouse;
mcCannon.moveCannon();
}
}
};
mcReload.onRelease = function () {
onReload();
};
onMouseDown = function () {
if (inGame) {
var _local2 = _xmouse;
var _local1 = _ymouse;
if ((((getSilk() > 0) && (!mouseOverMenu())) && (!mcReload.hitTest(_xmouse, _ymouse, false))) && (silkReady(nextSilkBall))) {
mcCannon.shoot();
shoot(nextSilkBall, _local2, _local1);
newSilk();
subSilk(8);
}
}
};
onEnterFrame = function () {
if (inGame) {
if (goalFailed()) {
stopStage();
onGameOver();
} else if (goalReached()) {
stopStage();
startStage(stage + 1);
} else {
animateShoot(mcSilkBall4);
animateShoot(mcSilkBall5);
animateShoot(mcSilkBall1);
animateShoot(mcSilkBall2);
animateShoot(mcSilkBall3);
var _local4 = mcDecor.impactPosition;
if (inDangerMode) {
if (!((_local4.x == lastImpact.x) && (_local4.y == lastImpact.y))) {
lastImpact.x = _local4.x;
lastImpact.y = _local4.y;
var _local1;
var _local3;
var _local2 = 1;
while (_local2 <= 7) {
_local1 = getNthEndingHole(_local2);
if (!holeIsShown(_local1)) {
_local1 = getNthHole(_local2);
}
_local3 = holePositions[_local1];
_local1._x = _local3.x + lastImpact.x;
_local1._y = _local3.y + lastImpact.y;
_local2++;
}
}
} else if ((maxTime - (currentTime - startTime)) < 10000) {
mcDecor.gotoAndPlay("doom1");
inDangerMode = true;
}
}
}
};
btnMute.onRelease = function () {
if (sound.getVolume() != 0) {
sound.setVolume(0);
} else {
sound.setVolume(100);
}
trace(sound.getVolume());
};
onLoad = function () {
init();
};
Key.addListener(this);
Symbol 439 MovieClip Frame 53
_parent.gotoAndStop("gameover");