Instance of Symbol 45 MovieClip in Frame 1
on (press) {
getURL ("http://www.games.gr/freegames.html", "_blank");
}
Instance of Symbol 48 MovieClip in Frame 1
on (press) {
getURL ("http://www.bestflashgames.com", "_blank");
}
Frame 101
stopAllSounds();
_root.bytesLoaded = _root.getBytesLoaded();
_root.bytesTotal = _root.getBytesTotal();
_root.percentLoaded = Math.floor(100 * (_root.bytesLoaded / _root.bytesTotal));
_root.bar.gotoAndStop(percentLoaded);
Instance of Symbol 45 MovieClip in Frame 101
on (press) {
getURL ("http://www.games.gr/freegames.html", "_blank");
}
Instance of Symbol 48 MovieClip in Frame 101
on (press) {
getURL ("http://www.bestflashgames.com", "_blank");
}
Instance of Symbol 67 MovieClip in Frame 101
on (press) {
getURL ("http://www.bestflashgames.com", "_blank");
}
Frame 102
if (_root.percentLoaded == 100) {
gotoAndStop (104);
} else {
gotoAndPlay (101);
}
Frame 104
stop();
Frame 106
mcGame.setState(1);
trace("setState");
this.gotoAndPlay(3);
Symbol 1 MovieClip [dmSoundService] Frame 1
#initclip 12
Object.registerClass("dmSoundService", CSoundService);
#endinitclip
Symbol 39 MovieClip Frame 94
stop();
Symbol 437 MovieClip [__Packages.CSoundService] Frame 0
class CSoundService extends MovieClip
{
var m_sounds, m_soundsState, m_soundsNames, createEmptyMovieClip, onEnterFrame;
function CSoundService () {
super();
}
function realPlaySound(id, repeatCount) {
if (m_soundOff) {
return(undefined);
}
Sound(m_sounds[id]).start(0, repeatCount);
}
function processSounds() {
var _local2 = 0;
while (_local2 < m_sounds.length) {
if (m_soundsState[_local2] > 0) {
realPlaySound(_local2, m_soundsState[_local2]);
m_soundsState[_local2] = ST_PLAY;
break;
}
_local2++;
}
}
function init(soundNames) {
m_soundsNames = soundNames;
m_sounds = new Array(soundNames.length);
m_soundsState = new Array(soundNames.length);
var _local2 = 0;
while (_local2 < soundNames.length) {
var _local4 = createEmptyMovieClip("_contMovie" + _local2, 1000 + _local2);
var _local3 = new Sound(_local4);
_local3.attachSound(soundNames[_local2]);
m_soundsState[_local2] = ST_STOP;
_local3.sounID = _local2;
_local3.parent = m_instance;
_local3.onSoundComplete = function () {
this.parent.m_soundsState[this.sounID] = CSoundService.ST_STOP;
};
m_sounds[_local2] = _local3;
_local2++;
}
onEnterFrame = processSounds;
}
static function createSoundService(soundNames, soundsPlace, depthInSoundsPlace) {
m_instance = CSoundService(soundsPlace.attachMovie("dmSoundService", "__SoundServiceObject", depthInSoundsPlace));
m_instance.init(soundNames);
return(m_instance);
}
static function playLoopSound(soundID) {
if ((m_instance.m_loopSoundID >= 0) && (m_instance.m_loopSoundID != soundID)) {
stopSound(m_instance.m_loopSoundID);
}
m_instance.m_loopSoundID = soundID;
if (!soundIsPlay(m_instance.m_loopSoundID)) {
playCurLoopSound();
}
}
static function playCurLoopSound() {
playSound(m_instance.m_loopSoundID, 9999, true);
}
static function stopCurLoopSound() {
stopSound(m_instance.m_loopSoundID);
m_instance.m_loopSoundID = -1;
}
static function soundOff() {
var _local1 = 0;
while (_local1 < m_instance.m_sounds.length) {
stopSound(_local1);
_local1++;
}
m_instance.m_soundOff = true;
}
static function soundOn() {
m_instance.m_soundOff = false;
if (m_instance.m_loopSoundID >= 0) {
playCurLoopSound();
}
}
static function soundIsPlay(id) {
return(m_instance.m_soundsState[id] != ST_STOP);
}
static function playSound(id, repeatCount, ifSoundStop) {
if (m_instance.m_soundOff) {
return(undefined);
}
if (ifSoundStop && (soundIsPlay(id))) {
return(undefined);
}
m_instance.m_soundsState[id] = repeatCount;
}
static function stopSound(id) {
Sound(m_instance.m_sounds[id]).stop(m_instance.m_soundsNames[id]);
m_instance.m_soundsState[id] = ST_STOP;
}
static function getSoundAt(soundNum) {
return(m_instance.m_sounds[soundNum]);
}
static function soundIsOn() {
return(!m_instance.m_soundOff);
}
static function stopAllSound() {
var _local1 = 0;
while (_local1 < m_instance.m_sounds.length) {
stopSound(_local1);
_local1++;
}
}
var m_loopSoundID = -1;
static var m_instance = null;
var m_soundOff = false;
static var ST_PLAY = -1;
static var ST_STOP = 0;
static var PLAY_OPT_ALWAYS = 0;
static var PLAY_OPT_IFSTOP = 1;
static var PLAY_OPT_STOPANDPLAY = 2;
}
Symbol 438 MovieClip [__Packages.CWheel] Frame 0
class CWheel extends MovieClip
{
var particle, rad, maxAccSpeed, speed, accSpeed, rot, addedAcc, intersectionFlag, lastIntersPoint, lastN, hitPointArray, normalArray, hitArray, intersArray, mc, _x, _y, localToGlobal;
function CWheel () {
super();
}
function init(particle_, maxAccSpeed_, rad_) {
particle = particle_;
rad = rad_;
maxAccSpeed = maxAccSpeed_ * 4;
speed = 0;
accSpeed = 0;
rot = new CVector2D(1, 0);
addedAcc = new CVector2D(0, 0);
intersectionFlag = false;
lastIntersPoint = new CVector2D(0, 0);
lastN = new CVector2D(0, 0);
var _local2;
var _local4;
var _local3 = (Math.PI*2) / hitCount;
hitPointArray = new Array(hitCount);
normalArray = new Array(hitCount);
hitArray = new Array(hitCount);
intersArray = new Array();
_local2 = 0;
while (_local2 < hitCount) {
hitPointArray[_local2] = new CVector2D(Math.sin(_local3 * _local2) * rad, (-Math.cos(_local3 * _local2)) * rad);
normalArray[_local2] = hitPointArray[_local2].multNew(-1);
normalArray[_local2].normalize();
_local2++;
}
}
function process(dTime, acc, koeffDamp) {
accSpeed = Math.max(-maxAccSpeed, Math.min(maxAccSpeed, accSpeed + (acc * dTime)));
speed = Math.max((-maxSpeed) * dTime, Math.min((speed * koeffDamp) + accSpeed, maxSpeed * dTime));
rot.rotate(speed / rad);
mc.mc_rim._rotation = (Math.atan2(rot.y, rot.x) * 180) / Math.PI;
}
function checkCollision(hit_mc) {
var _local2;
var _local7;
var _local8 = new CVector2D(0, 0);
var _local12 = false;
var _local3;
var _local6;
var _local14;
var _local15 = new CVector2D(particle.prevPos.x, particle.prevPos.y);
var _local4 = new CVector2D(0, 0);
var _local13;
_x = particle.pos.x;
_y = particle.pos.y;
_local13 = 0;
_local2 = 0;
while (_local2 < hitCount) {
hitPointArray[_local2].copyTo(_local8);
localToGlobal(_local8);
if ((hitArray[_local2] = hit_mc.hitTest(_local8.x, _local8.y, true))) {
_local12 = true;
_local3 = _local2;
_local13++;
}
_local2++;
}
if (_local13 == hitCount) {
particle.pos.x = particle.prevPos.x + ((particle.pos.x - particle.prevPos.x) * 0.3);
particle.pos.y = particle.prevPos.y + ((particle.pos.y - particle.prevPos.y) * 0.3);
_x = particle.pos.x;
_y = particle.pos.y;
return(undefined);
}
_local2 = 0;
if (_local12) {
while (true) {
_local2++;
if (_local2 == hitCount) {
_local2 = 0;
}
if (!hitArray[_local2]) {
_local3 = -1;
_local7 = 0;
while (_local7 < hitCount) {
_local2++;
if (_local2 == hitCount) {
_local2 = 0;
}
if (_local3 == -1) {
if (hitArray[_local2]) {
_local3 = _local2;
_local4.plus(normalArray[_local2]);
}
} else if (!hitArray[_local2]) {
_local6 = _local2 - 1;
if (_local6 < 0) {
_local6 = hitCount - 1;
}
intersArray.push({k1:_local3, k2:_local6});
_local3 = -1;
} else {
_local4.plus(normalArray[_local2]);
}
_local7++;
}
break;
}
}
var _local5 = new CVector2D(0, 0);
if (intersArray.length > 0) {
_local4.normalize();
if (intersectionFlag) {
_local4.x = _local4.x + lastN.x;
_local4.y = _local4.y + lastN.y;
_local4.x = _local4.x / 2;
_local4.y = _local4.y / 2;
}
var _local10;
var _local9;
_local14 = intersArray.length;
_local2 = 0;
while (_local2 < _local14) {
_local10 = intersArray.pop();
_local3 = _local10.k1;
_local6 = _local10.k2;
particle.pos.minusNew(particle.prevPos).copyTo(_local5);
if (_local4.scalar(_local5) < 0) {
_local9 = Math.atan2(_local4.y, _local4.x);
_local5.rotate(-_local9);
_local5.x = (-_local5.x) * koeffSpring;
_local5.rotate(_local9);
pushOut(_local3, _local6, hit_mc);
particle.prevPos.x = particle.pos.x - _local5.x;
particle.prevPos.y = particle.pos.y - _local5.y;
} else {
pushOut(_local3, _local6, hit_mc);
}
_local2++;
}
validateRotation(_local4, _local15);
intersectionFlag = true;
particle.pos.copyTo(lastIntersPoint);
_local4.copyTo(lastN);
}
} else if (intersectionFlag) {
validateRotation(lastN, _local15);
intersectionFlag = false;
}
_x = particle.pos.x;
_y = particle.pos.y;
}
function pushOut(k1, k2, hit_mc) {
var _local2;
if (k1 != k2) {
_local2 = normalArray[k1].plusNew(normalArray[k2]);
_local2.normalize();
var _local7 = new CVector2D(0, 0).getDistanceTo(hitPointArray[k1], hitPointArray[k2]);
_local7 = rad - Math.abs(_local7);
particle.pos.plus(_local2.multNew(_local7));
particle.prevPos.plus(_local2.multNew(_local7));
} else {
_local2 = normalArray[k1];
var _local6 = _local2.multNew(-rad);
var _local4 = new CVector2D(0, 0);
var _local5 = 0;
var _local3 = 0.03;
while (true) {
_local6.copyTo(_local4);
localToGlobal(_local4);
if (hit_mc.hitTest(_local4.x, _local4.y, true)) {
_local5++;
_x = (particle.pos.x = particle.pos.x + (_local2.x * _local3));
_y = (particle.pos.y = particle.pos.y + (_local2.y * _local3));
} else {
_local5--;
particle.pos.x = particle.pos.x - (_local2.x * _local3);
particle.pos.y = particle.pos.y - (_local2.y * _local3);
particle.prevPos.plus(_local2.multNew(_local3 * _local5));
break;
}
}
}
}
function validateRotation(n, oldPos) {
if ((!intersectionFlag) && (Math.abs(accSpeed) > 0.01)) {
if (Math.abs(accSpeed) < ((maxAccSpeed * 0.02) / 2)) {
accSpeed = 0;
} else if (accSpeed > 0) {
accSpeed = maxAccSpeed * 0.02;
} else {
accSpeed = (-maxAccSpeed) * 0.02;
}
}
var _local3 = new CVector2D(-n.y, n.x);
var _local6 = particle.pos.minusNew(oldPos);
var _local5 = Math.atan2(_local3.y, _local3.x);
var _local2 = _local6.rotateNew(-_local5);
speed = _local2.x + accSpeed;
_local2.y = 0;
_local2.rotate(_local5);
var _local4 = 1 - koeffSlip;
particle.pos.x = (particle.pos.x + ((_local3.x * accSpeed) * _local4)) - ((1 - koeffFriction) * _local2.x);
particle.pos.y = (particle.pos.y + ((_local3.y * accSpeed) * _local4)) - ((1 - koeffFriction) * _local2.y);
accSpeed = accSpeed * koeffSlip;
}
function applyAddedAcc() {
particle.acc.x = particle.acc.x + (addedAcc.x * particle.mass);
particle.acc.y = particle.acc.y + (addedAcc.y * particle.mass);
}
var maxSpeed = 180;
var koeffSpring = 0.05;
var koeffSlip = 0.15;
var koeffFriction = 0.97;
var hitCount = 32;
}
Symbol 439 MovieClip [__Packages.CParticle] Frame 0
class CParticle
{
var pos, prevPos, mass, acc, mc;
function CParticle (x_, y_, mass_) {
pos = new CVector2D(x_, y_);
prevPos = pos.duplicate();
mass = mass_;
acc = new CVector2D(0, 0);
mc = null;
}
function verlet(dTime, koeffDamp) {
var _local2 = pos.duplicate();
pos.x = pos.x + (((pos.x - prevPos.x) * koeffDamp) + (acc.x * dTime));
pos.y = pos.y + (((pos.y - prevPos.y) * koeffDamp) + (acc.y * dTime));
_local2.copyTo(prevPos);
if (mc != null) {
mc._x = pos.x;
mc._y = pos.y;
}
}
}
Symbol 440 MovieClip [__Packages.CVector2D] Frame 0
class CVector2D
{
var x, y;
function CVector2D (x_, y_) {
x = x_;
y = y_;
}
function reinit(x_, y_) {
x = x_;
y = y_;
}
function getUgol() {
return(Math.atan2(y, x));
}
function duplicate() {
return(new CVector2D(x, y));
}
function copyTo(v) {
v.x = x;
v.y = y;
}
function minus(v) {
x = x - v.x;
y = y - v.y;
}
function minusNew(v) {
return(new CVector2D(x - v.x, y - v.y));
}
function normalize() {
var _local2 = Math.sqrt((x * x) + (y * y));
x = x / _local2;
y = y / _local2;
}
function reverseNew() {
return(new CVector2D(-x, -y));
}
function scalar(v) {
return((x * v.x) + (y * v.y));
}
function modul() {
return(Math.sqrt((x * x) + (y * y)));
}
function reflectFromNormal(n) {
var _local2 = Math.atan2(n.y, n.x);
rotate(-_local2);
x = -x;
rotate(_local2);
}
function rotate(u) {
var _local4 = x;
var _local3 = y;
x = (_local4 * Math.cos(u)) - (_local3 * Math.sin(u));
y = (_local4 * Math.sin(u)) + (_local3 * Math.cos(u));
}
function rotateNew(u) {
return(new CVector2D((x * Math.cos(u)) - (y * Math.sin(u)), (x * Math.sin(u)) + (y * Math.cos(u))));
}
function mult(k) {
x = x * k;
y = y * k;
}
function multNew(k) {
return(new CVector2D(x * k, y * k));
}
function plus(v) {
x = x + v.x;
y = y + v.y;
}
function plusNew(v) {
return(new CVector2D(x + v.x, y + v.y));
}
function getDistanceTo(p1, p2) {
var _local3 = p1.y - p2.y;
var _local2 = p2.x - p1.x;
var _local6 = (p1.x * (p2.y - p1.y)) - (p1.y * (p2.x - p1.x));
var _local5 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
_local3 = _local3 / _local5;
_local2 = _local2 / _local5;
_local6 = _local6 / _local5;
return(((_local3 * x) + (_local2 * y)) + _local6);
}
}
Symbol 441 MovieClip [__Packages.CMan] Frame 0
class CMan extends MovieClip
{
var stopFlag, state, mc, gotoAndStop;
function CMan () {
super();
stopFlag = false;
state = 0;
}
function stopAnim() {
stopFlag = true;
}
function stopMCAnim() {
mc.stop();
}
function startAnim() {
stopFlag = false;
}
function onEnterFrame() {
if (stopFlag) {
return(undefined);
}
if (Key.isDown(LEFT_BUTTON)) {
toLeft();
} else if (Key.isDown(RIGHT_BUTTON)) {
toRight();
} else if ((state == 1) || (state == 2)) {
fromLeft();
} else if ((state == 4) || (state == 5)) {
fromRight();
}
}
function toLeft() {
var _local2;
if (state == 0) {
state = 1;
gotoAndStop("toLeft");
state = 1;
} else if (state == 3) {
_local2 = mc._currentframe;
gotoAndStop("toLeft");
mc.gotoAndPlay((ANIM_FRAMES - _local2) + 1);
state = 1;
} else if ((state == 4) || (state == 5)) {
fromRight();
state = 6;
}
}
function toRight() {
var _local2;
if (state == 0) {
state = 1;
gotoAndStop("toRight");
state = 4;
} else if (state == 6) {
_local2 = mc._currentframe;
gotoAndStop("toRight");
mc.gotoAndPlay((ANIM_FRAMES - _local2) + 1);
state = 4;
} else if ((state == 1) || (state == 2)) {
fromLeft();
state = 3;
}
}
function fromLeft() {
var _local2;
if (state == 1) {
_local2 = mc._currentframe;
gotoAndStop("fromLeft");
mc.gotoAndPlay((ANIM_FRAMES - _local2) + 1);
state = 3;
} else if (state == 2) {
gotoAndStop("fromLeft");
state = 3;
}
}
function fromRight() {
var _local2;
if (state == 4) {
_local2 = mc._currentframe;
gotoAndStop("fromRight");
mc.gotoAndPlay((ANIM_FRAMES - _local2) + 1);
state = 6;
} else if (state == 5) {
gotoAndStop("fromRight");
state = 6;
}
}
function endMove() {
if (state == 1) {
gotoAndStop("left");
state = 2;
} else if (state == 3) {
state = 0;
gotoAndStop("stay");
} else if (state == 4) {
state = 5;
gotoAndStop("right");
} else if (state == 6) {
state = 0;
gotoAndStop("stay");
}
}
static var LEFT_BUTTON = 37;
static var RIGHT_BUTTON = 39;
static var ANIM_FRAMES = 7;
}
Symbol 442 MovieClip [__Packages.Game] Frame 0
class Game extends MovieClip
{
var mcSound, attachMovie, levelTimeCounter, gameState, mcObjects, createEmptyMovieClip, scores, timeCounter, level, lastTimer, accFlag, accCounter, onEnterFrame, _parent;
function Game () {
super();
var _local4 = this;
CSoundService.createSoundService(new Array("SND_click", "SND_gas", "SND_loop", "SND_motor", "SND_lose", "SND_game_loop"), _root, 31999);
mcSound = attachMovie("mcSound", "mcSound", 10, {_x:0, _y:40});
Key.addListener(this);
levelTimeCounter = 0;
setState(STATE_MAINSCREEN);
}
function setState(numState) {
var path = this;
if (numState != STATE_PAUSE) {
gameState = numState;
}
if (((numState != STATE_LOSE) && (numState != STATE_WIN_LEVEL)) && (numState != STATE_PAUSE)) {
mcObjects.removeMovieClip();
mcObjects = createEmptyMovieClip("mcObjects", 1);
}
switch (numState) {
case STATE_MAINSCREEN :
CSoundService.playLoopSound(2);
scores = 0;
timeCounter = 0;
level = 1;
mcObjects.attachMovie("mc_Main", "mc_Main", 1);
mcObjects.mc_Main.Start.onRelease = function () {
path.setState(Game.STATE_GAME);
};
mcObjects.mc_Main.Start.onPress = function () {
CSoundService.playSound(0, 1, true);
};
mcObjects.mc_Main.How_to_Play.onRelease = function () {
path.setState(Game.STATE_RULES);
};
mcObjects.mc_Main.How_to_Play.onPress = function () {
CSoundService.playSound(0, 1, true);
};
mcObjects.mc_Main.About.onRelease = function () {
path.setState(Game.STATE_ABOUT);
};
mcObjects.mc_Main.About.onPress = function () {
CSoundService.playSound(0, 1, true);
};
break;
case STATE_RULES :
mcObjects.attachMovie("mc_HowToPlay", "mc_HowToPlay", 1);
mcObjects.mc_HowToPlay.Back.onRelease = function () {
path.setState(Game.STATE_MAINSCREEN);
};
mcObjects.mc_HowToPlay.Back.onPress = function () {
CSoundService.playSound(0, 1, true);
};
break;
case STATE_ABOUT :
mcObjects.attachMovie("mc_About", "mc_About", 1);
mcObjects.mc_About.Back.onRelease = function () {
path.setState(Game.STATE_MAINSCREEN);
};
mcObjects.mc_About.Back.onPress = function () {
CSoundService.playSound(0, 1, true);
};
mcObjects.mc_About.IriySoft.onRelease = function () {
path.getURL("http://www.iriysoft.ru", "_blank");
};
mcObjects.mc_About.IriySoft.onPress = function () {
CSoundService.playSound(0, 1, true);
};
mcObjects.mc_About.MindGames.onRelease = function () {
path.getURL("http://www.bestflashgames.com", "_blank");
};
mcObjects.mc_About.MindGames.onPress = function () {
CSoundService.playSound(0, 1, true);
};
break;
case STATE_GAME :
CSoundService.playLoopSound(5);
lastTimer = getTimer();
mcObjects.attachMovie("mc_levels", "mc_level", 1);
mcObjects.attachMovie("mc_timer", "mc_timer", 2, {_x:430, _y:10});
mcObjects.mc_level.gotoAndStop(level);
mcObjects.mc_level.mc.mc_hit._visible = false;
if (bikeSync == null) {
bikeSync = new CBikeSynchronizer();
engine = new CParticleEngine();
objCamera = new CCamera();
back1 = new CBack();
back2 = new CBack();
} else {
engine.clear();
}
back1.init(mcObjects.mc_level.mc.mc_fon.mc_grass.mc1, mcObjects.mc_level.mc.mc_fon.mc_grass.mc2, 1);
back2.init(mcObjects.mc_level.mc.mc_fon.mc_hill.mc1, mcObjects.mc_level.mc.mc_fon.mc_hill.mc2, 10);
bikeSync.init(mcObjects.mc_level.mc.mc_bike, 0, 0);
var _local2 = new CParticle(bikeSync.mc_back_wheel._x, bikeSync.mc_back_wheel._y, 3);
engine.addParticle(_local2);
engine.addWheel(bikeSync.mc_back_wheel, _local2, 28.5, 17.5);
var _local4 = new CParticle(bikeSync.mc_forward_wheel._x, bikeSync.mc_forward_wheel._y, 3);
engine.addParticle(_local4);
engine.addWheel(bikeSync.mc_forward_wheel, _local4, 10.5, 17.5);
var _local3 = new CParticle(bikeSync.mc_bike._x, bikeSync.mc_bike._y, 3);
_local3.mc = mcObjects.mc_level.mc.mc_bike.mc_test;
engine.addParticle(_local3);
engine.addSpringConstraint(_local2, _local4, 0.45, 0.5);
engine.addSpringConstraint(_local2, _local3, 0.45, 0.55);
engine.addSpringConstraint(_local3, _local4, 0.45, 0.7);
bikeSync.setParticles(_local3, _local2, _local4);
objCamera.init(bikeSync.mc_bike, mcObjects.mc_level.mc);
engine.setHitMovie(mcObjects.mc_level.mc.mc_hit);
engine.start();
accFlag = false;
accCounter = 50;
onEnterFrame = __game;
break;
case STATE_LOSE :
bikeSync.mc_bike.mc.mc_body_man.mc.stopAnim();
bikeSync.mc_bike.mc.mc_body_man.mc.stopMCAnim();
mcObjects.attachMovie("mc_window_Level", "mc_window_Level", 10);
mcObjects.mc_window_Level.gotoAndStop("lose");
mcObjects.mc_window_Level.levelTime = getTimeString(levelTimeCounter);
mcObjects.mc_window_Level.commonTime = getTimeString(timeCounter);
mcObjects.mc_window_Level.scores = scores;
mcObjects.mc_window_Level.menu.onRelease = function () {
path.setState(Game.STATE_MAINSCREEN);
};
mcObjects.mc_window_Level.menu.onPress = function () {
CSoundService.playSound(0, 1, true);
};
mcObjects.mc_window_Level.again.onRelease = function () {
path.setState(Game.STATE_GAME);
};
mcObjects.mc_window_Level.again.onPress = function () {
CSoundService.playSound(0, 1, true);
};
break;
case STATE_WIN_LEVEL :
bikeSync.mc_bike.mc.mc_body_man.mc.stopAnim();
bikeSync.mc_bike.mc.mc_body_man.mc.stopMCAnim();
if (level == 10) {
delete onEnterFrame;
_parent.gotoAndPlay(4);
} else {
mcObjects.attachMovie("mc_window_Level", "mc_window_Level", 10);
mcObjects.mc_window_Level.gotoAndStop("win_level");
mcObjects.mc_window_Level.next_level.onRelease = function () {
path.level++;
path.setState(Game.STATE_GAME);
};
mcObjects.mc_window_Level.next_level.onPress = function () {
CSoundService.playSound(0, 1, true);
};
mcObjects.mc_window_Level.menu.onRelease = function () {
path.setState(Game.STATE_MAINSCREEN);
};
mcObjects.mc_window_Level.menu.onPress = function () {
CSoundService.playSound(0, 1, true);
};
}
addLevelScores();
mcObjects.mc_window_Level.levelTime = getTimeString(levelTimeCounter);
mcObjects.mc_window_Level.commonTime = getTimeString(timeCounter);
mcObjects.mc_window_Level.scores = scores;
levelTimeCounter = 0;
break;
case STATE_PAUSE :
if (gameState == STATE_GAME) {
mcObjects.attachMovie("mc_window_Level", "mc_window_Level", 10);
mcObjects.mc_window_Level.gotoAndStop("pause");
gameState = STATE_PAUSE;
bikeSync.mc_bike.mc.mc_body_man.mc.stopAnim();
bikeSync.mc_bike.mc.mc_body_man.mc.stopMCAnim();
mcObjects.mc_window_Level.menu.onRelease = function () {
path.setState(Game.STATE_MAINSCREEN);
};
mcObjects.mc_window_Level.menu.onPress = function () {
CSoundService.playSound(0, 1, true);
};
mcObjects.mc_window_Level.restart.onRelease = function () {
path.setState(Game.STATE_GAME);
};
mcObjects.mc_window_Level.restart.onPress = function () {
CSoundService.playSound(0, 1, true);
};
mcObjects.mc_window_Level.resume.onRelease = function () {
path.setState(Game.STATE_PAUSE);
};
mcObjects.mc_window_Level.resume.onPress = function () {
CSoundService.playSound(0, 1, true);
};
} else {
if (gameState != STATE_PAUSE) {
break;
}
mcObjects.mc_window_Level.removeMovieClip();
gameState = STATE_GAME;
CSoundService.playLoopSound(5);
bikeSync.mc_bike.mc.mc_body_man.mc.startAnim();
}
}
}
function onKeyDown() {
if (Key.isDown(32)) {
if ((gameState == STATE_WIN_LEVEL) && (level != 10)) {
level++;
setState(STATE_GAME);
} else if (gameState == STATE_LOSE) {
setState(STATE_GAME);
}
} else if (Key.isDown(80)) {
setState(STATE_PAUSE);
}
updateAfterEvent();
}
function __game() {
var _local6;
var _local7;
_local6 = getTimer();
_local7 = _local6 - lastTimer;
lastTimer = _local6;
if (gameState == STATE_GAME) {
timeCounter = timeCounter + _local7;
levelTimeCounter = levelTimeCounter + _local7;
showTime();
var _local9 = 0;
var _local8 = 0;
var _local3;
var _local5;
accCounter++;
if (!accFlag) {
accFlag = Key.isDown(38);
if (accFlag && (accCounter > 10)) {
accCounter = 0;
CSoundService.playSound(1, 1, true);
}
} else {
accFlag = Key.isDown(38);
}
if (Key.isDown(CMan.LEFT_BUTTON)) {
_local3 = calcBikeNVector();
if (_local3.y > 0) {
_local5 = (Math.abs(_local3.y) * 0.2) + 0.8;
bikeSync.mc_forward_wheel.addedAcc.x = bikeSync.mc_forward_wheel.addedAcc.x - (((_local3.x * engine.gravity) / 1.1) * _local5);
bikeSync.mc_forward_wheel.addedAcc.y = bikeSync.mc_forward_wheel.addedAcc.y - (((_local3.y * engine.gravity) * 1.3) * _local5);
bikeSync.mc_back_wheel.addedAcc.x = bikeSync.mc_back_wheel.addedAcc.x + (((_local3.x * engine.gravity) / 1.5) * _local5);
bikeSync.mc_back_wheel.addedAcc.y = bikeSync.mc_back_wheel.addedAcc.y + ((_local3.y * engine.gravity) * _local5);
}
} else if (Key.isDown(CMan.RIGHT_BUTTON)) {
_local3 = calcBikeNVector();
if (_local3.y > 0) {
_local5 = (Math.abs(_local3.y) * 0.2) + 0.8;
bikeSync.mc_forward_wheel.addedAcc.x = bikeSync.mc_forward_wheel.addedAcc.x + (((_local3.x * engine.gravity) / 1.5) * _local5);
bikeSync.mc_forward_wheel.addedAcc.y = bikeSync.mc_forward_wheel.addedAcc.y + ((_local3.y * engine.gravity) * _local5);
bikeSync.mc_back_wheel.addedAcc.x = bikeSync.mc_back_wheel.addedAcc.x - (((_local3.x * engine.gravity) / 1.1) * _local5);
bikeSync.mc_back_wheel.addedAcc.y = bikeSync.mc_back_wheel.addedAcc.y - (((_local3.y * engine.gravity) * 1.3) * _local5);
}
}
engine.process();
bikeSync.process();
objCamera.process();
back1.process(mcObjects.mc_level.mc._x);
back2.process(mcObjects.mc_level.mc._x);
mcObjects.mc_level.mc.mc_fon._x = -mcObjects.mc_level.mc._x;
if ((bikeSync.mc_bike._x + mcObjects.mc_level.mc.mc_bike._x) >= mcObjects.mc_level.mc.mc_finish._x) {
setState(STATE_WIN_LEVEL);
return(undefined);
}
var _local2 = {x:0, y:0};
var _local4 = bikeSync.mc_bike.mc.mc_body_man.mc.mc.h;
_local2.x = _local4.p._x;
_local2.y = _local4.p._y;
_local4.localToGlobal(_local2);
if (mcObjects.mc_level.mc.mc_hit.hitTest(_local2.x, _local2.y, true)) {
CSoundService.playSound(4, 1, true);
bikeSync.mc_bike.mc.mc_body_man.mc.stopAnim();
bikeSync.mc_bike.mc.mc_body_man.mc.stopMCAnim();
onEnterFrame = lose;
return(undefined);
}
_local4 = bikeSync.mc_bike.mc.mc_body_man.mc.mc.b;
_local2.x = _local4.p._x;
_local2.y = _local4.p._y;
_local4.localToGlobal(_local2);
if (mcObjects.mc_level.mc.mc_hit.hitTest(_local2.x, _local2.y, true)) {
CSoundService.playSound(4, 1, true);
bikeSync.mc_bike.mc.mc_body_man.mc.stopAnim();
bikeSync.mc_bike.mc.mc_body_man.mc.stopMCAnim();
onEnterFrame = lose;
return(undefined);
}
_local4 = bikeSync.mc_bike.mc.mc_body_man.mc.mc.l;
_local2.x = _local4.p._x;
_local2.y = _local4.p._y;
_local4.localToGlobal(_local2);
if (mcObjects.mc_level.mc.mc_hit.hitTest(_local2.x, _local2.y, true)) {
CSoundService.playSound(4, 1, true);
bikeSync.mc_bike.mc.mc_body_man.mc.stopAnim();
bikeSync.mc_bike.mc.mc_body_man.mc.stopMCAnim();
onEnterFrame = lose;
return(undefined);
}
}
}
function lose() {
if (!CSoundService.soundIsPlay(4)) {
setState(STATE_LOSE);
onEnterFrame = __game;
}
}
function calcBikeNVector() {
var _local2;
_local2 = bikeSync.mc_forward_wheel.particle.pos.minusNew(bikeSync.mc_back_wheel.particle.pos);
_local2.normalize();
var _local3;
_local3 = _local2.x;
_local2.x = -_local2.y;
_local2.y = _local3;
return(_local2);
}
function addLevelScores() {
if (levelTimeCounter <= 15000) {
scores = scores + 500;
} else if (levelTimeCounter <= 80000) {
scores = scores + (100 + (300 * (1 - (levelTimeCounter / 70000))));
} else if (levelTimeCounter < 180000) {
scores = scores + 50;
}
scores = Math.round(scores);
_root.score = scores;
}
function showTime() {
mcObjects.mc_timer.txtTime = getTimeString(timeCounter);
}
function getTimeString(time) {
var _local1 = Math.round(time / 1000);
var _local2 = Math.floor(_local1 / 60);
_local1 = _local1 - (_local2 * 60);
var _local3;
var _local4;
if (_local1 < 10) {
_local4 = "0" + _local1;
} else {
_local4 = "" + _local1;
}
if (_local2 < 10) {
_local3 = "0" + _local2;
} else {
_local3 = "" + _local2;
}
return((_local3 + ":") + _local4);
}
static var STATE_MAINSCREEN = 1;
static var STATE_RULES = 2;
static var STATE_ABOUT = 3;
static var STATE_GAME = 4;
static var STATE_LOSE = 5;
static var STATE_WIN_LEVEL = 6;
static var STATE_PAUSE = 7;
var bikeSync = null;
var engine = null;
var objCamera = null;
var back1 = null;
var back2 = null;
}
Symbol 443 MovieClip [__Packages.CBikeSynchronizer] Frame 0
class CBikeSynchronizer
{
var fdir, fpos, bdir, bpos, mc_back_wheel, mc_forward_wheel, mc_bike, pBody, pBWheel, pFWheel;
function CBikeSynchronizer () {
fdir = new CVector2D(0, 0);
fpos = new CVector2D(0, 0);
bdir = new CVector2D(0, 0);
bpos = new CVector2D(0, 0);
}
function init(mc_container, sX, sY) {
var _local2 = {x:0, y:0};
mc_back_wheel = mc_container.attachMovie("lib_back_wheel", "back_w", 0);
mc_forward_wheel = mc_container.attachMovie("lib_forward_wheel", "forward_w", 1);
mc_bike = mc_container.attachMovie("lib_bike_body", "body", 2);
mc_bike._x = sX;
mc_bike._y = sY;
_local2.x = mc_bike.mc.mc_s_wheel_back._x;
_local2.y = mc_bike.mc.mc_s_wheel_back._y;
mc_bike.mc.localToGlobal(_local2);
mc_bike._parent.globalToLocal(_local2);
mc_back_wheel._x = _local2.x;
mc_back_wheel._y = _local2.y;
_local2.x = mc_bike.mc.mc_s_wheel_forward._x;
_local2.y = mc_bike.mc.mc_s_wheel_forward._y;
mc_bike.mc.localToGlobal(_local2);
mc_bike._parent.globalToLocal(_local2);
mc_forward_wheel._x = _local2.x;
mc_forward_wheel._y = _local2.y;
}
function setParticles(pBody_, pBWheel_, pFWheel_) {
pBody = pBody_;
pBWheel = pBWheel_;
pFWheel = pFWheel_;
fdir.reinit(mc_bike.mc.mc_f_point._x - mc_bike.mc.mc_s_wheel_forward._x, mc_bike.mc.mc_f_point._y - mc_bike.mc.mc_s_wheel_forward._y);
fdir.normalize();
fpos.x = mc_bike.mc.mc_f_spring._x + ((fdir.x * (-mc_bike.mc.mc_f_spring._y)) / fdir.y);
fpos.x = fpos.x - mc_bike.mc.mc_body_man._x;
bpos.reinit(mc_bike.mc.mc_b_spring.mc_top._x, mc_bike.mc.mc_b_spring.mc_top._y);
mc_bike.mc.mc_b_spring.localToGlobal(bpos);
bdir.reinit(bpos.x, bpos.y);
mc_bike.mc.mc_body_man.globalToLocal(bpos);
mc_bike.mc.globalToLocal(bdir);
bdir.x = bdir.x - mc_bike.mc.mc_b_spring._x;
bdir.y = bdir.y - mc_bike.mc.mc_b_spring._y;
}
function process() {
var _local2 = {x:0, y:0};
var _local3;
mc_bike._x = pBody.pos.x;
mc_bike._y = pBody.pos.y;
_local3 = pFWheel.pos.minusNew(pBWheel.pos);
mc_bike._rotation = (Math.atan2(_local3.y, _local3.x) * 180) / Math.PI;
_local2.x = pFWheel.pos.x;
_local2.y = pFWheel.pos.y;
mc_bike._parent.localToGlobal(_local2);
mc_bike.mc.globalToLocal(_local2);
mc_bike.mc.mc_f_spring._x = _local2.x;
mc_bike.mc.mc_f_spring._y = _local2.y;
var _local4 = ((_local2.x + ((fdir.x * (-_local2.y)) / fdir.y)) - mc_bike.mc.mc_body_man._x) - fpos.x;
mc_bike.mc.mc_body_man._x = mc_bike.mc.mc_body_man._x + _local4;
mc_bike.mc.mc_f_spring.mc_spring._xscale = mc_bike.mc.mc_f_spring._y * 10;
_local2.x = mc_bike.mc.mc_f_spring.mc_spring._x;
_local2.y = mc_bike.mc.mc_f_spring.mc_spring._y;
mc_bike.mc.mc_f_spring.localToGlobal(_local2);
mc_bike.mc.globalToLocal(_local2);
mc_bike.mc.mc_f_spring.mc_spring._xscale = _local2.y * 10;
_local2.x = pBWheel.pos.x;
_local2.y = pBWheel.pos.y;
mc_bike._parent.localToGlobal(_local2);
mc_bike.mc.globalToLocal(_local2);
mc_bike.mc.mc_b_spring._x = _local2.x;
mc_bike.mc.mc_b_spring._y = _local2.y;
_local3.reinit(bpos.x, bpos.y);
mc_bike.mc.mc_body_man.localToGlobal(_local3);
mc_bike.mc.globalToLocal(_local3);
_local3.x = _local3.x - mc_bike.mc.mc_b_spring._x;
_local3.y = _local3.y - mc_bike.mc.mc_b_spring._y;
mc_bike.mc.mc_b_spring._rotation = ((_local3.getUgol() - bdir.getUgol()) * 180) / Math.PI;
}
}
Symbol 444 MovieClip [__Packages.CParticleEngine] Frame 0
class CParticleEngine
{
var hit_mc, prevTime;
function CParticleEngine () {
}
function clear() {
while (p_array.pop() != undefined) {
}
while (w_array.pop() != undefined) {
}
while (c_array.pop() != undefined) {
}
}
function setHitMovie(hit_mc_) {
hit_mc = hit_mc_;
}
function addParticle(p) {
p_array.push(p);
}
function addWheel(wheel, p, maxSpeed, radius) {
wheel.init(p, maxSpeed, radius);
w_array.push(wheel);
}
function addSpringConstraint(p1, p2, koeffStiff1, koeffStiff2) {
var _local2 = new CSpringConstraint(p1, p2, koeffStiff1, koeffStiff2);
c_array.push(_local2);
}
function start() {
prevTime = getTimer();
}
function computeForces() {
var _local2;
var _local3 = p_array.length;
_local2 = 0;
while (_local2 < _local3) {
p_array[_local2].acc.x = 0;
p_array[_local2].acc.y = gravity * p_array[_local2].mass;
_local2++;
}
}
function clearForces() {
var _local4 = w_array.length;
var _local2;
var _local3;
_local2 = 0;
while (_local2 < _local4) {
_local3 = w_array[_local2];
_local3.addedAcc.x = (_local3.addedAcc.y = 0);
_local2++;
}
}
function applyManFrictions() {
var _local3 = w_array.length;
var _local2;
_local2 = 0;
while (_local2 < _local3) {
w_array[_local2].applyAddedAcc();
_local2++;
}
}
function verlet(dTime) {
var _local6 = 0.995;
var _local2;
var _local3 = p_array.length;
_local2 = 0;
while (_local2 < _local3) {
p_array[_local2].verlet(dTime, _local6);
_local2++;
}
_local3 = w_array.length;
var _local5 = 0;
if (Key.isDown(40)) {
_local5 = -0.6;
} else if (Key.isDown(38)) {
_local5 = 1;
}
_local2 = 0;
while (_local2 < _local3) {
w_array[_local2].process(dTime, (w_array[_local2].maxAccSpeed * _local5) / 3.2, 0.1);
_local2++;
}
}
function checkCollisions() {
var _local2;
var _local3 = w_array.length;
_local2 = 0;
while (_local2 < _local3) {
w_array[_local2].checkCollision(hit_mc);
_local2++;
}
}
function checkConstraints(dTime) {
var _local2;
var _local3 = c_array.length;
_local2 = 0;
while (_local2 < _local3) {
c_array[_local2].resolve(dTime);
_local2++;
}
}
function process() {
var _local4 = getTimer();
var _local5 = (_local4 - prevTime) / 1000;
prevTime = _local4;
var _local2;
var _local3 = Math.min(Math.round(_local5 / t), maxSteps);
_local2 = 0;
while (_local2 < _local3) {
computeForces();
applyManFrictions();
verlet(t);
checkConstraints(t);
checkCollisions();
_local2++;
}
clearForces();
}
var p_array = new Array();
var w_array = new Array();
var c_array = new Array();
var t = 0.02;
var maxSteps = 2;
var gravity = 3.15;
}
Symbol 445 MovieClip [__Packages.CSpringConstraint] Frame 0
class CSpringConstraint
{
var p1, p2, koeffStiffPress, koeffStiffStretch, relaxLen;
function CSpringConstraint (p1_, p2_, koeffStiffPress_, koeffStiffStretch_) {
p1 = p1_;
p2 = p2_;
koeffStiffPress = koeffStiffPress_;
koeffStiffStretch = koeffStiffStretch_;
var _local2 = new CVector2D(p1.pos.x - p2.pos.x, p1.pos.y - p2.pos.y);
relaxLen = _local2.modul();
}
function resolve(dTime) {
var _local2 = new CVector2D(p1.pos.x - p2.pos.x, p1.pos.y - p2.pos.y);
var _local4 = _local2.modul();
var _local5 = (relaxLen - _local4) / _local4;
_local2.mult(_local5);
var _local3;
if (_local4 > relaxLen) {
_local3 = koeffStiffStretch;
} else {
_local3 = koeffStiffPress;
}
p2.pos.x = p2.pos.x - (((_local2.x * ((p1.mass / (p1.mass + p2.mass)) + 1)) / 2) * _local3);
p2.pos.y = p2.pos.y - (((_local2.y * ((p1.mass / (p1.mass + p2.mass)) + 1)) / 2) * _local3);
p1.pos.x = p1.pos.x + (((_local2.x * ((p2.mass / (p1.mass + p2.mass)) + 1)) / 2) * _local3);
p1.pos.y = p1.pos.y + (((_local2.y * ((p2.mass / (p1.mass + p2.mass)) + 1)) / 2) * _local3);
}
}
Symbol 446 MovieClip [__Packages.CCamera] Frame 0
class CCamera
{
var targetMovie, levelMovie;
function CCamera () {
}
function init(targetMovie_, levelMovie_) {
targetMovie = targetMovie_;
levelMovie = levelMovie_;
process();
}
function process() {
var _local2 = {x:targetMovie._x, y:targetMovie._y};
targetMovie._parent.localToGlobal(_local2);
levelMovie._parent.globalToLocal(_local2);
levelMovie._x = levelMovie._x + (SCREEN_WIDTH2 - _local2.x);
levelMovie._y = levelMovie._y + (SCREEN_HEIGHT2 - _local2.y);
levelMovie._x = Math.round(levelMovie._x);
levelMovie._y = Math.round(levelMovie._y);
if (levelMovie._x > 0) {
levelMovie._x = 0;
} else if ((levelMovie._x + levelMovie._width) < SCREEN_WIDTH) {
levelMovie._x = SCREEN_WIDTH - levelMovie._width;
}
if (levelMovie._y < 0) {
levelMovie._y = 0;
}
}
static var SCREEN_WIDTH = 500;
static var SCREEN_HEIGHT = 400;
static var SCREEN_WIDTH2 = SCREEN_WIDTH / 2;
static var SCREEN_HEIGHT2 = SCREEN_HEIGHT / 2;
}
Symbol 447 MovieClip [__Packages.CBack] Frame 0
class CBack
{
var mc1, mc2, scaleFactor;
function CBack () {
}
function init(mc1_, mc2_, scaleFactor_) {
mc1 = mc1_;
mc2 = mc2_;
scaleFactor = scaleFactor_;
}
function process(levelX) {
levelX = Math.abs(Math.round(levelX) / scaleFactor) % mc1._width;
mc1._x = -levelX;
mc2._x = (mc1._x + mc1._width) - 1;
}
static var SCREEN_WIDTH = 500;
}
Instance of Symbol 67 MovieClip in Symbol 93 MovieClip [mc_Main] Frame 1
on (press) {
getURL ("http://www.bestflashgames.com", "_blank");
}
Symbol 181 MovieClip [lib_back_wheel] Frame 1
#initclip 15
Object.registerClass("lib_back_wheel", CWheel);
#endinitclip
Symbol 188 MovieClip [lib_forward_wheel] Frame 1
#initclip 13
Object.registerClass("lib_forward_wheel", CWheel);
#endinitclip
Symbol 214 MovieClip Frame 7
this._parent.endMove();
Symbol 215 MovieClip Frame 7
this._parent.endMove();
Symbol 216 MovieClip Frame 7
this._parent.endMove();
Symbol 217 MovieClip Frame 7
this._parent.endMove();
Symbol 220 MovieClip [lib_man] Frame 1
#initclip 14
Object.registerClass("lib_man", CMan);
#endinitclip
this.stop();
Symbol 233 Button
on (press) {
CSoundService.soundOff();
this.gotoAndStop(2);
}
Symbol 236 Button
on (press) {
CSoundService.soundOn();
this.gotoAndStop(1);
}
Symbol 237 MovieClip [mcSound] Frame 1
this.stop();
Symbol 245 MovieClip Frame 1
stop();
Symbol 314 MovieClip Frame 40
stop();
Symbol 322 MovieClip Frame 1
stop();
Symbol 332 MovieClip Frame 1
stop();
Symbol 332 MovieClip Frame 2
stop();
Symbol 332 MovieClip Frame 12
stop();
Symbol 332 MovieClip Frame 22
stop();
Symbol 339 Button
on (press) {
_parent.field.scroll = Math.max(1, _parent.field.scroll - 1);
}
Symbol 342 Button
on (press) {
_parent.field.scroll = Math.min(_parent.field.maxscroll, _parent.field.scroll + 1);
}
Instance of Symbol 315 MovieClip in Symbol 345 MovieClip Frame 1
onClipEvent (load) {
_parent.field.text = _root[_parent.root_var_name];
if (_parent.field.maxscroll > 1) {
_parent.up._visible = true;
_parent.down._visible = true;
} else {
_parent.up._visible = false;
_parent.down._visible = false;
}
}
onClipEvent (enterFrame) {
}
Symbol 347 MovieClip Frame 1
stop();
Symbol 347 MovieClip Frame 2
stop();
Symbol 350 MovieClip Frame 1
stop();
Symbol 350 MovieClip Frame 2
stop();
Instance of Symbol 345 MovieClip in Symbol 350 MovieClip Frame 2
//component parameters
onClipEvent (construct) {
root_var_name = "eyeland_hs_currentmessage";
}
Symbol 350 MovieClip Frame 10
stop();
Symbol 350 MovieClip Frame 21
stop();
Symbol 350 MovieClip Frame 34
stop();
Symbol 350 MovieClip Frame 47
stop();
Instance of Symbol 345 MovieClip in Symbol 350 MovieClip Frame 47
//component parameters
onClipEvent (construct) {
root_var_name = "eyeland_hs_currentmessage";
}
Symbol 359 Button
on (release) {
_root.eyeland_hs_p = (_root.eyeland_hs_e = "");
_root.eyeland_hs_p = _parent.enter_screens.field_name.holder.name;
_root.eyeland_hs_e = _parent.enter_screens.field_email.holder.email;
_parent.gotoAndPlay("save");
}
Symbol 362 Button
on (release) {
_parent.gotoAndPlay("load");
}
Symbol 367 Button
on (release) {
btn_press();
}
Symbol 370 Button
on (release) {
_root._quality = _root.eyeland_hs_quality;
_parent._parent.play();
}
Symbol 373 MovieClip Frame 1
stop();
Symbol 373 MovieClip Frame 2
stop();
Symbol 373 MovieClip Frame 3
stop();
Symbol 404 MovieClip Frame 1
stop();
Symbol 404 MovieClip Frame 25
stop();
Symbol 404 MovieClip Frame 47
stop();
Symbol 404 MovieClip Frame 66
stop();
Symbol 404 MovieClip Frame 82
stop();
Symbol 404 MovieClip Frame 102
stop();
Instance of Symbol 404 MovieClip "line" in Symbol 405 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "line") {
this._visible = false;
}
}
Symbol 409 Button
on (press) {
if (!_parent._parent.script.draggable) {
return(undefined);
}
this.startDrag(false, _parent._parent.script.dragx, _parent._parent.script.topdragy, _parent._parent.script.dragx, _parent._parent.script.topdragy + _parent._parent.script.dragheight);
_parent._parent.script.drag = true;
}
on (release, releaseOutside) {
if (!_parent._parent.script.draggable) {
return(undefined);
}
this.stopDrag();
_parent._parent.script.drag = false;
}
Symbol 413 Button
on (press) {
_parent._parent.script.pressup = (_parent._parent.script.moveup = true);
}
on (release, releaseOutside) {
_parent._parent.script.pressup = false;
}
Symbol 416 Button
on (press) {
_parent._parent.script.pressdown = (_parent._parent.script.movedown = true);
}
on (release, releaseOutside) {
_parent._parent.script.pressdown = false;
}
Symbol 424 MovieClip Frame 1
stop();
Symbol 435 MovieClip [lose_interface] Frame 1
function rand_str() {
var _local3 = "";
var _local4 = 10;
var _local2 = "abcdefghijklmnopqrstuvwxyz";
var _local1 = 0;
while (_local1 < _local4) {
_local3 = _local3 + _local2.charAt(Math.floor(Math.random() * _local2.length));
_local1++;
}
return(_local3);
}
function rhex(num) {
str = "";
j = 0;
while (j <= 3) {
str = str + (hex_chr.charAt((num >> ((j * 8) + 4)) & 15) + hex_chr.charAt((num >> (j * 8)) & 15));
j++;
}
return(str);
}
function str2blks_MD5(str) {
nblk = ((str.length + 8) >> 6) + 1;
blks = new Array(nblk * 16);
i = 0;
while (i < (nblk * 16)) {
blks[i] = 0;
i++;
}
i = 0;
while (i < str.length) {
blks[i >> 2] = blks[i >> 2] | (str.charCodeAt(i) << ((i % 4) * 8));
i++;
}
blks[i >> 2] = blks[i >> 2] | (128 << ((i % 4) * 8));
blks[(nblk * 16) - 2] = str.length * 8;
return(blks);
}
function add2(x, y) {
var _local1 = (x & 65535) + (y & 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | (_local1 & 65535));
}
function rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
function cmn(q, a, b, x, s, t) {
return(add2(rol(add2(add2(a, q), add2(x, t)), s), b));
}
function ff(a, b, c, d, x, s, t) {
return(cmn((b & c) | ((~b) & d), a, b, x, s, t));
}
function gg(a, b, c, d, x, s, t) {
return(cmn((b & d) | (c & (~d)), a, b, x, s, t));
}
function hh(a, b, c, d, x, s, t) {
return(cmn((b ^ c) ^ d, a, b, x, s, t));
}
function ii(a, b, c, d, x, s, t) {
return(cmn(c ^ (b | (~d)), a, b, x, s, t));
}
function calcMD5(str) {
x = str2blks_MD5(str);
a = 1732584193 /* 0x67452301 */;
b = -271733879;
c = -1732584194;
d = 271733878 /* 0x10325476 */;
i = 0;
while (i < x.length) {
olda = a;
oldb = b;
oldc = c;
oldd = d;
a = ff(a, b, c, d, x[i + 0], 7, -680876936);
d = ff(d, a, b, c, x[i + 1], 12, -389564586);
c = ff(c, d, a, b, x[i + 2], 17, 606105819);
b = ff(b, c, d, a, x[i + 3], 22, -1044525330);
a = ff(a, b, c, d, x[i + 4], 7, -176418897);
d = ff(d, a, b, c, x[i + 5], 12, 1200080426);
c = ff(c, d, a, b, x[i + 6], 17, -1473231341);
b = ff(b, c, d, a, x[i + 7], 22, -45705983);
a = ff(a, b, c, d, x[i + 8], 7, 1770035416);
d = ff(d, a, b, c, x[i + 9], 12, -1958414417);
c = ff(c, d, a, b, x[i + 10], 17, -42063);
b = ff(b, c, d, a, x[i + 11], 22, -1990404162);
a = ff(a, b, c, d, x[i + 12], 7, 1804603682);
d = ff(d, a, b, c, x[i + 13], 12, -40341101);
c = ff(c, d, a, b, x[i + 14], 17, -1502002290);
b = ff(b, c, d, a, x[i + 15], 22, 1236535329);
a = gg(a, b, c, d, x[i + 1], 5, -165796510);
d = gg(d, a, b, c, x[i + 6], 9, -1069501632);
c = gg(c, d, a, b, x[i + 11], 14, 643717713);
b = gg(b, c, d, a, x[i + 0], 20, -373897302);
a = gg(a, b, c, d, x[i + 5], 5, -701558691);
d = gg(d, a, b, c, x[i + 10], 9, 38016083);
c = gg(c, d, a, b, x[i + 15], 14, -660478335);
b = gg(b, c, d, a, x[i + 4], 20, -405537848);
a = gg(a, b, c, d, x[i + 9], 5, 568446438);
d = gg(d, a, b, c, x[i + 14], 9, -1019803690);
c = gg(c, d, a, b, x[i + 3], 14, -187363961);
b = gg(b, c, d, a, x[i + 8], 20, 1163531501);
a = gg(a, b, c, d, x[i + 13], 5, -1444681467);
d = gg(d, a, b, c, x[i + 2], 9, -51403784);
c = gg(c, d, a, b, x[i + 7], 14, 1735328473);
b = gg(b, c, d, a, x[i + 12], 20, -1926607734);
a = hh(a, b, c, d, x[i + 5], 4, -378558);
d = hh(d, a, b, c, x[i + 8], 11, -2022574463);
c = hh(c, d, a, b, x[i + 11], 16, 1839030562);
b = hh(b, c, d, a, x[i + 14], 23, -35309556);
a = hh(a, b, c, d, x[i + 1], 4, -1530992060);
d = hh(d, a, b, c, x[i + 4], 11, 1272893353);
c = hh(c, d, a, b, x[i + 7], 16, -155497632);
b = hh(b, c, d, a, x[i + 10], 23, -1094730640);
a = hh(a, b, c, d, x[i + 13], 4, 681279174);
d = hh(d, a, b, c, x[i + 0], 11, -358537222);
c = hh(c, d, a, b, x[i + 3], 16, -722521979);
b = hh(b, c, d, a, x[i + 6], 23, 76029189);
a = hh(a, b, c, d, x[i + 9], 4, -640364487);
d = hh(d, a, b, c, x[i + 12], 11, -421815835);
c = hh(c, d, a, b, x[i + 15], 16, 530742520);
b = hh(b, c, d, a, x[i + 2], 23, -995338651);
a = ii(a, b, c, d, x[i + 0], 6, -198630844);
d = ii(d, a, b, c, x[i + 7], 10, 1126891415);
c = ii(c, d, a, b, x[i + 14], 15, -1416354905);
b = ii(b, c, d, a, x[i + 5], 21, -57434055);
a = ii(a, b, c, d, x[i + 12], 6, 1700485571);
d = ii(d, a, b, c, x[i + 3], 10, -1894986606);
c = ii(c, d, a, b, x[i + 10], 15, -1051523);
b = ii(b, c, d, a, x[i + 1], 21, -2054922799);
a = ii(a, b, c, d, x[i + 8], 6, 1873313359);
d = ii(d, a, b, c, x[i + 15], 10, -30611744);
c = ii(c, d, a, b, x[i + 6], 15, -1560198380);
b = ii(b, c, d, a, x[i + 13], 21, 1309151649);
a = ii(a, b, c, d, x[i + 4], 6, -145523070);
d = ii(d, a, b, c, x[i + 11], 10, -1120210379);
c = ii(c, d, a, b, x[i + 2], 15, 718787259);
b = ii(b, c, d, a, x[i + 9], 21, -343485551);
a = add2(a, olda);
b = add2(b, oldb);
c = add2(c, oldc);
d = add2(d, oldd);
i = i + 16;
}
return(((rhex(a) + rhex(b)) + rhex(c)) + rhex(d));
}
var hex_chr = "0123456789abcdef";
_root.eyeland_hs_quality = _root._quality;
_root._quality = "HIGH";
var challenged = false;
_root.eyeland_hs_players = new Array();
_parent.stop();
stop();
Instance of Symbol 315 MovieClip "loader" in Symbol 435 MovieClip [lose_interface] Frame 1
onClipEvent (load) {
if ((((_root.eyeland_hs_highscore_url == undefined) || (_root.eyeland_hs_game_id == undefined)) || (_root.eyeland_hs_score_variable == undefined)) || (_root.eyeland_hs_button_label == undefined)) {
trace("== GIAF HS ERROR == Highscore variables not found. Use the \"giaf hs settings\" component on a scene prior to this one to set the highscore variables correctly.");
}
if (_root[_root.eyeland_hs_score_variable] == undefined) {
trace(("== GIAF HS ERROR == Highscore variable \"_root." + _root.eyeland_hs_score_variable) + "\" not set. Please adjust your game's code to make sure this score variable is set before attempting to save it to the server. Use the \"giaf hs settings\" component to set the name of the score variable.");
}
_parent.highscore_url = _root.eyeland_hs_highscore_url;
_parent.game_id = _root.eyeland_hs_game_id;
_parent.score_variable = _root.eyeland_hs_score_variable;
_parent.button_label = _root.eyeland_hs_button_label;
var score = _root[_parent.score_variable];
loadVariables ((((((_parent.highscore_url + "?action=check&id=") + _parent.game_id) + "&score=") + score) + "&rand=") + Math.round(Math.random() * 999999999), this);
}
onClipEvent (data) {
_root.eyeland_hs_result = result;
_root.eyeland_hs_lowscore = lowscore;
_root.eyeland_hs_recordplayeremail = recordplayeremail;
_root.eyeland_hs_harvest_all_emails = harvest_all_emails;
_root.eyeland_hs_emailpromptmessage = unescape(emailpromptmessage);
_root.eyeland_hs_lowscoremessage = lowscoremessage;
_root.eyeland_hs_maxchars = Number(maxchars);
_parent.gotoAndPlay("enter");
}
Symbol 435 MovieClip [lose_interface] Frame 12
function show_prompt(high) {
btn_submit._visible = true;
btn_skip._visible = true;
if (high) {
_root.eyeland_hs_currentmessage = _root.eyeland_hs_emailpromptmessage;
} else {
_root.eyeland_hs_currentmessage = _root.eyeland_hs_lowscoremessage.split("%").join(_root.eyeland_hs_lowscore);
}
if (_root.eyeland_hs_maxchars > 0) {
if ((_root.eyeland_hs_recordplayeremail == "yes") || (_root.eyeland_hs_harvest_all_emails == "yes")) {
enter_screens.gotoAndPlay("enter_email");
enter_screens.field_email.holder.gotoAndPlay("field");
} else {
enter_screens.gotoAndPlay("enter");
}
if (_root.eyeland_hs_maxchars == 3) {
enter_screens.name_label.gotoAndStop(2);
}
enter_screens.field_name.holder.gotoAndPlay("name" + _root.eyeland_hs_maxchars);
} else if ((_root.eyeland_hs_recordplayeremail == "yes") || (_root.eyeland_hs_harvest_all_emails == "yes")) {
enter_screens.gotoAndPlay("enter_email_only");
enter_screens.field_email.holder.gotoAndPlay("field");
} else {
if (high) {
_root.eyeland_hs_currentmessage = _root.eyeland_hs_nonamemessage;
}
enter_screens.gotoAndPlay("message_only");
}
}
_root.eyeland_hs_nonamemessage = "You got a high score!\nClick Submit to record your score anonymously.";
btn_submit._visible = false;
btn_skip._visible = false;
btn_scores._visible = false;
btn_scores._y = btn_submit._y;
btn_playagain._visible = false;
btn_playagain._y = btn_skip._y;
btn_challenge._visible = false;
btn_challenge._y = btn_skip._y;
if (_root.eyeland_hs_result == "yes") {
show_prompt(true);
} else if (_root.eyeland_hs_harvest_all_emails == "yes") {
show_prompt(false);
} else {
btn_scores._visible = true;
btn_playagain._visible = true;
if (_root.eyeland_hs_emailtofriend != "no") {
btn_challenge._visible = true;
} else {
btn_scores._x = btn_scores._x + 50;
btn_playagain._x = btn_playagain._x - 50;
}
_root.eyeland_hs_currentmessage = _root.eyeland_hs_lowscoremessage.split("%").join(_root.eyeland_hs_lowscore);
enter_screens.gotoAndPlay("message_only");
}
stop();
Instance of Symbol 369 MovieClip "btn_challenge" in Symbol 435 MovieClip [lose_interface] Frame 12
onClipEvent (load) {
function btn_press() {
_parent.gotoAndPlay("chform");
}
}
Instance of Symbol 373 MovieClip "btn_playagain" in Symbol 435 MovieClip [lose_interface] Frame 12
onClipEvent (load) {
if (_parent.button_label == "Play Again") {
gotoAndPlay (2);
} else if (_parent.button_label == "Continue") {
gotoAndPlay (3);
}
}
Instance of Symbol 315 MovieClip in Symbol 435 MovieClip [lose_interface] Frame 12
onClipEvent (load) {
_parent.score1 = (_parent.score2 = _root[_parent.score_variable]);
}
Symbol 435 MovieClip [lose_interface] Frame 22
stop();
Instance of Symbol 315 MovieClip "copy_to_root" in Symbol 435 MovieClip [lose_interface] Frame 22
onClipEvent (data) {
_root.eyeland_hs_players = new Array();
_root.eyeland_hs_scores = new Array();
_root.eyeland_hs_dates = new Array();
_root.eyeland_hs_maxscores = this.maxscores;
_root.eyeland_hs_current = this.current;
_root.eyeland_hs_showdate = this.showdate;
_root.eyeland_hs_cleardate = this.cleardate;
_root.eyeland_hs_emailtofriend = this.emailtofriend;
var n = 0;
while (n < numscores) {
_root.eyeland_hs_players.push(unescape(this["p" + n]));
_root.eyeland_hs_scores.push(this["s" + n]);
_root.eyeland_hs_dates.push(unescape(this["d" + n]));
n++;
}
_parent.gotoAndPlay("show");
}
Instance of Symbol 315 MovieClip in Symbol 435 MovieClip [lose_interface] Frame 22
onClipEvent (load) {
var score = _root[_parent.score_variable];
var url = ((((_parent.highscore_url + "?action=get&id=") + _parent.game_id) + "&rand=") + Math.round(Math.random() * 999999999));
loadVariables (url, _parent.copy_to_root);
}
Symbol 435 MovieClip [lose_interface] Frame 31
stop();
Instance of Symbol 315 MovieClip in Symbol 435 MovieClip [lose_interface] Frame 31
onClipEvent (load) {
var score = _root[_parent.score_variable];
var rand = _parent.rand_str();
var url = ((((((((((((_parent.highscore_url + "?action=set&id=") + _parent.game_id) + "&player=") + escape(_root.eyeland_hs_p)) + "&score=") + score) + "&email=") + escape(_root.eyeland_hs_e)) + "&rand=") + rand) + "&rand2=") + _parent.calcMD5(((((_parent.game_id + "-") + score) + "-") + rand) + "...you shall not pass"));
loadVariables (url, _parent.copy_to_root);
}
Symbol 435 MovieClip [lose_interface] Frame 40
if (_root.eyeland_hs_emailtofriend == "no") {
chbutton._visible = false;
}
stop();
Instance of Symbol 373 MovieClip "playagain" in Symbol 435 MovieClip [lose_interface] Frame 40
onClipEvent (load) {
if (_parent.button_label == "Play Again") {
this.gotoAndPlay(2);
} else {
this.gotoAndPlay(3);
}
}
Instance of Symbol 369 MovieClip "chbutton" in Symbol 435 MovieClip [lose_interface] Frame 40
onClipEvent (load) {
function btn_press() {
_parent.gotoAndPlay("chform");
}
}
Instance of Symbol 315 MovieClip "script" in Symbol 435 MovieClip [lose_interface] Frame 40
onClipEvent (load) {
var topliney = _parent.showbg.list.line._y;
var topdragy = _parent.showbg.dragger._y;
var dragx = _parent.showbg.dragger._x;
var dragheight = 73;
var fieldheight = 167.2;
var maxdragamount = (-fieldheight);
var drag = ((dragonce = false));
var pressup = ((moveup = (pressdown = (movedown = false))));
var linedist = 0;
var curr_dist = 0;
var draggable = false;
_parent.showbg.dragger._alpha = 30;
_parent.showbg.up._alpha = 30;
_parent.showbg.down._alpha = 30;
_parent.clearedmsg = "Your score: " + _root[_parent.score_variable];
if (_root.eyeland_hs_cleardate != "00/00/00") {
_parent.clearedmsg = _parent.clearedmsg + ("\nScore table cleared " + _root.eyeland_hs_cleardate);
}
var n = 0;
while (n < _root.eyeland_hs_maxscores) {
_parent.showbg.list.line.duplicateMovieClip("l" + n, n);
var obj = _parent.showbg.list["l" + n];
if (n != _root.eyeland_hs_current) {
obj.flashbox._visible = false;
}
if (_root.eyeland_hs_showdate == "yes") {
if (_root.eyeland_hs_maxchars > 0) {
obj.gotoAndPlay("name_score_date");
} else {
obj.gotoAndPlay("score_date");
}
} else if (_root.eyeland_hs_maxchars == 0) {
obj.gotoAndPlay("score_only");
}
obj._y = obj._y + curr_dist;
obj.number = (n + 1) + ".";
if (n < _root.eyeland_hs_players.length) {
obj.player = ((_root.eyeland_hs_players[n] == "") ? "anonymous" : (_root.eyeland_hs_players[n]));
obj.score = _root.eyeland_hs_scores[n];
obj.date = _root.eyeland_hs_dates[n];
if (obj.player.maxscroll > 1) {
if (_root.eyeland_hs_showdate == "yes") {
obj.gotoAndPlay("name_score_date_tall");
} else {
obj.gotoAndPlay("name_score_tall");
}
}
} else {
obj.anonymous._visible = false;
obj.player = "";
obj.score = "0";
obj.date = "";
}
curr_dist = curr_dist + obj.flashbox._height;
maxdragamount = maxdragamount + obj.flashbox._height;
if (n == (_root.eyeland_hs_maxscores - 1)) {
obj.hline._visible = false;
}
n++;
}
var bobj = _parent.showbg.list["l" + (_root.eyeland_hs_players.length - 1)];
if (maxdragamount > 0) {
var draggable = true;
_parent.showbg.dragger._alpha = 100;
_parent.showbg.up._alpha = 100;
_parent.showbg.down._alpha = 100;
} else {
var draggable = false;
}
_parent.playagain._alpha = 100;
if (_parent.challenged) {
_parent.challenged_message.play();
_parent.challenged = false;
}
}
onClipEvent (enterFrame) {
if (moveup && (draggable)) {
_parent.showbg.dragger._y = Math.max(_parent.showbg.dragger._y - 2, topdragy);
dragonce = true;
}
if (!pressup) {
moveup = false;
}
if (movedown && (draggable)) {
_parent.showbg.dragger._y = Math.min(_parent.showbg.dragger._y + 2, topdragy + dragheight);
dragonce = true;
}
if (!pressdown) {
movedown = false;
}
if (drag || (dragonce)) {
linedist = ((_parent.showbg.dragger._y - topdragy) / dragheight) * maxdragamount;
if ((_parent.showbg.dragger._y - topdragy) < 1) {
linedist = 0;
}
if ((_parent.showbg.dragger._y - topdragy) > (dragheight - 1)) {
linedist = maxdragamount;
}
_parent.showbg.list.l0._y = topliney - linedist;
var n = 1;
while (n < _root.eyeland_hs_maxscores) {
_parent.showbg.list["l" + n]._y = _parent.showbg.list["l" + (n - 1)]._y + _parent.showbg.list["l" + (n - 1)].flashbox._height;
n++;
}
dragonce = false;
}
}
Symbol 435 MovieClip [lose_interface] Frame 49
message = ("You scored " + _root[score_variable]) + " points! To challenge a friend to beat your score, enter their email address in the field below and click CHALLENGE!";
yourname = _root.eyeland_hs_p;
stop();
Instance of Symbol 432 MovieClip in Symbol 435 MovieClip [lose_interface] Frame 49
onClipEvent (load) {
function btn_press() {
if (_root.eyeland_hs_players.length > 0) {
_parent.gotoAndPlay("show");
} else {
_parent.gotoAndPlay("load");
}
}
}
Instance of Symbol 434 MovieClip in Symbol 435 MovieClip [lose_interface] Frame 49
onClipEvent (load) {
function btn_press() {
_root.eyeland_hs_friendemail = _parent.friendemail;
_root.eyeland_hs_yourname = _parent.yourname;
_parent.gotoAndPlay("challenge");
}
}
Symbol 435 MovieClip [lose_interface] Frame 60
stop();
Instance of Symbol 315 MovieClip "challenge_handler" in Symbol 435 MovieClip [lose_interface] Frame 60
onClipEvent (data) {
if (_root.eyeland_hs_players.length > 0) {
_parent.gotoAndPlay("show");
} else {
_parent.gotoAndPlay("load");
}
}
Instance of Symbol 315 MovieClip in Symbol 435 MovieClip [lose_interface] Frame 60
onClipEvent (load) {
_parent.challenged = true;
var score = _root[_parent.score_variable];
var id = _parent.game_id;
var friend = escape(_root.eyeland_hs_friendemail);
var yourname = escape(_root.eyeland_hs_yourname);
var url = ((((((((((_parent.highscore_url + "?action=challenge&id=") + id) + "&friend=") + friend) + "&yourname=") + yourname) + "&score=") + score) + "&rand=") + Math.round(Math.random() * 999999999));
loadVariables (url, _parent.challenge_handler);
}
Symbol 436 MovieClip [Game] Frame 1
#initclip 16
Object.registerClass("Game", Game);
#endinitclip