Frame 1
_root.stop();
var gender = 0;
_root.siteLink.onRelease = function () {
getURL ("http://wecheese.com", "_blank");
};
_root.playButton.gotoAndStop("out");
_root.playButton.onRollOver = function () {
this.gotoAndStop("over");
};
_root.playButton.onRollOut = function () {
this.gotoAndStop("out");
};
_root.playButton.onRelease = function () {
_root.attachMovie("genderWin", "genderWin", _root.getNextHighestDepth(), {_x:_root._width / 2, _y:_root._height / 2});
_root.genderWin.manButton.gotoAndStop("out");
_root.genderWin.womanButton.gotoAndStop("out");
_root.genderWin.manButton.onRollOver = function () {
this.gotoAndStop("over");
};
_root.genderWin.manButton.onRollOut = function () {
this.gotoAndStop("out");
};
_root.genderWin.womanButton.onRollOver = _root.genderWin.manButton.onRollOver;
_root.genderWin.womanButton.onRollOut = _root.genderWin.manButton.onRollOut;
_root.genderWin.manButton.onRelease = function () {
gender = 1;
_root.genderWin.removeMovieClip();
_root.play();
};
_root.genderWin.womanButton.onRelease = function () {
gender = 2;
_root.genderWin.removeMovieClip();
_root.play();
};
};
Frame 2
function randRange(min, max) {
var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min;
return(_local1);
}
function playSound(soundID, soundVolume, soundOffset, soundLoops) {
var _local2 = new Sound(this);
_local2.attachSound(soundID);
_local2.setVolume(soundVolume);
_local2.start(soundOffset, soundLoops);
return(_local2);
}
function clamp(point) {
var _local2 = point[0];
var _local1 = point[1];
if (_local2 < 0) {
_local2 = 0;
}
if (_local2 > 1) {
_local2 = 1;
}
if (_local1 < 0) {
_local1 = 0;
}
if (_local1 > 1) {
_local1 = 1;
}
return([_local2, _local1]);
}
function pushPointFromCircle(point, center, radius) {
var _local2 = point[0] - center[0];
var _local1 = point[1] - center[1];
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
if (_local3 < radius) {
_local2 = _local2 * (radius / _local3);
_local1 = _local1 * (radius / _local3);
return([center[0] + _local2, center[1] + _local1]);
}
return(point);
}
function generateRandomAlternative(chances) {
var _local4 = Math.random();
var _local2 = 0;
var _local1 = 0;
while (_local1 < (chances.length - 1)) {
_local2 = _local2 + chances[_local1];
if (_local4 <= _local2) {
return(_local1);
}
_local1++;
}
return(chances.length - 1);
}
function vecLength(vec) {
return(Math.sqrt((vec[0] * vec[0]) + (vec[1] * vec[1])));
}
function isPointInCylinder(point, cylinderOrigin, cylinderRadius, cylinderHeight) {
if ((point[1] >= cylinderOrigin[1]) && (point[1] <= (cylinderOrigin[1] + cylinderHeight))) {
if (vecLength([point[0] - cylinderOrigin[0], point[2] - cylinderOrigin[2]]) <= cylinderRadius) {
return(true);
}
}
return(false);
}
function generateRandomPointOnSegment(startPoint, endPoint) {
var _local1 = Math.random();
return([startPoint[0] + (_local1 * (endPoint[0] + startPoint[0])), startPoint[1] + (_local1 * (endPoint[1] + startPoint[1]))]);
}
function generateRandomPointOnRectangle(rectangle) {
var _local3 = Math.random();
var _local2 = Math.random();
return([rectangle[0][0] + (_local3 * (rectangle[1][0] - rectangle[0][0])), rectangle[0][1] + (_local2 * (rectangle[1][1] - rectangle[0][1]))]);
}
function generateRandomPointOnString(startPoint, endPoint, stringWidth) {
var _local2 = stringWidth * (Math.random() - 0.5);
var _local1 = [startPoint[1] - endPoint[1], endPoint[0] - startPoint[0]];
var _local3 = vecLength(directionVec);
_local1 = [(_local1[0] / _local3) * _local2, (_local1[1] / _local3) * _local2];
point = generateRandomPointOnSegment(startPoint, endPoint);
return([point[0] + _local1[0], point[1] + _local1[1]]);
}
function redrawRing(center, radius, partsCount) {
var _local2 = 0;
while (_local2 < partsCount) {
var _local5 = _local2 / partsCount;
var _local3 = [center[0] + (radius * Math.cos((_local5 * Math.PI) * 2)), center[1], center[2] + (radius * Math.sin((_local5 * Math.PI) * 2))];
var _local9 = _local3[0] * Stage.width;
var _local4 = EYE_DISTANCE / (EYE_DISTANCE + _local3[2]);
var _local8 = (Stage.height - (((_local4 * (_local3[1] - 0.5)) + 0.5) * Stage.height)) - 1;
var _local6 = (_local4 + ((1 - _local4) * PERSPECTIVE_TO_ORTO_SIZE_REGULATOR)) * 100;
var _local1 = game.clip["SS" + _local2];
_local1._x = _local9;
_local1._y = _local8;
_local1._xscale = _local6;
_local1._yscale = _local6;
_local2++;
}
}
function redrawNet() {
var _local6 = game.netCoords[0] * Stage.width;
var _local4 = EYE_DISTANCE / (EYE_DISTANCE + game.netCoords[2]);
var _local2 = (Stage.height - (((_local4 * (game.netCoords[1] - 0.5)) + 0.5) * Stage.height)) - 1;
var _local7 = EYE_DISTANCE / ((EYE_DISTANCE + game.netCoords[2]) + NET_RADIUS);
var _local3 = (Stage.height - (((_local7 * (game.netCoords[1] - 0.5)) + 0.5) * Stage.height)) - 1;
var _local9 = (_local4 + ((1 - _local4) * PERSPECTIVE_TO_ORTO_SIZE_REGULATOR)) * 100;
var _local5 = ((0.5 * Stage.height) * (_local4 + 1)) - 1;
var _local8 = ((0.5 * Stage.height) * (_local7 + 1)) - 1;
sachok._x = _local6;
sachok._y = _local2;
sachok._yscale = 1.4 * (_local2 - _local3);
sachok._xscale = 125;
sachokshadow._x = _local6;
sachokshadow._y = _local5;
sachokshadow._yscale = 1.4 * (_local5 - _local8);
sachokshadow._xscale = 125;
_root.web._x = sachok._x;
_root.web._y = sachok._y;
_root.web.top._yscale = 6 * (_local2 - _local3);
_root.web.bottom._yscale = 6 * (_local2 - (_local3 - 4));
_root.sachok.line._rotation = 30 - (2 * (_local2 - (_local3 - 10)));
}
function updateNetData() {
game.netCoords = [NET_MIN_X + ((_root._xmouse / Stage.width) * (NET_MAX_X - NET_MIN_X)), NET_Z, NET_MIN_Y + ((1 - (_root._ymouse / Stage.height)) * (NET_MAX_Y - NET_MIN_Y))];
}
function isPointInPool(point) {
if ((point[0] >= poolRectangle[0][0]) && (point[0] <= poolRectangle[1][0])) {
if ((point[1] >= poolRectangle[0][1]) && (point[1] <= poolRectangle[1][1])) {
var _local3 = Math.floor(((point[0] - poolRectangle[0][0]) / (poolRectangle[1][0] - poolRectangle[0][0])) * POOL_MAP_SIZE);
var _local2 = Math.floor((1 - ((point[1] - poolRectangle[0][1]) / (poolRectangle[1][1] - poolRectangle[0][1]))) * POOL_MAP_SIZE);
if (poolMap[_local2][_local3] == 1) {
return(true);
}
}
}
return(false);
}
function addPoint(x, y) {
square_mc.moveTo(x, y);
square_mc.lineTo(x + 1, y);
}
function addMarker(point) {
if (isPointInPool(point)) {
var _local2 = point[0] * Stage.width;
var _local3 = EYE_DISTANCE / (EYE_DISTANCE + point[1]);
var _local1 = ((0.5 * Stage.height) * (_local3 + 1)) - 1;
addPoint(_local2, _local1);
}
}
function startGame() {
game.clip = _root.frogsContainer;
game.shadowClip = _root.shadowsContainer;
game.frogs = [];
game.shadows = [];
game.netCoords = [0, 0, 0];
addBushes();
redrawBushes();
var _local2 = 0;
while (_local2 < FROGS_MAX_COUNT) {
var _local3 = generateRandomAlternative(newFrogTypeChances) + 1;
var _local5 = Math.random() * 0.6;
var _local4 = Math.random();
addFrog([_local5, 0, _local4], _local3);
_local2++;
}
redrawTimer();
timer = setInterval(onTimer, 1000);
_root.HUD.score.text = "Score: " + game.score;
}
function restartGame() {
if (game.endCode == 2) {
newFrogTypeChances = tempNewFrogTypeChances;
stateTransitionTable = tempStateTransitionTable;
stateTransitionTable = [[[0.2, 0.3, 0.5], [0.2, 0.4, 0.4], [0.2, 0.4, 0.4]], [[0.2, 0.3, 0.5], [0.2, 0.3, 0.5], [0.2, 0.4, 0.4]]];
}
game.gameMode = 0;
game.endCode = 0;
var _local2 = 0;
while (_local2 < game.frogsInNet) {
_root.HUD["HUD_frog" + _local2].removeMovieClip();
_local2++;
}
game.frogsInNet = 0;
game.frogsType = 0;
game.isFrogKissed = false;
game.score = 0;
game.escapedFrogs = 0;
game.loserCatched = false;
Mouse.hide();
showNet(true);
_local2 = 0;
while (_local2 < FROGS_MAX_COUNT) {
var _local3 = generateRandomAlternative(newFrogTypeChances) + 1;
var _local5 = Math.random() * 0.6;
var _local4 = Math.random();
addFrog([_local5, 0, _local4], _local3);
_local2++;
}
game.time = TIME_LIMIT;
redrawTimer();
timer = setInterval(onTimer, 1000);
_root.HUD.score.text = "Score: " + game.score;
_root.hint.gotoAndStop(1);
}
function showNet(visibility) {
_root.sachok._visible = visibility;
_root.sachokshadow._visible = visibility;
_root.web._visible = visibility;
}
function showGameOverWin(gameOverMessage) {
_root.attachMovie("gameOverWin", "gameOverWin", _root.getNextHighestDepth(), {_x:Stage.width / 2, _y:Stage.height / 2});
_root.gameOverWin.replayBut.gotoAndStop("out");
_root.gameOverWin.replayBut.onRelease = function () {
_root.gameOverWin.removeMovieClip();
_root.restartGame();
};
_root.gameOverWin.replayBut.onRollOver = function () {
_root.gameOverWin.replayBut.gotoAndStop("over");
};
_root.gameOverWin.replayBut.onRollOut = function () {
_root.gameOverWin.replayBut.gotoAndStop("out");
};
_root.gameOverWin.textArea.message.text = gameOverMessage;
}
function removeAllFrogs() {
var _local1 = 0;
var _local4 = 0;
while (_local1 != game.frogs.length) {
var _local2 = game.frogs[_local1];
var _local3 = game.shadows[_local4];
if (_local2.typeID <= 2) {
_local2.clip.removeMovieClip();
game.frogs.splice(_local1, 1);
_local3.clip.removeMovieClip();
game.shadows.splice(_local4, 1);
} else {
_local1++;
}
}
}
function gameOver(gameOverCode) {
clearInterval(timer);
Mouse.show();
showNet(false);
switch (gameOverCode) {
case 1 :
removeAllFrogs();
game.gameMode = 1;
game.endCode = 1;
showGameOverWin(((game.playerGender == 1) ? "You've let too many lousy girls jumped into your life... Try again." : "You've let too many lousy guys jumped into your life... Try again. (Download for FREE the game to your computer)"));
break;
case 2 :
removeAllFrogs();
game.gameMode = 1;
game.endCode = 3;
showGameOverWin(("You let too many possible " + ((game.playerGender == 1) ? "princesses" : "princes")) + " fly away. Start again!");
break;
case 3 :
removeAllFrogs();
game.gameMode = 1;
game.endCode = 4;
showGameOverWin("Play Time is Over!");
break;
case 4 :
game.gameMode = 2;
break;
case 5 :
game.gameMode = 3;
var _local3 = addFrog([-0.3, 0, 0.8], 2);
var _local4 = addFrog([1.3, 0, 0.8], 2);
_local3.ID = 1;
_local3.clip.onRollOver = function () {
this.setTransformRGBA(100, 110, 100, 0, -100, 0, 100, 0);
};
_local3.clip.onRollOut = function () {
this.setTransformRGBA(100, 0, 100, 0, 100, 0, 100, 0);
};
_local3.clip.onRelease = function () {
kissFrog(this._x, this._y);
};
_local4.ID = 2;
_local4.clip.onRollOver = _local3.clip.onRollOver;
_local4.clip.onRollOut = _local3.clip.onRollOut;
_local4.clip.onRelease = _local3.clip.onRelease;
_root.attachMovie("nextModeText", "nextModeText", _root.getNextHighestDepth(), {_x:Stage.width / 2, _y:(Stage.height / 2) - 100});
_root.nextModeText.gotoAndPlay(game.playerGender * 20);
break;
case 6 :
showGameOverWin("Ooops! You kissed the wrong frog. Try again. (Download for FREE the game to your computer)");
}
}
function redrawTimer() {
var _local2 = game.time % 60;
_root.HUD.time.text = ((((game.time - _local2) / 60) + " : ") + ((String(_local2).length == 1) ? "0" : "")) + _local2;
}
function onTimer() {
redrawTimer();
game.time--;
if (game.time < 0) {
gameOver(3);
}
}
function gameCycle() {
updateNetData();
frogsBrain();
redrawFrogs();
redrawNet();
if (((game.frogsType == 1) && (game.frogsInNet >= MAX_GREEN_FROGS_COUNT)) && (game.gameMode == 0)) {
gameOver(1);
}
if (((game.frogsType == 2) && (game.frogsInNet >= MAX_RED_FROGS_COUNT)) && (game.gameMode == 0)) {
game.gameMode = 1;
game.endCode = 2;
tempNewFrogTypeChances = newFrogTypeChances;
newFrogTypeChances = [0.01, 0.99];
tempStateTransitionTable = stateTransitionTable;
stateTransitionTable[0][0] = [0.98, 0.01, 0.01];
stateTransitionTable[0][1] = [0.98, 0.01, 0.01];
stateTransitionTable[0][2] = [0.98, 0.01, 0.01];
}
if ((game.escapedFrogs >= MAX_RED_FROGS_ESCAPED_COUNT) && (game.gameMode == 0)) {
gameOver(2);
}
if ((((game.frogsType == 2) && (game.frogsInNet >= (MAX_RED_FROGS_COUNT + 1))) && (game.gameMode == 1)) && (game.endCode == 2)) {
gameOver(4);
}
if (((game.frogs.length - bushesNames.length) == 0) && (game.gameMode == 2)) {
gameOver(5);
}
}
function redrawHUD() {
if (game.FPSCurrentFrame >= game.FPSMaxFrames) {
var _local2 = "FPS: " + (game.FPSMaxFrames / ((getTimer() - game.FPSLastTime) / 1000));
_root.HUD.FPSIndicator.text = _local2;
game.FPSCurrentFrame = 0;
game.FPSLastTime = getTimer();
} else {
game.FPSCurrentFrame++;
}
}
function compareFrogDepthes(a, b) {
if (a.coords[2] > b.coords[2]) {
return(-1);
}
if (a.coords[2] == b.coords[2]) {
return(0);
}
return(1);
}
function redrawFrogs() {
var _local10 = 0;
game.frogs.sort(compareFrogDepthes);
var _local6 = 0;
while (_local6 < game.frogs.length) {
var _local1 = game.frogs[_local6];
_local1.clip.swapDepths(game.clip.getNextHighestDepth());
if (_local1.typeID <= 2) {
var _local2 = game.shadows[_local10];
var _local3 = EYE_DISTANCE / (EYE_DISTANCE + _local1.coords[2]);
var _local5 = _local1.coords[0] * Stage.width;
var _local9 = (Stage.height - (((_local3 * (_local1.coords[1] - 0.5)) + 0.5) * Stage.height)) - 1;
var _local8 = ((0.5 * Stage.height) * (_local3 + 1)) - 1;
var _local4 = (_local3 + ((1 - _local3) * PERSPECTIVE_TO_ORTO_SIZE_REGULATOR)) * 100;
var _local7 = _local4 * (1 - (_local1.coords[1] * SHADOW_SIZE_DECREASE_IN_JUMP));
_local1.clip._x = _local5;
_local1.clip._y = _local9;
_local1.clip._xscale = _local4;
_local1.clip._yscale = _local4;
if (_local1.actionState == 2) {
_local1.clip._rotation = ((_local1.jumpHighPointX - _local5) * FROG_JUMP_ROTATION) * _local1.parabola;
}
_local2.clip._x = _local5;
_local2.clip._y = _local8;
_local2.clip._xscale = _local7;
_local2.clip._yscale = _local7;
_local10++;
}
_local6++;
}
}
function redrawBushes() {
game.frogs.sort(compareFrogDepthes);
var _local2 = 0;
while (_local2 < game.frogs.length) {
var _local1 = game.frogs[_local2];
_local1.clip.swapDepths(game.clip.getNextHighestDepth());
if (_local1.typeID == 3) {
var _local4 = _local1.coords[0] * Stage.width;
var _local5 = EYE_DISTANCE / (EYE_DISTANCE + _local1.coords[2]);
var _local3 = ((0.5 * Stage.height) * (_local5 + 1)) - 1;
_local1.clip._x = _local4;
_local1.clip._y = _local3;
}
_local2++;
}
}
function addFrog(coords, type) {
var _local4 = "frog" + game.frogsCounter;
var _local2 = "shadow" + game.frogsCounter;
var _local1 = new game["frog" + type]();
game.clip.attachMovie("frog" + type, _local4, game.clip.getNextHighestDepth());
_local1.clip = game.clip[_local4];
_local1.clip.gotoAndStop("message");
_local1.inPool = false;
_local1.coords = coords;
_local1.startXZ = [coords[0], coords[2]];
_local1.finishXZ = [0, 0];
_local1.jumpHeight = 0;
_local1.actionState = 1;
_local1.frameCounter = 1;
_local1.jumpStatus = 0;
_local1.jumpHighPointX = 0;
_local1.parabola = 0;
game.frogs.push(_local1);
var _local3 = new game.shadow1();
game.shadowClip.attachMovie("frogShadow", _local2, game.shadowClip.getNextHighestDepth());
_local3.clip = game.shadowClip[_local2];
game.shadows.push(_local3);
redrawFrog(game.frogs.length - 1);
game.frogsCounter++;
return(_local1);
}
function addBush(coords, name) {
var _local1 = name;
var _local2 = new game.bush();
game.clip.attachMovie(_local1, _local1, game.clip.getNextHighestDepth());
_local2.clip = game.clip[_local1];
_local2.coords = coords;
game.frogs.push(_local2);
redrawFrog(game.frogs.length - 1);
game.frogsCounter++;
}
function addBushes() {
var _local1 = 0;
while (_local1 < bushesNames.length) {
addBush(bushesCoords[_local1], bushesNames[_local1]);
_local1++;
}
}
function frogsBrain() {
var _local11 = 0;
while (_local11 < game.frogs.length) {
var _local2 = game.frogs[_local11];
if (_local2.typeID <= 2) {
_local2.oldCollisionCode = _local2.collisionCode;
_local2.collisionCode = 0;
var _local5 = 0;
if ((_local2.coords[1] >= MIN_CYLINDER_Z) && (_local2.coords[1] <= MAX_CYLINDER_Z)) {
var _local10 = _local2.coords[0] - game.netCoords[0];
var _local9 = _local2.coords[2] - game.netCoords[2];
_local5 = (_local10 * _local10) + (_local9 * _local9);
if (_local2.coords[1] <= NET_Z) {
if (_local5 <= CYLINDER_LOW_RADIUS_SQR) {
_local2.collisionCode = 1;
}
} else if (_local5 <= CYLINDER_HIGH_RADIUS_SQR) {
_local2.collisionCode = 2;
}
}
if (_local2.frameCounter == animationLengthTable[_local2.typeID - 1][_local2.actionState]) {
_local2.inPool = isPointInPool([_local2.coords[0], _local2.coords[2]]);
_local2.frameCounter = 1;
_local2.actionState = (_local2.inPool ? 0 : (generateRandomAlternative(stateTransitionTable[_local2.typeID - 1][_local2.actionState])));
if ((_local5 <= ADDITIONAL_JUMP_RADIUS_SQR) && (_local2.typeID == 2)) {
var _local15 = generateRandomAlternative([ADDITIONAL_JUMP_CHANCE, 1 - ADDITIONAL_JUMP_CHANCE]);
if (_local15 == 0) {
_local2.actionState = 2;
}
}
if (_local5 <= STOP_JUMP_RADIUS_SQR) {
_local2.actionState = 1;
}
if ((game.gameMode == 2) || (game.gameMode == 3)) {
_local2.actionState = 2;
}
if (((game.gameMode == 3) && (_local2.coords[0] >= 0.3)) && (_local2.coords[0] <= 0.7)) {
_local2.actionState = 1;
}
if ((((_local2.actionState == 1) && (_local2.coords[2] < FROG_MESSAGE_DISTANCE)) && (SHOW_FROG_MESSAGES)) && (Math.random() < FROG_MESSAGE_CHANCE)) {
var _local4 = _local2.clip._name + "_bubble";
var _local12 = Math.random();
if (_local12 <= 0.5) {
_local2.clip.attachMovie("bubble", _local4, _local2.clip.getNextHighestDepth(), {_x:-FROG_MESSAGE_X_OFFSET, _y:-FROG_MESSAGE_Y_OFFSET});
_local2.clip[_local4].gotoAndStop(_local2.typeID * 2);
} else {
_local2.clip.attachMovie("bubble", _local4, _local2.clip.getNextHighestDepth(), {_x:FROG_MESSAGE_X_OFFSET, _y:-FROG_MESSAGE_Y_OFFSET});
_local2.clip[_local4].gotoAndStop((_local2.typeID * 2) + 1);
}
if (FROG_MESSAGE_ORIGINAL_SIZE) {
_local2.clip[_local4]._xscale = _local2.clip[_local4]._xscale * (100 / _local2.clip._xscale);
_local2.clip[_local4]._yscale = _local2.clip[_local4]._yscale * (100 / _local2.clip._yscale);
}
}
if (_local2.actionState == 2) {
_local2.startXZ = [_local2.coords[0], _local2.coords[2]];
if (_local2.typeID == 1) {
var _local7 = generateRandomAlternative(jumpTargetChances);
if (_local7 == 0) {
var _local14 = generateRandomAlternative(fieldChances[_local2.typeID - 1]);
_local2.finishXZ = generateRandomPointOnRectangle(fieldRectangles[_local14]);
}
if (_local7 == 1) {
var _local18 = [[game.netCoords[0] - NEAR_NET_REC_SIZE, game.netCoords[2] - NEAR_NET_REC_SIZE], [game.netCoords[0] + NEAR_NET_REC_SIZE, game.netCoords[2] + NEAR_NET_REC_SIZE]];
_local2.finishXZ = clamp(generateRandomPointOnRectangle(_local18));
}
if (_local7 == 2) {
_local2.finishXZ = [game.netCoords[0], game.netCoords[2]];
}
}
if (_local2.typeID == 2) {
var _local14 = generateRandomAlternative(fieldChances[_local2.typeID - 1]);
_local2.finishXZ = generateRandomPointOnRectangle(fieldRectangles[_local14]);
_local2.finishXZ = clamp(pushPointFromCircle(_local2.finishXZ, [game.netCoords[0], game.netCoords[2]], PUSH_RADIUS));
}
if (game.gameMode == 2) {
_local2.finishXZ = generateRandomPointOnRectangle(invisibleFields[((Math.random() <= 0.5) ? 0 : 1)]);
}
if ((game.gameMode == 3) && (game.endCode == 2)) {
if ((_local2.ID % 2) == 0) {
_local2.finishXZ = [0.45, 0.2];
} else {
_local2.finishXZ = [0.55, 0.2];
}
}
_local2.jumpHeight = MIN_JUMP_HEIGHT + (Math.random() * (MAX_JUMP_HEIGHT - MIN_JUMP_HEIGHT));
_local2.jumpStatus = (_local2.frameCounter - 1) / (animationLengthTable[_local2.typeID - 1][2] - 1);
_local2.parabola = 1 - ((4 * (_local2.jumpStatus - 0.5)) * (_local2.jumpStatus - 0.5));
_local2.coords = [_local2.startXZ[0] + (_local2.jumpStatus * (_local2.finishXZ[0] - _local2.startXZ[0])), _local2.jumpHeight * _local2.parabola, _local2.startXZ[1] + (_local2.jumpStatus * (_local2.finishXZ[1] - _local2.startXZ[1]))];
_local2.jumpHighPointX = ((_local2.startXZ[0] + _local2.finishXZ[0]) * 0.5) * Stage.width;
}
_local2.clip.gotoAndStop(stateAnimationsNames[_local2.actionState]);
} else {
if (_local2.actionState == 2) {
_local2.jumpStatus = _local2.frameCounter / (animationLengthTable[_local2.typeID - 1][2] - 1);
_local2.parabola = 1 - ((4 * (_local2.jumpStatus - 0.5)) * (_local2.jumpStatus - 0.5));
_local2.coords = [_local2.startXZ[0] + (_local2.jumpStatus * (_local2.finishXZ[0] - _local2.startXZ[0])), _local2.jumpHeight * _local2.parabola, _local2.startXZ[1] + (_local2.jumpStatus * (_local2.finishXZ[1] - _local2.startXZ[1]))];
}
_local2.frameCounter++;
}
}
_local11++;
}
_local11 = 0;
var _local6 = 0;
while (_local11 != game.frogs.length) {
var _local2 = game.frogs[_local11];
var _local8 = game.shadows[_local6];
if (_local2.typeID <= 2) {
if (((_local2.collisionCode == 1) && (_local2.oldCollisionCode == 2)) && (((game.gameMode == 0) && (game.endCode == 0)) || ((game.gameMode == 1) && (game.endCode == 2)))) {
if (_local2.typeID == game.frogsType) {
_root.HUD.attachMovie("HUD_frog", "HUD_frog" + game.frogsInNet, _root.HUD.getNextHighestDepth(), {_x:HUD_FROGS_X + (game.frogsInNet * HUD_FROGS_INTERVAL), _y:HUD_FROGS_Y});
} else {
var _local3 = 0;
while (_local3 < game.frogsInNet) {
_root.HUD["HUD_frog" + _local3].removeMovieClip();
_local3++;
}
game.frogsInNet = 0;
_root.HUD.attachMovie("HUD_frog", "HUD_frog" + game.frogsInNet, _root.HUD.getNextHighestDepth(), {_x:HUD_FROGS_X + (game.frogsInNet * HUD_FROGS_INTERVAL), _y:HUD_FROGS_Y});
game.frogsType = _local2.typeID;
}
var _local16 = new Color(_root.HUD["HUD_frog" + game.frogsInNet].background);
_local16.setRGB(HUDFrogsColors[game.frogsType - 1]);
game.frogsInNet++;
game.score = game.score + _local2.score;
game.time = game.time + _local2.timeBonus;
if (game.time < 0) {
game.time = 0;
}
redrawTimer();
_root.HUD.score.text = "Score: " + game.score;
_root.hint.gotoAndStop(1);
if (_local2.typeID == 1) {
if (!game.loserCatched) {
_root.hint.message.text = badHints[game.playerGender - 1][0];
game.loserCatched = true;
} else {
_root.hint.message.text = badHints[game.playerGender - 1][randRange(1, badHints.length - 1)];
}
} else {
_root.hint.message.text = goodHints[game.playerGender - 1][randRange(0, goodHints[game.playerGender - 1].length - 1)];
}
_root.hint.gotoAndPlay(2);
_local2.clip.removeMovieClip();
game.frogs.splice(_local11, 1);
_local8.clip.removeMovieClip();
game.shadows.splice(_local6, 1);
} else if (_local2.inPool) {
if (_local2.typeID == 2) {
game.escapedFrogs++;
}
_root.splashesContainer.attachMovie("splash", "splash", _root.splashesContainer.getNextHighestDepth(), {_x:_local2.clip._x, _y:_local2.clip._y, _yscale:0.5 * _local2.clip._yscale});
_local2.clip.removeMovieClip();
game.frogs.splice(_local11, 1);
_local8.clip.removeMovieClip();
game.shadows.splice(_local6, 1);
} else if ((game.gameMode == 2) && ((_local2.coords[0] <= -0.05) || (_local2.coords[0] >= 1.05))) {
_local2.clip.removeMovieClip();
game.frogs.splice(_local11, 1);
_local8.clip.removeMovieClip();
game.shadows.splice(_local6, 1);
} else {
_local11++;
_local6++;
}
} else {
_local11++;
}
}
if ((game.gameMode == 0) || ((game.gameMode == 1) && (game.endCode == 2))) {
_local11 = 0;
while (_local11 < (FROGS_MAX_COUNT - (game.frogs.length - bushesNames.length))) {
var _local13 = generateRandomAlternative(newFrogTypeChances) + 1;
var _local19 = ((Math.random() < 0.5) ? -0.3 : 1.3);
var _local17 = Math.random();
addFrog([_local19, 0, _local17], _local13);
_local11++;
}
}
}
function kissFrog(frogX, frogY) {
if (!game.isFrogKissed) {
game.isFrogKissed = true;
var _local3 = 0;
while (_local3 < game.frogs.length) {
var _local2 = game.frogs[_local3];
var _local4 = _local2.clip._name + "_bubble";
if (_local2.typeID <= 2) {
_local2.actionState = 0;
_local2.clip.gotoAndStop("sit");
_local2.clip[_local4].removeMovieClip();
}
_local3++;
}
_root.nextModeText.removeMovieClip();
var _local5 = playSound("snd_kiss", 100, 0, 1);
kissTimer = setInterval(frogKissed, 1100, frogX, frogY);
}
}
function frogKissed(frogX, frogY) {
clearInterval(kissTimer);
removeAllFrogs();
var _local3 = SharedObject.getLocal("KissMeKissMe");
var _local5 = _local3.data.firstTime != "NO";
if (_local5) {
_local3.data.firstTime = "NO";
_local3.flush();
gameOver(6);
} else if (Math.random() < 0.5) {
gameOver(6);
} else {
var _local4 = "prince" + ((game.playerGender == 1) ? "ss" : "");
_root.attachMovie(_local4, _local4, _root.getNextHighestDepth(), {_x:frogX, _y:frogY});
if (frogX > 450) {
loadAndShowScores(2, 230, game.score);
} else {
loadAndShowScores(570, 2, game.score);
}
_root[_local4].onEnterFrame = function () {
if ((this._currentframe == this._totalframes) && (!game.helloMessageVisible)) {
game.helloMessageVisible = true;
_root.attachMovie("helloMessage", "helloMessage", _root.getNextHighestDepth(), {_x:frogX + (((frogX > 450) ? 1 : -1) * 40), _y:frogY - 340, _xscale:((frogX > 450) ? 100 : -100)});
_root.helloMessage.messageBlock.message.text = ((game.playerGender == 1) ? "Nice to meet you, my Prince. You succeeded to find me. You are the One I was waiting for. Kiss me\u2026 kiss me \u2026 Kiss me !" : "Nice to meet you, my Princess. You succeeded to find me. You are the One I was waiting for. Kiss me ... kiss me \u2026 Kiss me!");
_root.helloMessage.messageBlock._xscale = _root.helloMessage._xscale;
_root.attachMovie("redirectButton", "redirectButton", _root.getNextHighestDepth(), {_x:((_root.helloMessage.messageBlock._xscale == -100) ? 180 : (Stage.width - 180)), _y:Stage.height - 60});
_root.redirectButton.gotoAndStop("out");
_root.redirectButton.onRollOver = function () {
this.gotoAndStop("over");
};
_root.redirectButton.onRollOut = function () {
this.gotoAndStop("out");
};
_root.redirectButton.onRelease = function () {
getURL ("http://wecheese.com ", "_blank");
};
}
};
}
}
function showStatsWin(winX, winY, winMessage) {
var _local2 = _root.attachMovie("statsWin", "statsWin", _root.getNextHighestDepth(), {_x:winX, _y:winY});
_local2.message.text = winMessage;
return(_local2);
}
function compareScores(a, b) {
if (a[1] > b[1]) {
return(-1);
}
if (a[1] < b[1]) {
return(1);
}
return(0);
}
function loadAndShowScores(left, top, playerScore) {
var _local10 = new LoadVars();
_local10.onLoad = function (success) {
if (success) {
game.overallResult = Number(this.SCORE0);
incOverallScore();
var _local5 = 1;
while (_local5 <= SCORES_NUMBER) {
var _local6 = Array();
_local6.push(this["NAME" + _local5]);
_local6.push(this["SCORE" + _local5]);
game.highScores.push(_local6);
_local5++;
}
game.highScores.sort(compareScores);
_root.attachMovie("highScoresWin", "highScoresWin", _root.getNextHighestDepth(), {_x:left, _y:top});
var _local8 = showStatsWin(left, top, ("Congratulations!!! You've joint those " + game.overallResult) + " lucky users who have managed to discover their Prince or Princess!");
_local8._y = ((top > 20) ? ((top - 2) - _local8._height) : (((top + _root.highScoresWin._height) + 59) + 2));
var _local3 = 1;
while (_local3 <= SCORES_NUMBER) {
_root.highScoresWin.scoreTable["NAME" + _local3] = game.highScores[_local3 - 1][0];
_root.highScoresWin.scoreTable["SCORE" + _local3] = game.highScores[_local3 - 1][1];
_local3++;
}
var _local7 = game.highScores[0][1];
var _local4 = 1;
while (_local4 < game.highScores.length) {
if (game.highScores[_local4][1] < _local7) {
_local7 = game.highScores[_local4][1];
}
_local4++;
}
if (playerScore >= _local7) {
_root.highScoresWin.scoreTable.attachMovie("submitForm", "submitForm", _root.getNextHighestDepth(), {_x:0, _y:248});
_root.highScoresWin.scoreTable.submitForm.submitButton.gotoAndStop("out");
_root.highScoresWin.scoreTable.submitForm.submitButton.onRollOver = function () {
this.gotoAndStop("over");
};
_root.highScoresWin.scoreTable.submitForm.submitButton.onRollOut = function () {
this.gotoAndStop("out");
};
_root.highScoresWin.scoreTable.submitForm.submitButton.onRelease = function () {
if ((_root.highScoresWin.scoreTable.submitForm.playerName != "") && (_root.highScoresWin.scoreTable.submitForm.playerName != undefined)) {
postScore(_root.highScoresWin.scoreTable.submitForm.playerName, playerScore);
}
};
}
} else {
trace("Connection failed");
}
};
var _local8 = new LoadVars();
_local8.filename = SCORES_FILE_PATH;
_local8.scoresize = SCORES_NUMBER;
_local8.action = "VIEW";
_local8.viewtype = "FLASH";
_local8.sendAndLoad(SCORES_SCRIPT_PATH, _local10, "POST");
}
function postScore(winnerName, winnerScore) {
_root.highScoresWin.scoreTable.submitForm.removeMovieClip();
var _local5 = new LoadVars();
_local5.onLoad = function (success) {
if (success) {
var _local3 = Array();
_local3.push(winnerName);
_local3.push(winnerScore);
game.highScores.push(_local3);
game.highScores.sort(compareScores);
game.highScores.splice(game.highScores.length - 1, 1);
var _local2 = 1;
while (_local2 <= SCORES_NUMBER) {
_root.highScoresWin.scoreTable["NAME" + _local2] = game.highScores[_local2 - 1][0];
_root.highScoresWin.scoreTable["SCORE" + _local2] = game.highScores[_local2 - 1][1];
_local2++;
}
}
};
var _local3 = new LoadVars();
_local3.filename = SCORES_FILE_PATH;
_local3.scoresize = SCORES_NUMBER;
_local3.action = "INSERT";
_local3.viewtype = "FLASH";
_local3.winname = winnerName;
_local3.winscore = winnerScore;
_local3.sendAndLoad(SCORES_SCRIPT_PATH, _local5, "POST");
}
function incOverallScore() {
var _local2 = new LoadVars();
var _local1 = new LoadVars();
_local1.filename = SCORES_FILE_PATH;
_local1.scoresize = SCORES_NUMBER;
_local1.action = "INCOVERALL";
_local1.viewtype = "FLASH";
_local1.sendAndLoad(SCORES_SCRIPT_PATH, _local2, "POST");
}
FROGS_MAX_COUNT = 10;
TIME_LIMIT = 120;
MAX_RED_FROGS_COUNT = 4;
MAX_GREEN_FROGS_COUNT = 6;
MAX_RED_FROGS_ESCAPED_COUNT = 10;
RING_PARTS_COUNT = 32;
NET_RADIUS = 0.1;
NET_MIN_X = 0;
NET_MAX_X = 1;
NET_MIN_Y = 0;
NET_MAX_Y = 1;
NET_Z = 0.15;
MIN_CYLINDER_Z = 0;
MAX_CYLINDER_Z = 0.5;
CYLINDER_LOW_RADIUS = NET_RADIUS;
CYLINDER_HIGH_RADIUS = NET_RADIUS;
CYLINDER_LOW_RADIUS_SQR = CYLINDER_LOW_RADIUS * CYLINDER_LOW_RADIUS;
CYLINDER_HIGH_RADIUS_SQR = CYLINDER_HIGH_RADIUS * CYLINDER_HIGH_RADIUS;
PUSH_RADIUS = NET_RADIUS * 1.8;
NEAR_NET_REC_SIZE = NET_RADIUS * 1.5;
STOP_JUMP_RADIUS = NET_RADIUS * 0.4;
ADDITIONAL_JUMP_RADIUS = NET_RADIUS * 1.9;
STOP_JUMP_RADIUS_SQR = STOP_JUMP_RADIUS * STOP_JUMP_RADIUS;
ADDITIONAL_JUMP_RADIUS_SQR = ADDITIONAL_JUMP_RADIUS * ADDITIONAL_JUMP_RADIUS;
ADDITIONAL_JUMP_CHANCE = 0.85;
EYE_DISTANCE = 1;
PERSPECTIVE_TO_ORTO_SIZE_REGULATOR = 0;
SHADOW_SIZE_DECREASE_IN_JUMP = 0.7;
MIN_JUMP_HEIGHT = 0.4;
MAX_JUMP_HEIGHT = 1;
FROG_JUMP_ROTATION = 0.2;
SHOW_FROG_MESSAGES = true;
FROG_MESSAGE_CHANCE = 1;
FROG_MESSAGE_ORIGINAL_SIZE = true;
FROG_MESSAGE_DISTANCE = 0.3;
FROG_MESSAGE_X_OFFSET = 20;
FROG_MESSAGE_Y_OFFSET = 50;
SCORES_SCRIPT_PATH = "http://wecheese.com/games/kiss-me/scores.php";
SCORES_FILE_PATH = "scores/score.sco";
SCORES_NUMBER = 10;
stateTransitionTable = [[[0.2, 0.3, 0.5], [0.2, 0.4, 0.4], [0.2, 0.4, 0.4]], [[0.2, 0.3, 0.5], [0.2, 0.3, 0.5], [0.2, 0.4, 0.4]]];
stateAnimationsNames = ["sit", "message", "jump"];
animationLengthTable = [[20, 60, 30], [20, 60, 30]];
fieldRectangles = [[[0, 0], [0.6, 1]], [[0.6, 0], [1, 1]]];
fieldChances = [[0.5, 0.5], [0.82, 0.18]];
jumpTargetChances = [0.3, 0.4, 0.3];
newFrogTypeChances = [0.5, 0.5];
invisibleFields = [[[-0.5, 0], [-0.2, 1]], [[1.2, 0], [1.5, 1]]];
bushesNames = ["bush3", "bush4", "bush5"];
bushesCoords = [[0.59, 0, 0.38], [0.773, 0, 1.54], [0.908, 0, 1.8]];
HUD_FROGS_X = 50;
HUD_FROGS_Y = 35;
HUD_FROGS_INTERVAL = 50;
HUDFrogsColors = [100666, 15106250];
POOL_MAP_SIZE = 16;
poolRectangle = [[0.557, 0], [1, 1]];
poolMap = [[0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
badHints = [["Huh! A lousy girl has jumped into your life...", "Huh! Another lousy girl has jumped into your life...", "Huh! Another lousy girl has jumped into your life...", "Huh! Another lousy girl has jumped into your life..."], ["Huh! A lousy guy has jumped into your life...", "Huh! Another lousy guy has jumped into your life...", "Huh! Another lousy guy has jumped into your life...", "Huh! Another lousy guy has jumped into your life..."]];
goodHints = [["She has a boyfriend, try another frog", "She is getting married in 2 months, try another frog", "She is lesbian, she kisses only women, try another frog", "Serial lover, No serious affair here; try another frog", "What to do with a lazy girl? try another frog", "She is a big liar, amazing! try another frog", "She is a spending-machine, you not rich! Dud, try another frog ", "She is depressive like your ex-girlfriend, try another frog", "She has divorced already 10 times! try another frog"], ["He has already a girlfriend, try another frog", "He is getting married in 2 months, try another frog", "He is gay! He kisses only men, try another frog", "He is a Casanova, nothing serious here, try another frog", "He still lives with his mom, huh! try another frog", "He is a big liar; don't waste time, try another frog", "He is never free on the week-ends, try another frog", "He resembles too much your ex-boyfriend, try another frog", "He has been divorcing for three years, try another frog"]];
var game = {playerGender:gender, score:0, time:TIME_LIMIT, frogsInNet:0, frogsType:0, frogsCounter:0, gameMode:0, endCode:0, escapedFrogs:0, loserCatched:false};
game.highScores = Array();
game.overallResult = 0;
game.helloMessageVisible = false;
game.isFrogKissed = false;
game.netCoords = [0, 0, 0];
game.FPSLastTime = 0;
game.FPSCurrentFrame = 0;
game.FPSMaxFrames = 30;
game.frogs = new Array();
game.shadows = new Array();
game.frog1 = function () {
};
game.frog1.prototype.score = 100;
game.frog1.prototype.typeID = 1;
game.frog1.prototype.timeBonus = 0;
game.frog2 = function () {
};
game.frog2.prototype.score = 500;
game.frog2.prototype.typeID = 2;
game.frog2.prototype.timeBonus = 0;
game.bush = function () {
};
game.bush.prototype.typeID = 3;
game.shadow1 = function () {
};
var timer;
var kissTimer;
MovieClip.prototype.setTransformRGBA = function (ra, rb, ga, gb, ba, bb, aa, ab) {
if (arguments.length < 8) {
return(false);
}
var _local3 = 0;
while (_local3 < arguments.length) {
if (isNaN(arguments[_local3++])) {
return(false);
}
}
if ((((((((((((((((ra <= 100) && (ga <= 100)) && (ba <= 100)) && (aa <= 100)) && (ra >= -100)) && (ga >= -100)) && (ba >= -100)) && (aa >= -100)) && (rb <= 255)) && (gb <= 255)) && (bb <= 255)) && (ab <= 255)) && (rb >= -255)) && (gb >= -255)) && (bb >= -255)) && (ab >= -255)) {
var _local5 = {ra:ra, rb:rb, ga:ga, gb:gb, ba:ba, bb:bb, aa:aa, ab:ab};
var _local4 = new Color(this);
_local4.setTransform(_local5);
return(true);
}
return(false);
};
MovieClip.prototype.invertRGB = function () {
var _local3 = {ra:-100, rb:255, ga:-100, gb:255, ba:-100, bb:255, aa:100, ab:255};
var _local2 = new Color(this);
_local2.setTransform(_local3);
};
MovieClip.prototype.resetTransformRGBA = function () {
var _local3 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:255};
var _local2 = new Color(this);
_local2.setTransform(_local3);
};
MovieClip.prototype.toggleInvertRGB = function () {
var _local3 = new Color(this);
var _local2 = _local3.getTransform();
if (((_local2.ra == -100) && (_local2.ga == -100)) && (_local2.ba == -100)) {
_local2.ra = 100;
_local2.ga = 100;
_local2.ba = 100;
_local2.rb = 0;
_local2.gb = 0;
_local2.bb = 0;
} else if (((_local2.ra == 100) && (_local2.ga == 100)) && (_local2.ba == 100)) {
_local2.ra = -100;
_local2.ga = -100;
_local2.ba = -100;
_local2.rb = 255;
_local2.gb = 255;
_local2.bb = 255;
}
_local3.setTransform(_local2);
};
_root.createEmptyMovieClip("controller", _root.getNextHighestDepth());
_root.controller.onEnterFrame = function () {
_root.gameCycle();
};
Mouse.hide();
startGame();
playSound("snd_background", 100, 0, 999);
_root.stop();
Symbol 6 MovieClip Frame 30
this.stop();
Symbol 11 MovieClip Frame 30
this.stop();
Symbol 14 MovieClip [splash] Frame 30
this.removeMovieClip();
Symbol 19 MovieClip Frame 60
_parent.removeMovieClip();
Symbol 21 MovieClip Frame 60
_parent.removeMovieClip();
Symbol 25 MovieClip Frame 60
_parent.removeMovieClip();
Symbol 27 MovieClip Frame 60
_parent.removeMovieClip();
Symbol 28 MovieClip [bubble] Frame 2
this.stop();
Symbol 28 MovieClip [bubble] Frame 3
this.stop();
Symbol 28 MovieClip [bubble] Frame 4
this.stop();
Symbol 28 MovieClip [bubble] Frame 5
this.stop();
Symbol 64 MovieClip [frog1] Frame 1
this.stop();
Symbol 64 MovieClip [frog1] Frame 2
this.stop();
Symbol 64 MovieClip [frog1] Frame 3
this.stop();
Symbol 87 MovieClip [frog2] Frame 1
this.stop();
Symbol 87 MovieClip [frog2] Frame 2
this.stop();
Symbol 87 MovieClip [frog2] Frame 3
this.stop();
Symbol 118 MovieClip [gameOverWin] Frame 13
this.stop();
Symbol 130 MovieClip [princess] Frame 125
this.stop();
Symbol 141 MovieClip [prince] Frame 160
this.stop();
Symbol 178 MovieClip [highScoresWin] Frame 1
this.stop();
Symbol 199 MovieClip [nextModeText] Frame 39
this.stop();
Symbol 199 MovieClip [nextModeText] Frame 60
this.stop();
Symbol 248 MovieClip Frame 1
this.stop();
Symbol 248 MovieClip Frame 2
this.play();