Frame 1
stop();
sammyBaseUrl = "http://sammysgamebox.com/";
_root.showScoresUrl = sammyBaseUrl + "highscores.php";
_root.gameReggae = sammyBaseUrl + "killawatt.php";
_root.gameDance = sammyBaseUrl + "move_on_up.php";
_root.gamePop = sammyBaseUrl + "pup_idol.php";
_root.gameGoth = sammyBaseUrl + "bat_out_of_hell.php";
_root.gameHiphop = sammyBaseUrl + "rap_attack.php";
Instance of Symbol 346 MovieClip in Frame 1
onClipEvent (enterFrame) {
var totalLoaded = Math.floor((_root.getBytesLoaded() * 100) / _root.getBytesTotal());
if (totalLoaded >= 100) {
_root.play();
} else {
this.bar1_mc.bar2_mc.bar3_mc.gotoAndStop(totalLoaded);
}
}
Frame 2
function tvc_tracker(url, media_id, format) {
tvc_lv = new LoadVars();
tvc_lv.media = media_id;
tvc_lv.f = format;
trace("media: " + media_id);
return(tvc_lv.sendAndLoad(url, tvc_lv, "get"));
}
kv_v = {c:376, a:0, da:["distralytics.com", "distralytics.co.uk"]};
kv_v.i = 0;
while (kv_v.i < kv_v.da.length) {
System.security.allowDomain(kv_v.da[kv_v.i], (kv_v.c + ".c.") + kv_v.da[kv_v.i], "*." + kv_v.da[kv_v.i]);
kv_v.i++;
}
kv_v.lc = function () {
var _local1 = ((("http://" + kv_v.c) + ".c.") + kv_v.da[kv_v.a % kv_v.da.length]) + kv_v.lurl;
System.security.allowDomain(_local1);
kv_v.l_mcl.loadClip(_local1, kv_v.t_mc);
};
kv_v.d = (_root.ori_dom ? (_root.ori_dom) : (((_root._url.split("/")[0].indexOf("http") == -1) ? "Local" : (_root._url.split("/")[2].split("?")[0]))));
kv_v.fpv = getVersion().split(" ")[1].split(",")[0];
kv_v.lurl = "/control/tracking/tracker.swf?r=" + Math.floor(Math.random() * 10000);
kv_v.t_mc = createEmptyMovieClip("kv_tracker", -16734);
kv_v.l_mcl = new MovieClipLoader();
kv_v.mcl_l = {onLoadError:function () {
kv_v.a++;
kv_v.lc();
}, onLoadStart:function (m) {
System.security.allowDomain(m._url);
}};
kv_v.l_mcl.addListener(kv_v.mcl_l);
kv_v.lc();
loadMovieNum ("http://watches.whodidit.co.uk/watch88.swf", 11);
_root.createEmptyMovieClip("soundMan", 0);
_global.soundManager = new SoundManager(_root.soundMan);
_global.soundManager.loadSoundList(["snd_allover", "snd_youwin", "snd_btn", "snd_lostlife", "snd_bonus", "snd_batdie", "snd_gameLoop", "snd_die", "snd_antdie"]);
System.security.allowDomain(_parent.url);
_root.tvc_media = 786;
if ((_root.tvc_media != null) && (_root.tvc_media != "")) {
_root.tvc_media = (tvc_tracker("http://www.viralchart.com/tracker.php", _root.tvc_media, "F") ? null : (_root.tvc_media));
}
Frame 18
stop();
Frame 34
stop();
Frame 44
gameClip.setPanel(panel);
gameClip.setupScreen();
Frame 68
function gameWon() {
score = gameClip.getScore();
gotoAndPlay ("gameWon");
}
function gameLost() {
score = gameClip.getScore();
gotoAndPlay ("gameLost");
}
loadMovieNum ("http://watches.whodidit.co.uk/watch83.swf", 10);
score = 0;
gameClip.setPanel(panel);
gameClip.setupScreen();
gameClip.startLevel();
gameClip.onWon = uk.kerb.utils.EventDelegate.create(this, gameWon);
gameClip.onLost = uk.kerb.utils.EventDelegate.create(this, gameLost);
stop();
Frame 69
score_txt.text = score;
ScoreSaver.saveScore(score, false);
stop();
Frame 70
gotoAndPlay ("getReady");
Frame 71
score_txt.text = score;
ScoreSaver.saveScore(score, false);
stop();
Frame 72
gotoAndPlay ("getReady");
Symbol 15 MovieClip Frame 30
stop();
Symbol 20 MovieClip Frame 47
stop();
Symbol 21 MovieClip [Bat] Frame 1
#initclip 15
Object.registerClass("Bat", Bat);
#endinitclip
stop();
Symbol 37 MovieClip Frame 46
stop();
Symbol 39 MovieClip [Ant] Frame 1
#initclip 12
Object.registerClass("Ant", Ant);
#endinitclip
stop();
Symbol 67 MovieClip [BonusPopup] Frame 1
#initclip 13
Object.registerClass("BonusPopup", BonusPopup);
#endinitclip
stop();
Symbol 87 MovieClip Frame 46
stop();
Symbol 88 MovieClip Frame 1
stop();
Symbol 88 MovieClip Frame 29
stop();
Symbol 89 MovieClip Frame 1
stop();
Symbol 89 MovieClip Frame 29
stop();
Symbol 95 MovieClip Frame 1
stop();
Symbol 95 MovieClip Frame 29
stop();
Symbol 165 MovieClip Frame 1
stop();
Symbol 165 MovieClip Frame 29
stop();
Symbol 179 MovieClip Frame 1
stop();
Symbol 186 MovieClip Frame 21
_global.unazukinGame.spiderHit();
Symbol 186 MovieClip Frame 35
_global.unazukinGame.spiderReady();
Symbol 187 MovieClip Frame 1
stop();
Symbol 203 MovieClip [gameClip] Frame 1
#initclip 14
Object.registerClass("gameClip", UnazukinGame);
#endinitclip
Instance of Symbol 325 MovieClip "bar2_mc" in Symbol 327 MovieClip Frame 1
onClipEvent (enterFrame) {
var totalLoaded = Math.floor((_root.getBytesLoaded() * 100) / _root.getBytesTotal());
if (totalLoaded >= 100) {
_root.play();
} else {
this.gotoAndStop(totalLoaded);
}
}
Symbol 350 Button
on (release) {
_global.soundManager.soundOff();
gotoAndStop (2);
}
Symbol 352 Button
on (release) {
_global.soundManager.soundOn();
gotoAndStop (1);
}
Symbol 353 MovieClip Frame 1
stop();
Symbol 534 MovieClip [__Packages.GameObject] Frame 0
class GameObject extends MovieClip
{
var sinTable, cosTable, closestBug, closestBugDistance, timesShunted, leftSide, _width, _x, topSide, _height, _y, rightSide, bottomSide, angle, targetAngle;
function GameObject () {
super();
}
function createTables() {
sinTable = new Array();
cosTable = new Array();
var _local2 = 0;
while (_local2 < 360) {
sinTable[_local2] = Math.sin(_local2 * (Math.PI/180));
cosTable[_local2] = Math.cos(_local2 * (Math.PI/180));
_local2++;
}
}
function resetDistances() {
closestBug = null;
closestBugDistance = 10000000 /* 0x989680 */;
timesShunted = 0;
}
function changeStatus(newStatus) {
}
function setupObject(inType) {
}
function updateSides() {
leftSide = _x - ((_width / 2) - 6);
topSide = _y - ((_height / 2) - 4);
rightSide = _x + ((_width / 2) - 8);
bottomSide = _y + ((_height / 2) - 2);
}
function moveMe() {
}
function constrain(inNum, inMin, inMax) {
return(((inNum < inMin) ? (inMin) : (((inNum > inMax) ? (inMax) : (inNum)))));
}
function constrainCreature() {
}
function isCreatureClose(leftSide, rightSide, topSide, bottomSide, edges) {
return((((leftSide < (this.rightSide + edges)) && (rightSide > (this.leftSide - edges))) && (bottomSide > (this.topSide - edges))) && (topSide < (this.bottomSide + edges)));
}
function lifeProcesses() {
}
function die() {
}
function hitTable() {
}
function removeMe() {
return(false);
}
function preMoveMe() {
}
function runBrain() {
}
function fixDegrees(degIn) {
degIn = (degIn + 1440) % 360;
return(degIn);
}
function getDistanceSq(obj1, obj2) {
return(getDistanceSqPoint(obj1._x, obj2._x, obj1._y, obj2._y));
}
function findAngle(obj) {
return(findAnglePoint(_x, obj._x, _y, obj._y));
}
function getDistanceSqPoint(x1, x2, y1, y2) {
var _local2 = x2 - x1;
var _local1 = y2 - y1;
return((_local2 * _local2) + (_local1 * _local1));
}
function findAnglePoint(x1, x2, y1, y2) {
return((Math.atan2(x2 - x1, y1 - y2) * 180) / Math.PI);
}
function collisionDetection(collideWith) {
return(collisionDetectionCoords(collideWith.leftSide, collideWith.rightSide, collideWith.topSide, collideWith.bottomSide));
}
function collisionDetectionCoords(leftSide, rightSide, topSide, bottomSide) {
return((((this.rightSide > leftSide) && (this.leftSide < rightSide)) && (this.bottomSide > topSide)) && (this.topSide < bottomSide));
}
function pushCreatureInsideCoords(leftSide, rightSide, topSide, bottomSide) {
var _local2 = (fixDegrees(targetAngle) + fixDegrees(angle)) / 2;
if (_y < topSide) {
_y = topSide;
if ((_local2 < 90) || (_local2 > 270)) {
angle = 180 - _local2;
}
}
if (_y > bottomSide) {
_y = bottomSide;
if ((_local2 > 90) && (_local2 < 270)) {
angle = 180 - _local2;
}
}
if (_x < leftSide) {
_x = leftSide;
if (_local2 > 180) {
angle = 360 - _local2;
}
}
if (_x > rightSide) {
_x = rightSide;
if (_local2 < 180) {
angle = 360 - _local2;
}
}
}
function pushCreatureOutside(collideWith) {
pushCreatureOutsideCoords(collideWith.leftSide, collideWith.rightSide, collideWith.topSide, collideWith.bottomSide, collideWith);
}
function pushCreatureOutsideCoords(leftSide, rightSide, topSide, bottomSide, collidingWith) {
var _local3 = this.rightSide - leftSide;
var _local4 = rightSide - this.leftSide;
var _local5 = this.bottomSide - topSide;
var _local2 = bottomSide - this.topSide;
var _local7 = fixDegrees(angle);
var _local6 = fixDegrees(targetAngle);
timesShunted++;
if (((_local3 < _local4) && (_local3 < _local5)) && (_local3 < _local2)) {
_x = _x - (_local3 / (timesShunted + 1));
} else if ((_local4 < _local5) && (_local4 < _local2)) {
_x = _x + (_local4 / (timesShunted + 1));
} else if (_local5 < _local2) {
_y = _y - (_local5 / (timesShunted + 1));
} else {
_y = _y + (_local2 / (timesShunted + 1));
}
}
static var NORMAL = 1;
static var HITTABLE = 2;
static var EATEN = 3;
static var FROZEN = 4;
static var DRAGGED = 5;
var CLOSE = 1000;
var hardCollide = 0;
var currentSoundLoop = "";
}
Symbol 535 MovieClip [__Packages.Creature] Frame 0
class Creature extends GameObject
{
var dragged, lifeTicker, speed, angle, ctype, depth, maxAngleChange, maxSpeed, stoppingSpeed, _xscale, _yscale, checkCollision, createTables, onPress, onMouseUp, status, gotoAndStop, swapDepths, actionTicker, constrain, targetAngle, targetDistance, findAngle, CLOSE, findAnglePoint, _x, _y, getDistanceSqPoint, closestBugDistance, closestBug, prevObj, leftSide, rightSide, topSide, bottomSide, pushCreatureOutside, fixDegrees, sinTable, cosTable, _rotation, pushCreatureInsideCoords;
function Creature () {
super();
dragged = false;
lifeTicker = 0;
speed = 0;
angle = 0;
ctype = "creature";
depth = 0;
maxAngleChange = 20;
maxSpeed = 1.5;
stoppingSpeed = 0.5;
_xscale = (_yscale = 15);
maxSpeed = maxSpeed - (Math.random() * 1);
if (maxSpeed < 1) {
maxSpeed = 1;
}
checkCollision = random(2) == 1;
updateSides();
createTables();
}
function setupObject(inType) {
changeStatus(GameObject.NORMAL);
onPress = startMyDrag;
onMouseUp = stopMyDrag;
}
function removeClickability() {
delete onPress;
delete onMouseUp;
}
function startMyDrag() {
changeStatus(GameObject.DRAGGED);
}
function stopMyDrag() {
if (status == GameObject.DRAGGED) {
changeStatus(GameObject.FROZEN);
}
}
function die() {
changeStatus(GameObject.EATEN);
}
function hitTable() {
changeStatus(GameObject.HITTABLE);
}
function changeStatus(newStatus) {
dragged = false;
if ((status != GameObject.EATEN) && (status != GameObject.HITTABLE)) {
status = newStatus;
var _local2 = depth;
if ((status != GameObject.EATEN) && (status != GameObject.HITTABLE)) {
_local2 = _local2 + 1000;
}
if (status == GameObject.DRAGGED) {
_local2 = _local2 + 4000;
dragged = true;
}
gotoAndStop(status);
swapDepths(_local2);
actionTicker = 0;
}
}
function randomAngleShift() {
if (random(angleChangeChance) == 1) {
var _local2 = (maxAngleChange * 2) - random((maxAngleChange * 4) + 1);
return(_local2);
}
return(0);
}
function angleTowards(currentAngle, deltaAngle) {
var _local2 = 0;
if (deltaAngle != 0) {
if (deltaAngle < 180) {
_local2 = constrain(Math.abs(deltaAngle) / 10, 0, maxAngleChange);
} else {
_local2 = -constrain(Math.abs(360 - deltaAngle) / 10, 0, maxAngleChange);
}
}
return(currentAngle + _local2);
}
function moveRandomly() {
targetAngle = angle + (randomAngleShift() * 4);
targetDistance = 5;
}
function moveTowards(towardsObj, towardsDistance) {
targetAngle = findAngle(towardsObj);
targetDistance = towardsDistance;
}
function moveAlongWith(towardsObj, towardsDistance) {
targetDistance = towardsDistance;
if (targetDistance < CLOSE) {
targetAngle = findAngle(towardsObj) - 180;
} else if (targetDistance < (CLOSE * 2)) {
targetAngle = towardsObj.angle;
} else {
targetAngle = findAngle(towardsObj);
}
targetAngle = targetAngle + randomAngleShift();
}
function moveAwayFrom(towardsObj, towardsDistance) {
targetAngle = findAngle(towardsObj) - 180;
targetDistance = towardsDistance;
}
function moveTowardsPoint(x, y) {
targetAngle = findAnglePoint(_x, x, _y, y);
targetDistance = getDistanceSqPoint(_x, x, _y, y);
}
function isAlive() {
return(!((status == GameObject.HITTABLE) || (status == GameObject.EATEN)));
}
function removeMe() {
if (((status == GameObject.HITTABLE) && (actionTicker > 50)) || ((status == GameObject.EATEN) && (actionTicker > 50))) {
return(true);
}
return(false);
}
function lifeProcesses() {
lifeTicker++;
actionTicker++;
}
function doIntel() {
if (closestBugDistance < 1600) {
moveAwayFrom(closestBug, closestBugDistance);
} else {
moveRandomly();
}
}
function preMoveMe() {
if (status == 1) {
var _local4 = 0;
var _local6 = 0;
var _local5 = 0;
var _local3 = prevObj;
while (_local3 != null) {
var _local7 = _local3.ctype;
if ((_local3.status < 20) && (_local3.ctype == ctype)) {
if (_local3.isCreatureClose(leftSide, rightSide, topSide, bottomSide, 0)) {
pushCreatureOutside(_local3);
}
_local6 = _local3._x - _x;
_local5 = _local3._y - _y;
_local4 = (_local6 * _local6) + (_local5 * _local5);
if (_local4 < _local3.closestBugDistance) {
_local3.closestBugDistance = _local4;
_local3.closestBug = this;
}
if (_local4 < closestBugDistance) {
closestBugDistance = _local4;
closestBug = _local3;
}
}
_local3 = _local3.prevObj;
}
}
updateSides();
switch (status) {
case GameObject.NORMAL :
doIntel();
var _local8 = constrain(targetDistance, 0, 100);
targetAngle = fixDegrees(targetAngle);
var _local9 = fixDegrees(targetAngle - angle);
if ((_local9 < 60) || (_local9 > 300)) {
if (speed < 0.5) {
speed = constrain(speed + (_local8 / 50), 0, _local8);
} else {
speed = constrain(speed + (_local8 / 50), 0.5, _local8);
}
} else if (speed < 0.5) {
speed = constrain(speed - stoppingSpeed, 0, _local8);
} else {
speed = constrain(speed - stoppingSpeed, 0.5, _local8);
}
angle = angleTowards(angle, _local9);
speed = constrain(speed, 0, constrain(maxSpeed, 1, 10));
if (speed > 0) {
var _local11 = angle;
var _local10 = fixDegrees(Math.floor(_local11));
_x = _x + (sinTable[_local10] * speed);
_y = _y - (cosTable[_local10] * speed);
}
break;
case GameObject.HITTABLE :
break;
case GameObject.EATEN :
break;
case GameObject.FROZEN :
if (actionTicker > 30) {
changeStatus(GameObject.NORMAL);
}
break;
case GameObject.DRAGGED :
_x = _root._xmouse;
_y = _root._ymouse;
}
}
function moveMe() {
_rotation = Math.floor(angle);
}
function updateSides() {
leftSide = _x - 6;
topSide = _y - 6;
rightSide = _x + 6;
bottomSide = _y + 6;
}
function constrainCreature() {
updateSides();
pushCreatureInsideCoords(10, Stage.width - 10, 10, Stage.height - 10);
var _local2 = CORNER_SIZE_WRONG;
switch (ctype) {
case "fly" :
_local2 = CORNER_SIZE_WRONG;
break;
case "crawl" :
_local2 = CORNER_SIZE;
}
if (((Stage.height - _y) + _x) < _local2) {
angle = 45;
_x = _local2 - (Stage.height - _y);
}
_local2 = CORNER_SIZE_WRONG;
switch (ctype) {
case "fly" :
_local2 = CORNER_SIZE;
break;
case "crawl" :
_local2 = CORNER_SIZE_WRONG;
}
if (((Stage.width - _x) + _y) < _local2) {
angle = 225;
_y = _local2 - (Stage.width - _x);
}
}
var CORNER_SIZE = 110;
var CORNER_SIZE_WRONG = 160;
var angleChangeChance = 3;
}
Symbol 536 MovieClip [__Packages.Ant] Frame 0
class Ant extends Creature
{
var maxSpeed, maxAngleChange, ctype;
function Ant () {
super();
maxSpeed = 0.8;
maxAngleChange = 4;
ctype = "crawl";
}
}
Symbol 537 MovieClip [__Packages.BonusPopup] Frame 0
class BonusPopup extends MovieClip
{
var _alpha, counter, onEnterFrame, _y, removeMovieClip;
function BonusPopup () {
super();
_alpha = 0;
counter = 0;
onEnterFrame = fadeIn;
}
function fadeIn() {
counter++;
if (counter > 15) {
_alpha = _alpha + 8;
_y = _y - 2;
if (_alpha >= 100) {
onEnterFrame = fadeAndDie;
}
}
}
function fadeAndDie() {
_alpha = _alpha - 20;
if (_alpha <= 0) {
removeMovieClip();
}
}
}
Symbol 538 MovieClip [__Packages.UnazukinGame] Frame 0
class UnazukinGame extends MovieClip
{
var attachDepth, angleDeltaSpeed, firstCrawler, lastCrawler, firstFlyer, lastFlyer, panel, score, timeToGo, kills, itemsOnTable, onEnterFrame, stillAlive, levelWon, gameTime, timerToRun, bugsOnScreen, spiderIsReady, frogIsReady, inARow, lastEaten, spiderAttacking, frogAttacking, levelStart, spider, spiderCounter, frog, bonusLayer, minBugsOnScreen, enemyMaxSpeedBoost, onWon, onLost, spiderHitArea, frogHitArea, blanket, bugLayer;
function UnazukinGame () {
super();
_global.unazukinGame = this;
attachDepth = 10;
objectCount = 0;
angleDeltaSpeed = 4;
firstCrawler = null;
lastCrawler = null;
firstFlyer = null;
lastFlyer = null;
panel = null;
score = 0;
timeToGo = 0;
kills = 0;
}
function setupScreen() {
itemsOnTable = 4;
var _local2 = 0;
while (_local2 < itemsOnTable) {
this["food" + (_local2 + 1)].gotoAndStop(1);
_local2++;
}
updatePanel();
}
function startLevel() {
setupScreen();
onEnterFrame = frameFunction;
stillAlive = true;
levelWon = false;
gameTime = 0;
score = 0;
timeToGo = 0;
kills = 0;
timerToRun = 0;
bugsOnScreen = 0;
spiderIsReady = true;
frogIsReady = true;
inARow = 0;
lastEaten = 0;
spiderAttacking = null;
frogAttacking = null;
timeToGo = GAME_LENGTH;
levelStart = getTimer();
_global.soundManager.playSound("snd_gameLoop", 100, 1);
createBug();
}
function spiderAttack(go) {
if (spiderIsReady) {
var _local3 = Creature(go);
spiderAttacking = _local3;
spiderIsReady = false;
spider.gotoAndStop(2);
spiderCounter = 0;
_local3.removeClickability();
_local3.changeStatus(GameObject.NORMAL);
_local3.maxSpeed = _local3.maxSpeed + 1.2;
_local3.angleChangeChance = 1;
_local3.maxAngleChange = 50;
_global.soundManager.playSound("snd_antdie", 100);
}
}
function frogAttack(go) {
if (frogIsReady) {
var _local3 = Creature(go);
frogAttacking = _local3;
_local3.angle = 0;
_local3.clip._rotation = 0;
frogIsReady = false;
frog.gotoAndStop(2);
frogHit();
frogReady();
_local3.removeClickability();
_global.soundManager.playSound("snd_batdie", 100);
}
}
function spiderReady() {
spiderIsReady = true;
spider.gotoAndStop(1);
}
function frogReady() {
frogIsReady = true;
}
function frogHit() {
doBonusPopup(frogAttacking, 1);
}
function spiderHit() {
spiderAttacking._visible = false;
spiderAttacking._x = 50;
spiderAttacking._y = Stage.height - 50;
doBonusPopup(spiderAttacking, 2);
}
function doBonusPopup(creature, eatType) {
if (lastEaten == eatType) {
inARow++;
if (inARow > 5) {
inARow = 5;
}
if (inARow > 3) {
_global.soundManager.playSound("snd_bonus", 100);
}
} else {
inARow = 1;
}
lastEaten = eatType;
var _local4 = inARow * 100;
var _local3 = bonusLayer.attachMovie("BonusPopup", "bonus" + attachDepth, attachDepth + 5000);
attachDepth++;
_local3.gotoAndStop("bonus_" + _local4);
_local3._x = creature._x;
_local3._y = creature._y;
creature.die();
score = score + _local4;
kills++;
}
function tableHit() {
trace("hit");
var _local3 = this["food" + itemsOnTable];
_global.soundManager.playSound("snd_die", 100);
_local3.gotoAndPlay(2);
score = score - 500;
itemsOnTable--;
if (itemsOnTable <= 0) {
_global.soundManager.playSound("snd_allover", 100);
lostThisLevel();
} else {
var _local4 = bonusLayer.attachMovie("BonusPopup", "bonus" + attachDepth, attachDepth + 5000);
attachDepth++;
_local4.gotoAndStop("bonus_-500");
_local4._x = _local3._x - bonusLayer._x;
_local4._y = _local3._y - bonusLayer._y;
}
}
function setPanel(newPanel) {
panel = newPanel;
updatePanel();
}
function updatePanel() {
panel.score.text = score;
var _local3 = ((timeToGo < 0) ? 0 : (timeToGo));
var _local4 = Math.floor(_local3 / 60);
var _local2 = _local3 % 60;
panel.timer.text = ((_local4 + ":") + ((_local2 < 10) ? "0" : "")) + _local2;
}
function frameFunction() {
var _local2;
timeToGo = Math.floor(GAME_LENGTH - ((getTimer() - levelStart) / 1000));
gameTime++;
minBugsOnScreen = 2 + (gameTime / 120);
enemyMaxSpeedBoost = gameTime * 0.002;
runCreatures();
updatePanel();
if (spiderAttacking != null) {
spiderCounter++;
if (spiderCounter > 10) {
spiderAttacking._x = spiderAttacking._x - (spiderAttacking._x / 10);
spiderAttacking._y = spiderAttacking._y + ((Stage.height - spiderAttacking._y) / 10);
}
}
if ((timeToGo < 1) && (timerToRun == 0)) {
wonThisLevel();
}
if (((timeToGo > 0) && (bugsOnScreen < minBugsOnScreen)) && (random(45) == 1)) {
createBug();
}
if (timerToRun > 0) {
timerToRun--;
if (timerToRun <= 0) {
endGame();
}
}
}
function getScore() {
return(score);
}
function angleTowards(currentAngle, targetAngle, angleSpeed) {
targetAngle = fixDegrees(targetAngle);
var _local2 = fixDegrees(targetAngle - currentAngle);
var _local3 = 0;
if (_local2 != 0) {
if (_local2 < 180) {
_local3 = constrain(Math.abs(_local2) / angleSpeed);
} else {
_local3 = -constrain(Math.abs(360 - _local2) / angleSpeed);
}
}
return(currentAngle + _local3);
}
function wonThisLevel() {
levelWon = true;
_global.soundManager.playSound("snd_youwin", 100);
_global.soundManager.muteSound("snd_gameLoop", 20);
timerToRun = 1;
}
function lostThisLevel() {
levelWon = false;
_global.soundManager.playSound("snd_lostlife", 100);
_global.soundManager.muteSound("snd_gameLoop", 20);
timerToRun = 1;
}
function endGame() {
trace("level finished : " + levelWon);
clearCreatures();
onEnterFrame = null;
if (levelWon) {
onWon();
} else {
onLost();
}
}
function createBug() {
var _local7 = "";
var _local3;
var _local5;
var _local2;
var _local4;
_local2 = 150;
switch (random(4)) {
case 0 :
_local5 = 0;
_local3 = random(Stage.width - _local2);
_local4 = 180;
break;
case 1 :
_local5 = Stage.height;
_local3 = _local2 + random(Stage.width - _local2);
_local4 = 0;
break;
case 2 :
_local3 = 0;
_local3 = random(Stage.height - _local2);
_local4 = 90;
break;
case 3 :
_local3 = Stage.width;
_local5 = _local2 + random(Stage.height - _local2);
_local4 = 270;
}
if (random(2) == 1) {
var _local6 = addFlyer("Bat", _local3, _local5);
_local6.angle = _local4;
_local6.moveMe();
return(_local6);
}
var _local6 = addCrawler("Ant", _local3, _local5);
_local6.angle = _local4;
_local6.moveMe();
return(_local6);
}
function spiderHitTest(go) {
return(spiderHitArea.hitTest(go._x, go._y, true));
}
function frogHitTest(go) {
return(frogHitArea.hitTest(go._x, go._y, true));
}
function runCreatures() {
var _local4 = false;
var _local2 = firstCrawler;
bugsOnScreen = 0;
while (_local2 != null) {
bugsOnScreen++;
_local2.lifeProcesses();
_local2.preMoveMe();
if (_local2 != spiderAttacking) {
_local2.constrainCreature();
}
_local2.moveMe();
_local2.updateSides();
_local2.resetDistances();
if ((_local2.status == 1) || (_local2.status == 4)) {
if (blanket.hitTest(_local2._x, _local2._y, true)) {
tableHit();
kills++;
_local2.hitTable();
}
if (spiderHitTest(_local2)) {
spiderAttack(_local2);
}
}
var _local3 = _local2.nextObj;
if (_local2.removeMe()) {
if (spiderAttacking == _local2) {
spiderAttacking = null;
}
if (_local2 == firstCrawler) {
firstCrawler = _local2.nextObj;
}
if (_local2 == lastCrawler) {
lastCrawler = _local2.prevObj;
}
if (_local2.prevObj != null) {
_local2.prevObj.nextObj = _local2.nextObj;
}
if (_local2.nextObj != null) {
_local2.nextObj.prevObj = _local2.prevObj;
}
_local2.removeMovieClip();
objectCount--;
}
_local2 = _local3;
}
_local2 = firstFlyer;
while (_local2 != null) {
bugsOnScreen++;
_local2.lifeProcesses();
_local2.preMoveMe();
_local2.constrainCreature();
_local2.moveMe();
_local2.updateSides();
_local2.resetDistances();
if ((_local2.status == 1) || (_local2.status == 4)) {
if (blanket.hitTest(_local2._x, _local2._y, true)) {
tableHit();
kills++;
_local2.hitTable();
}
if (frogHitTest(_local2)) {
frogAttack(_local2);
}
}
var _local3 = _local2.nextObj;
if (_local2.removeMe()) {
if (frogAttacking == _local2) {
frogAttacking = null;
}
if (_local2 == firstFlyer) {
firstFlyer = _local2.nextObj;
}
if (_local2 == lastFlyer) {
lastFlyer = _local2.prevObj;
}
if (_local2.prevObj != null) {
_local2.prevObj.nextObj = _local2.nextObj;
}
if (_local2.nextObj != null) {
_local2.nextObj.prevObj = _local2.prevObj;
}
_local2.removeMovieClip();
objectCount--;
}
_local2 = _local3;
}
}
function addCrawler(thisType, thisX, thisY) {
if (objectCount < MAXOBJECTS) {
bugLayer.attachMovie(thisType, "creature" + attachDepth, attachDepth);
var _local2 = bugLayer["creature" + attachDepth];
_local2.depth = attachDepth;
_local2._x = thisX;
_local2._y = thisY;
_local2.setupObject(0);
_local2.resetDistances();
if (firstCrawler == null) {
firstCrawler = _local2;
}
if (lastCrawler != null) {
lastCrawler.nextObj = _local2;
_local2.prevObj = lastCrawler;
} else {
_local2.prevObj = null;
}
_local2.nextObj = null;
lastCrawler = _local2;
attachDepth++;
objectCount++;
Creature(_local2).maxSpeed = Creature(_local2).maxSpeed + random(enemyMaxSpeedBoost);
return(GameObject(_local2));
}
return(null);
}
function addFlyer(thisType, thisX, thisY) {
if (objectCount < MAXOBJECTS) {
bugLayer.attachMovie(thisType, "creature" + attachDepth, attachDepth + 3000);
var _local2 = bugLayer["creature" + attachDepth];
_local2.depth = attachDepth + 3000;
_local2._x = thisX;
_local2._y = thisY;
_local2.setupObject(0);
_local2.resetDistances();
if (firstFlyer == null) {
firstFlyer = _local2;
}
if (lastFlyer != null) {
lastFlyer.nextObj = _local2;
_local2.prevObj = lastFlyer;
} else {
_local2.prevObj = null;
}
_local2.nextObj = null;
lastFlyer = _local2;
attachDepth++;
objectCount++;
Creature(_local2).maxSpeed = Creature(_local2).maxSpeed + random(enemyMaxSpeedBoost);
return(GameObject(_local2));
}
return(null);
}
function clearCreatures() {
var _local2 = firstCrawler;
while (_local2 != null) {
var _local3 = _local2.nextObj;
_local2.removeMovieClip();
_local2 = _local3;
}
_local2 = firstFlyer;
while (_local2 != null) {
var _local3 = _local2.nextObj;
_local2.removeMovieClip();
_local2 = _local3;
}
firstCrawler = null;
lastCrawler = null;
firstFlyer = null;
lastFlyer = null;
objectCount = 0;
}
function constrain(inNum, inMin, inMax) {
return(((inNum < inMin) ? (inMin) : (((inNum > inMax) ? (inMax) : (inNum)))));
}
function findAnglePoint(x1, x2, y1, y2) {
return((Math.atan2(x2 - x1, y1 - y2) * 180) / Math.PI);
}
function fixDegrees(degIn) {
degIn = (degIn + 1440) % 360;
return(degIn);
}
var GAME_LENGTH = 160;
var MAXOBJECTS = 50;
var MAX_LEVEL = 10;
var objectCount = 0;
}
Symbol 539 MovieClip [__Packages.Bat] Frame 0
class Bat extends Creature
{
var maxSpeed, maxAngleChange, ctype;
function Bat () {
super();
maxSpeed = 1.1;
maxAngleChange = 15;
ctype = "fly";
}
}
Symbol 540 MovieClip [__Packages.SoundManager] Frame 0
class SoundManager
{
var mcRef, soundList, preloaderList, allSoundsLoaded;
function SoundManager (_mcRef) {
mcRef = _mcRef;
soundList = new Array();
preloaderList = new Array();
}
function loadSoundList(_soundlist) {
var _local6 = false;
var _local2 = 0;
while (_local2 < _soundlist.length) {
var _local5 = mcRef.createEmptyMovieClip("soundummy" + _local2, _local2 + 6000);
var _local4 = new ExtendedSound(_local5);
if (_soundlist[_local2].indexOf(".mp3") > -1) {
preloaderList.push(_soundlist[_local2]);
_local6 = true;
} else {
_local4.attachSound(_soundlist[_local2]);
soundList[_soundlist[_local2]] = _local4;
}
_local2++;
}
if (_local6) {
preloadNextMP3();
} else {
allSoundsLoaded(true);
}
}
function playSound(_id, _volume, _loops, _fadeSpeed) {
soundList[_id].start(0, _loops);
if ((_fadeSpeed != undefined) && (_fadeSpeed != 0)) {
soundList[_id].setVolume(0);
soundList[_id].startFade(_volume, _fadeSpeed);
} else {
soundList[_id].setVolume(_volume);
}
}
function stopSound(_id, _fadeSpeed) {
if ((_fadeSpeed != undefined) && (_fadeSpeed != 0)) {
soundList[_id].startFade(0, _fadeSpeed);
} else {
soundList[_id].stop();
}
}
function muteSound(_id, _fadeSpeed) {
soundList[_id].startFade(0, _fadeSpeed);
}
function unmuteSound(_id, _volume, _fadeSpeed) {
soundList[_id].startFade(_volume, _fadeSpeed);
}
function stopEverySound(_fadeSpeed, _excludIdlist) {
for (var _local4 in soundList) {
if (!checkIfExcluded(Number(_local4), _excludIdlist)) {
if ((_fadeSpeed != undefined) && (_fadeSpeed != 0)) {
soundList[_local4].startFade(0, _fadeSpeed);
} else {
soundList[_local4].stop();
}
}
}
}
function soundOff() {
for (var _local2 in soundList) {
soundList[_local2].setMute(true);
}
}
function soundOn() {
for (var _local2 in soundList) {
soundList[_local2].setMute(false);
}
}
function fadeInRandomSound(_obj, _fadeSpeed) {
var _local6 = 0;
var _local3 = 0;
while (_local3 < _obj.length) {
_local6 = _local6 + _obj[_local3].freqency;
_local3++;
}
var _local5 = 0;
_local3 = 0;
while (_local3 < _obj.length) {
_local5 = _local5 + (_obj[_local3].freqency / _local6);
_obj[_local3].chance = _local5;
_local3++;
}
var _local4 = Math.random();
var _local7 = 0;
_local3 = 1;
while (_local3 < _obj.length) {
if ((_local4 > _obj[_local3 - 1].chance) && (_local4 <= _obj[_local3].chance)) {
_local7 = _local3;
}
_local3++;
}
var _local8 = _obj[_local7].level.split("-");
var _local9 = (Math.random() * (Number(_local8[1]) - Number(_local8[0]))) + Number(_local8[0]);
playSound(_obj[_local7].id, _local9, 1, _fadeSpeed);
}
function checkIfExcluded(_excludeid, _excludIdlist) {
var _local1 = 0;
while (_local1 < _excludIdlist.length) {
if (_excludIdlist[_local1] == _excludeid) {
return(true);
}
_local1++;
}
return(false);
}
function preloadNextMP3() {
var _local7 = this;
if (preloaderList.length > 0) {
var _local5 = preloaderList.shift();
var _local6 = mcRef.createEmptyMovieClip("soundummy" + preloaderList.length, 7000 - preloaderList.length);
var _local2 = new ExtendedSound(_local6);
_local2.loadSound(_local5);
var _local4 = _local5.split("/");
var _local3 = _local4[_local4.length - 1].slice(0, -4);
soundList[_local3] = _local2;
soundList[_local3].onLoad = uk.kerb.utils.EventDelegate.create(this, preloadNextMP3);
} else {
trace("finished loading soundqueue");
allSoundsLoaded(true);
}
}
}
Symbol 541 MovieClip [__Packages.ExtendedSound] Frame 0
class ExtendedSound extends Sound
{
var mcRef, mute, fadeParams, onFadeComplete, decay, loops, isPlaying, volume;
function ExtendedSound (_mcRef) {
super((mcRef = _mcRef));
mute = 1;
}
function startFade(_targetVolume, _speed) {
var _local7 = getVolume();
setVolume(_local7);
var _local4 = _targetVolume - _local7;
if (_local4 == 0) {
return(this);
}
var _local2 = Math.abs(_local4);
var _local8 = _local2 / _local4;
var _local10 = function (_t, _b, _c, _d) {
return(((_c * _t) / _d) + _b);
};
fadeParams = {t:0, b:_local7, c:_local4, d:_local2, s:_local8, speed:_speed, targetVolume:_targetVolume, easing:_local10};
mcRef.onEnterFrame = uk.kerb.utils.EventDelegate.create(this, fading);
return(this);
}
function stopFade() {
delete mcRef.onEnterFrame;
onFadeComplete();
}
function attachSound(_libraryID) {
stop();
super.attachSound(_libraryID);
return(this);
}
function loadSound(_mp3URL) {
stop();
super.loadSound(_mp3URL);
return(this);
}
function start(_decay, _loops) {
stop();
if (_decay == undefined) {
_decay = 0;
}
if (_loops == undefined) {
_loops = 1;
}
super.start((decay = _decay), (loops = _loops));
isPlaying = true;
return(this);
}
function stop() {
super.stop();
isPlaying = false;
return(this);
}
function setVolume(_volume) {
if (_volume == undefined) {
_volume = 100;
}
super.setVolume(((((volume = _volume)) / 100) * masterVolume) * mute);
return(this);
}
function getVolume() {
return(volume);
}
function setMute(_bool) {
mute = (_bool ? 0 : 1);
setVolume(getVolume());
return(this);
}
function fading() {
fadeParams.t = fadeParams.t + fadeParams.speed;
var _local2 = fadeParams.easing(fadeParams.t, fadeParams.b, fadeParams.c, fadeParams.d);
var _local3 = fadeParams.s;
if ((_local2 * _local3) > (fadeParams.targetVolume * _local3)) {
setVolume(fadeParams.targetVolume);
stopFade();
return(undefined);
}
setVolume(_local2);
}
function onSoundComplete() {
isPlaying = false;
return(this);
}
static var masterVolume = 100;
}
Symbol 542 MovieClip [__Packages.uk.kerb.utils.EventDelegate] Frame 0
class uk.kerb.utils.EventDelegate
{
function EventDelegate () {
}
static function create(scope, method) {
var params = arguments.splice(2, arguments.length - 2);
var _local2 = function () {
return(method.apply(scope, arguments.concat(params)));
};
return(_local2);
}
}
Symbol 543 MovieClip [__Packages.ScoreSaver] Frame 0
class ScoreSaver
{
function ScoreSaver () {
}
static function saveScore(score, takeMeAway) {
var _local8 = uk.kerb.utils.Crypto.encrypt(GAME_ID);
var _local6 = uk.kerb.utils.Crypto.encrypt(score);
var _local2 = BASE_URL;
if ((_root.basepath != undefined) && (_root.basepath != "")) {
_local2 = _root.basepath;
}
if (_local2.charAt(_local2.length - 1) != "/") {
_local2 = _local2 + "/";
}
var _local4 = (((_local2 + "setuserscore.php?gameid=") + escape(_local8)) + "&score=") + escape(_local6);
var _local9 = getHostFromBasePath(_local2);
var _local5 = ((_root._url.indexOf(_local9) >= 0) ? "_self" : "_blank");
if (takeMeAway) {
getURL (_local4, _local5);
} else {
var _local3 = new LoadVars();
_local3.onLoad = function (success) {
if (success) {
trace("Saved score correctly");
} else {
trace("Error saving score");
}
};
var _local7 = new LoadVars();
_local7.sendAndLoad(_local4, _local3, "GET");
}
}
static function getHostFromBasePath(basePath) {
if (basePath.indexOf("http://") == 0) {
basePath = basePath.substring(7);
var _local2 = basePath.indexOf("/");
if (_local2 >= 0) {
basePath = basePath.substring(0, _local2);
}
}
return(basePath);
}
static var BASE_URL = "http://www.sammysgamebox.com/";
static var GAME_ID = 2;
}
Symbol 544 MovieClip [__Packages.uk.kerb.utils.Crypto] Frame 0
class uk.kerb.utils.Crypto
{
function Crypto () {
}
static function encrypt(s) {
var _local3 = (s + "") + SALT;
var _local4 = "";
var _local5 = Math.floor(Math.random() * KEYS.length);
var _local2 = _local5;
var _local1 = 0;
while (_local1 < _local3.length) {
_local4 = _local4 + KEYS[_local2].charAt(parseInt(_local3.charAt(_local1)));
_local2 = (_local2 + 1) % KEYS.length;
_local1++;
}
_local4 = _local4 + ("" + _local5);
return(_local4);
}
static function decrypt(s) {
var _local3 = parseInt(s.substr(-1));
var _local4 = s.substr(0, s.length - 1);
var _local5 = "";
var _local1 = 0;
while (_local1 < _local4.length) {
var _local2 = KEYS[_local3].indexOf(_local4.charAt(_local1));
if (_local2 > -1) {
_local5 = _local5 + ("" + _local2);
} else {
return(0);
}
_local3 = (_local3 + 1) % KEYS.length;
_local1++;
}
if (_local5.substr(-SALT.length) != SALT) {
return(0);
}
return(parseInt(_local5.substr(0, _local5.length - SALT.length)));
}
static var KEYS = Array("98sdfa23Ql", "ADF8b3w2fq", "ER2b79hwfO", "clkenf0FSj", "4R7d6ASYU3", "ASDQsjhW02", "kCQ6YH9asc", "ADIx7g19SP", "Nd98fhiOAF", "a09hADNFkf");
static var SALT = "8008135";
}
Symbol 363 MovieClip Frame 1
stop();
Symbol 393 Button
on (release) {
_global.soundManager.playSound("snd_btn");
play();
}
on (keyPress "<Space>") {
_global.soundManager.playSound("snd_btn");
play();
}
Symbol 439 Button
on (release) {
_global.soundManager.playSound("snd_btn");
play();
}
Symbol 440 Button
on (release) {
_global.soundManager.playSound("snd_btn");
play();
}
on (keyPress "<Space>") {
_global.soundManager.playSound("snd_btn");
play();
}
Symbol 455 Button
on (release) {
root.kvEvent(473);
getURL ("http://neolicious.com/index.htm#artist_3", "_blank");
}
Symbol 504 Button
on (release) {
root.kvEvent(620);
_global.soundManager.playSound("snd_btn");
ScoreSaver.saveScore(score, true);
}
Symbol 519 Button
on (release) {
root.kvEvent(621);
_global.soundManager.playSound("snd_btn");
play();
}
on (keyPress "<Space>") {
root.kvEvent(621);
_global.soundManager.playSound("snd_btn");
play();
}
Symbol 522 Button
on (release) {
root.kvClick(496);
_global.soundManager.playSound("snd_btn");
getURL (_root.gameHiphop);
}
Symbol 525 Button
on (release) {
root.kvClick(495);
_global.soundManager.playSound("snd_btn");
getURL (_root.gamePop);
}
Symbol 528 Button
on (release) {
root.kvClick(493);
_global.soundManager.playSound("snd_btn");
getURL (_root.gameDance);
}
Symbol 531 Button
on (release) {
root.kvClick(494);
_global.soundManager.playSound("snd_btn");
getURL (_root.gameReggae);
}