Frame 2
if (_totalframes == _framesloaded) {
nextFrame();
} else {
prevFrame();
}
Frame 3
System.useCodePage = 1;
if (lang == "") {
lang = "fr";
}
this.loadVariables(("kidbike_" add lang) add ".txt");
play();
Frame 4
if (end != "") {
gotoAndStop (17);
} else {
prevFrame();
}
Frame 17
Mobiclip.globz.moto.GMgr.init(this);
stop();
Frame 31
stop();
gotoAndStop (41);
Frame 32
function loginDone(pError, pName, pDataUser, pDataGame, pScore, pId) {
debug("login done");
if (pError == 0) {
MovieClip.prototype._player = new Object();
_player.name = pName;
_player.id = pId;
_player.score = pScore;
Mobiclip.globz.moto.GMgr.startGame();
} else {
gotoAndStop (17);
}
}
mcLogin.login(this, "loginDone", _bdd, _parent.lang);
stop();
Instance of Symbol 153 MovieClip in Frame 40
//component parameters
onClipEvent (initialize) {
precision = 0.100000001490116;
text = " fps";
}
Frame 41
function submitDone(pError, pResult, pScore) {
if (pError == -1) {
debug("submit score error: player is not logged");
return(null);
}
if (pResult == 0) {
debug("le score n'est pas battu:" + pScore);
} else if (pResult == 1) {
debug("Bravo ! Nouveau score:" + pScore);
}
_player.score = pScore;
gotoAndStop (17);
}
Frame 47
Frame 66
end = true;
Symbol 3 MovieClip Frame 1
_visible = false;
setProperty("", _visible, false);
_visible = false;
setProperty("", _visible, false);
Symbol 2 MovieClip Frame 1
function init(pMc, pMgr, pControl, pScroll, pSprites) {
this.isBlink = false;
this.mc = pMc;
this.mgr = pMgr;
this.control = pControl;
this.scroller = pScroll;
this.sprites = pSprites;
this.myMath = Mobiclip.globz.utils.MyMath;
this.repere = this.mc.mcRepere;
this.view = this.mc.mcView;
this.moto = this.mc.mcMoto;
this.gravMc = this.moto.mcG;
this.roueMc = this.moto.mcR;
this.fatal = this.moto.mcF;
this.roueAnim = this.moto.mcBody.mcRoue;
this.roueB = this.moto.mcBody.mcRoueB;
this.headAnim = this.moto.mcHead;
this.dirX = 1;
this.dirY = 0;
this.dirMX = 0;
this.dirMY = 0;
this.fX = 0;
this.fY = 0;
this.vX = 0;
this.vY = 0;
this.forceA = 0;
this.vA = 0;
this.deltA = 0;
this.poid = 0;
this.poidTige = 0;
this.mInv = 0;
this.mtrxT = null;
this.deltMtrxT = 2;
this.ray = 0;
this.nbPt = 0;
this.colTab = null;
this.indA = -1;
this.indB = 0;
this.grndMax = 3;
this.grndCtr = this.grndMax;
this.wasRoue = false;
this.wasFatal = false;
this.mInv = 1 / this.masse;
this.poid = this.grav * this.masse;
this.poidTige = this.gravTige * this.masse;
this.deltA = Math.atan2(this.gravMc._y, this.gravMc._x) * this.myMath.deg;
this.ray = this.repere.mcRoue._width / 2;
this.dirMX = this.myMath.myCos(Math.round(this.moto._rotation));
this.dirMY = this.myMath.mySin(Math.round(this.moto._rotation));
while (this.getHit(this.nbPt) != undefined) {
this.nbPt++;
}
this.colTab = new Array();
this.build();
this.doMotoRot();
this.control.init(this);
}
function onPlay() {
this.doAction = this.doActionTige;
this.control.onPlay();
}
function onGameover() {
this.doAction = this.doActionPassive;
}
function onFatal() {
this.doAction = function () {
var lP = Mobiclip.globz.moto.Perso;
lP.vX = 0;
lP.vY = 0;
lP.scroller.scrollTo(0, 0);
};
}
function getView() {
return((this.mc._x + this.view._x) + (8 * this.vX));
}
function setDeltPos(pDX, pDY) {
this.mc._x = this.mc._x + pDX;
this.mc._y = this.mc._y + pDY;
}
function setGaz() {
this.fX = this.fX + (this.gaz * this.dirX);
this.fY = this.fY + (this.gaz * this.dirY);
}
function doActionPassive() {
if (this.search3Hit()) {
this.grndCtr = this.grndMax;
this.doBounce();
if ((this.indA != this.indB) || (this.indA != ((this.nbPt - 1) / 2))) {
if (this.searchHit()) {
this.doBounce();
this.vY = this.vY * this.coefBY;
}
}
} else {
this.grndCtr--;
if (this.grndCtr < 0) {
this.fX = 0;
this.fY = 0;
this.repere._rotation = 0;
}
this.fY = this.fY + this.poid;
}
this.testRoue();
this.doForce();
this.doRot();
}
function doActionTige() {
this.control.doControl();
if (this.search3Hit()) {
this.grndCtr = this.grndMax;
this.doBounce();
if ((this.indA != this.indB) || (this.indA != ((this.nbPt - 1) / 2))) {
if (this.searchHit()) {
this.doBounce();
this.vY = this.vY * this.coefBY;
}
}
} else {
this.grndCtr--;
if (this.grndCtr < 0) {
this.fX = 0;
this.fY = 0;
this.repere._rotation = 0;
}
this.fY = this.fY + this.poid;
}
this.testRoue();
this.doForce();
this.doRot();
this.mgr.onDX(this.mc._x);
}
function testRoue() {
var lRoue = this.roueMc;
if (!this.testFatal()) {
if (this.sprites.isBounce(((lRoue._x * this.dirMX) - (lRoue._y * this.dirMY)) + this.mc._x, ((lRoue._x * this.dirMY) + (lRoue._y * this.dirMX)) + this.mc._y)) {
if (this.wasRoue) {
this.forceA = this.forceA + this.bounceRoue;
this.vA = -Math.abs(this.vA);
if (!this.isBlink) {
this.isBlink = true;
this.roueAnim.gotoAndPlay("blink");
this.mgr.onRoue();
}
}
this.wasRoue = true;
} else {
this.wasRoue = false;
}
}
}
function testFatal() {
var lFatal = this.fatal;
if (Math.abs(this.moto._rotation + this.deltA) >= this.fatalA) {
if (this.sprites.isBounce(((lFatal._x * this.dirMX) - (lFatal._y * this.dirMY)) + this.mc._x, ((lFatal._x * this.dirMY) + (lFatal._y * this.dirMX)) + this.mc._y)) {
if (this.wasFatal) {
this.headAnim.gotoAndStop("fatal");
this.mgr.onFatal();
return(true);
}
this.wasFatal = true;
return(false);
}
}
this.wasFatal = false;
return(false);
}
function searchHit() {
var lNbPt = this.nbPt;
var lPt = null;
var lInd = 0;
this.indA = -1;
while (lInd < lNbPt) {
if (this.testHit(this.getHit(lInd))) {
this.indA = lInd;
this.indB = lInd;
break;
}
lInd++;
}
while (lInd < lNbPt) {
if (this.testHit(this.getHit(lInd))) {
this.indB = lInd;
}
lInd++;
}
return(this.indA != -1);
}
function search3Hit() {
var lNbPt = this.nbPt;
var lStep = ((lNbPt - 1) / 2);
var lPt = null;
var lInd = 0;
this.indA = -1;
while (lInd < lNbPt) {
if (this.testHit(this.getHit(lInd))) {
this.indA = lInd;
this.indB = lInd;
break;
}
lInd = lInd + lStep;
}
while (lInd < lNbPt) {
if (this.testHit(this.getHit(lInd))) {
this.indB = lInd;
}
lInd = lInd + lStep;
}
return(this.indA != -1);
}
function testHit(pHit) {
return(this.sprites.isBounce(((pHit._x * this.dirX) - (pHit._y * this.dirY)) + this.mc._x, ((pHit._x * this.dirY) + (pHit._y * this.dirX)) + this.mc._y));
}
function doBounce() {
var lBounce = this.colTab[this.indA][this.indB];
var lA = Math.round(this.repere._rotation + lBounce.a);
if (Math.abs(lA) < this.minPente) {
lA = 0;
}
this.repere._rotation = lA;
this.dirX = this.myMath.myCos(lA);
this.dirY = this.myMath.mySin(lA);
var lNX = this.dirY;
var lNY = (-this.dirX);
this.mc._x = this.mc._x + (lNX * lBounce.b);
this.mc._y = this.mc._y + (lNY * lBounce.b);
var lX = this.vX;
var lY = this.vY;
if (((lNX * lX) + (lNY * lY)) < 0) {
this.vX = (-lNY) * ((lNX * lY) - (lNY * lX));
this.vY = (-lNX) * ((lNY * lX) - (lNX * lY));
}
if (lA != 0) {
var lF = (this.myMath.mySin(lA) * this.poid);
this.fX = this.fX + (this.dirX * lF);
this.fY = this.fY + (this.dirY * lF);
}
}
function build() {
var lRay = this.ray;
var lNbPt = this.nbPt;
var lTab = this.colTab;
var lMath = this.myMath;
var lDeg = lMath.deg;
var lTabA = null;
var lPtA = null;
var lPtB = null;
var lA = 0;
var lA1 = 0;
var lA2 = 0;
var lMX = 0;
var lMY = 0;
var lIndA = 0;
while (lIndA < lNbPt) {
lTab[lIndA] = new Array();
lTabA = lTab[lIndA];
lPtA = this.getHit(lIndA);
lA = Math.round(Math.atan2(-lPtA._y, -lPtA._x) * lDeg);
lTabA[lIndA] = {a:(lA + 90) * this.amortPente, b:0};
var lIndB = (lIndA + 1);
while (lIndB < lNbPt) {
lPtA = this.getHit(lIndA);
lPtB = this.getHit(lIndB);
lA1 = Math.atan2(-lPtA._y, -lPtA._x) * lDeg;
lA2 = Math.atan2(-lPtB._y, -lPtB._x) * lDeg;
lMX = (lPtA._x + lPtB._x) * 0.5;
lMY = (lPtA._y + lPtB._y) * 0.5;
if (lA2 < lA1) {
lA2 = lA2 + 360;
}
lA = Math.round((lA1 + lA2) / 2);
lTabA[lIndB] = {a:(lA + 90) * this.amortPente, b:lRay - Math.sqrt((lMX * lMX) + (lMY * lMY))};
lIndB++;
}
lIndA++;
}
}
function getHit(pInd) {
return(this.repere["mc" + pInd]);
}
function doForce() {
var lAccX = ((this.fX - (this.frot * this.vX)) * this.mInv);
var lAccY = ((this.fY - (this.frot * this.vY)) * this.mInv);
var lA = (this.moto._rotation + this.deltA);
if ((lA < this.critAH) && (lA > this.critAV)) {
if (lAccX > 0) {
this.forceA = this.forceA + (lAccX * this.accX2FACool);
} else {
this.forceA = this.forceA + (lAccX * this.freinX2FACool);
}
} else if (lA >= this.critAH) {
if (lAccX > 0) {
this.forceA = this.forceA + (lAccX * this.accX2FALow);
} else {
this.forceA = this.forceA + (lAccX * this.freinX2FALow);
}
} else if (lAccX > 0) {
this.forceA = this.forceA + (lAccX * this.accX2FAHigh);
} else {
this.forceA = this.forceA + (lAccX * this.freinX2FAHigh);
}
this.vX = this.vX + lAccX;
this.vY = this.vY + lAccY;
if (Math.abs(this.vX) > this.vXMax) {
this.vX = ((this.vX > 0) ? (this.vXMax) : (-this.vXMax));
}
if (Math.abs(this.vX) > 0.100000001490116) {
var lF = ((this.roueB._currentframe + Math.round(this.vX)) % this.roueB._totalframes);
if (lF != 0) {
this.roueB.gotoAndStop(lF);
} else {
this.roueB.gotoAndStop(this.roueB._totalframes);
}
}
this.scroller.scrollTo(this.vX, this.vY);
this.fX = 0;
this.fY = 0;
}
function getTFA() {
var lA = (this.moto._rotation + this.deltA);
if ((lA < this.critAH) && (lA > -90)) {
return(this.myMath.myCos(Math.round(lA)) * this.poidTige);
}
if (lA <= -90) {
return((this.coefMax * this.myMath.myCos(Math.round(lA))) * this.poidTige);
}
return((this.coefMin * this.myMath.myCos(Math.round(lA))) * this.poidTige);
}
function doRot() {
this.vA = this.vA + (((this.getTFA() - (this.frotA * this.vA)) + this.forceA) * this.mInv);
this.doMotoRot();
this.forceA = 0;
}
function doMotoRot() {
var lA = (this.moto._rotation + this.vA);
if (lA > 180) {
lA = lA - 360;
} else if (lA < -180) {
lA = lA + 360;
}
this.moto._rotation = lA;
this.dirMX = this.myMath.myCos(Math.round(lA));
this.dirMY = this.myMath.mySin(Math.round(lA));
lA = lA + this.deltA;
if (lA <= -90) {
this.moto.gotoAndStop(this.moto._totalframes);
} else if (lA >= 0) {
this.moto.gotoAndStop(1);
} else {
this.moto.gotoAndStop(1 - Math.round(((this.moto._totalframes - 1) * lA) / 90));
}
}
if (Mobiclip == undefined) {
_level0.Mobiclip = {};
_global.Mobiclip = _level0.Mobiclip;
}
if (Mobiclip.globz == undefined) {
Mobiclip.globz = {};
}
if (Mobiclip.globz.moto == undefined) {
Mobiclip.globz.moto = {};
}
Mobiclip.globz.moto.Perso = this;
frotA = 0.649999976158142;
masse = 10;
grav = 0.75;
gravTige = 0.25;
gaz = 18;
frot = 0.349999994039536;
vXMax = 17;
fatalA = 120;
critAH = -35;
critAV = -75;
coefMin = 0.25;
coefMax = 3;
accX2FACool = -3.70000004768372;
freinX2FACool = -0.800000011920929;
accX2FALow = -4.59999990463257;
freinX2FALow = -0.800000011920929;
accX2FAHigh = -1;
freinX2FAHigh = -3;
minPente = 10;
amortPente = 0.699999988079071;
bounceRoue = -2;
coefBY = 0.550000011920929;
Symbol 5 MovieClip Frame 1
function init(pPerso) {
this.perso = pPerso;
this.isKeyDown = false;
this.lastKey = 0;
}
function onPlay() {
this.onMouseDown = this.onDown;
this.onMouseUp = this.onUp;
}
function doControl() {
this.doKeys();
if (this.isKeyDown) {
this.perso.setGaz();
}
}
function onDown() {
this.isKeyDown = true;
}
function onUp() {
this.isKeyDown = false;
}
function doKeys() {
var lKey = Key.getCode();
if (Key.isDown(lKey)) {
if (this.lastKey == 0) {
this.onDown();
}
this.lastKey = lKey;
} else {
if (this.lastKey != 0) {
this.onUp();
}
this.lastKey = 0;
}
}
if (Mobiclip == undefined) {
_level0.Mobiclip = {};
_global.Mobiclip = _level0.Mobiclip;
}
if (Mobiclip.globz == undefined) {
Mobiclip.globz = {};
}
if (Mobiclip.globz.moto == undefined) {
Mobiclip.globz.moto = {};
}
Mobiclip.globz.moto.Control = this;
Symbol 6 MovieClip Frame 1
function myCos(pA) {
if (pA > 180) {
return(this.myCos(pA - 360));
}
if (pA < -180) {
return(this.myCos(pA + 360));
}
if (pA >= 0) {
if (pA <= 90) {
return(this.cosDegTab[pA]);
}
return(-this.myCos(180 - pA));
}
return(this.myCos(-pA));
}
function mySin(pA) {
return(-this.myCos(pA + 90));
}
function pow10(pDeg) {
var lVal = "1";
var lInd = 0;
while (lInd < pDeg) {
lVal = lVal + "0";
lInd++;
}
trace((("pow10( " + pDeg) + ") = ") + lVal);
return(Number(lVal));
}
if (Mobiclip == undefined) {
_level0.Mobiclip = {};
_global.Mobiclip = _level0.Mobiclip;
}
if (Mobiclip.globz == undefined) {
Mobiclip.globz = {};
}
if (Mobiclip.globz.utils == undefined) {
Mobiclip.globz.utils = {};
}
Mobiclip.globz.utils.MyMath = this;
this.cosDegTab = [1, 1, 0.999000012874603, 0.999000012874603, 0.998000025749207, 0.995999991893768, 0.995000004768372, 0.992999970912933, 0.990000009536743, 0.987999975681305, 0.985000014305115, 0.98199999332428, 0.977999985218048, 0.973999977111816, 0.970000028610229, 0.966000020503998, 0.961000025272369, 0.955999970436096, 0.950999975204468, 0.945999979972839, 0.939999997615814, 0.934000015258789, 0.926999986171722, 0.921000003814697, 0.913999974727631, 0.906000018119812, 0.898999989032745, 0.890999972820282, 0.883000016212463, 0.875, 0.86599999666214, 0.85699999332428, 0.84799998998642, 0.83899998664856, 0.828999996185303, 0.819000005722046, 0.809000015258789, 0.799000024795532, 0.787999987602234, 0.77700001001358, 0.765999972820282, 0.754999995231628, 0.742999970912933, 0.731000006198883, 0.718999981880188, 0.707000017166138, 0.694999992847443, 0.681999981403351, 0.669000029563904, 0.656000018119812, 0.64300000667572, 0.629000008106232, 0.61599999666214, 0.601999998092651, 0.587999999523163, 0.574000000953674, 0.559000015258789, 0.545000016689301, 0.529999971389771, 0.514999985694885, 0.5, 0.485000014305115, 0.46900001168251, 0.453999996185303, 0.437999993562698, 0.423000007867813, 0.407000005245209, 0.391000002622604, 0.375, 0.358000010251999, 0.342000007629395, 0.32600000500679, 0.308999985456467, 0.291999995708466, 0.275999993085861, 0.25900000333786, 0.241999998688698, 0.224999994039536, 0.208000004291534, 0.190999999642372, 0.17399999499321, 0.156000003218651, 0.138999998569489, 0.122000001370907, 0.104999996721745, 0.0869999974966049, 0.0700000002980232, 0.0520000010728836, 0.0350000001490116, 0.017000000923872, 0];
this.deg = 57.2957801818848;
Symbol 7 MovieClip Frame 1
function init(pZone, pSp, pCadre, pInZone, pSprites, pMgr) {
this.zone = pZone;
this.map0 = this.zone.mcTail0;
this.map1 = this.zone.mcTail1;
this.mapW = this.zone.mcSizer._width;
this.camH = pCadre._height;
this.camW = pCadre._width;
this.camX = this.camW / 2;
this.camY = this.camH / 2;
this.inertFreq = 1 / this.inertDelay;
this.inertXMin = pInZone._x;
this.inertXMax = this.inertXMin + pInZone._width;
this.inertCtr = 0;
this.sp = pSp;
this.sprites = pSprites;
this.mgr = pMgr;
if (Mobiclip.version != undefined) {
this.moveClip = this.moveClip2;
this.toL = false;
this.toR = false;
}
this.map0.pace = 1;
this.map0.map = this.map0.mcMap1;
this.map1.pace = 1;
this.map1.map = this.map1.mcMap1;
}
function scrollTo(pVX, pVY) {
var lVirtuX = (this.sp.getView() + pVX);
var lCoef = this.getCoef(lVirtuX);
var lDCamX = Math.round(lCoef * (lVirtuX - this.camX));
this.moveClip(lDCamX);
this.sp.setDeltPos(pVX - lDCamX, pVY);
}
function getStep(pX) {
return(this.ctrStep + (((pX - this.zone._x) - ((3 * this.mapW) / 2)) / this.mapW));
}
function onScrollL() {
this.ctrStep--;
this.onScroll();
}
function onScrollR() {
this.ctrStep++;
this.onScroll();
}
function onScroll() {
this.renderPace(this.map0);
this.renderPace(this.map1);
this.sprites.updateMaps(this.map0.map, this.map1.map);
Mobiclip.gc();
}
function renderPace(pMap) {
var lPace = pMap.pace;
var lMc = pMap.mcMap1;
var lInd = 1;
while (lMc != undefined) {
if (lInd == lPace) {
lMc._visible = true;
} else {
lMc._visible = false;
}
lInd++;
lMc = pMap["mcMap" + lInd];
}
}
function renderRates(pMap) {
var lRates = pMap.rates;
var lLen = lRates.length;
var lMc = null;
var lInd = 0;
while (lInd < lLen) {
lMc = pMap.map["mc" + lInd];
lMc.gotoAndStop(1 + Math.round(lRates[lInd] * (lMc._totalframes - 1)));
lInd++;
}
this.sprites.lock(true);
}
function copyMap(pScr, pDest) {
pDest.rates = pScr.rates;
pDest.pace = pScr.pace;
pDest.map = pDest["mcMap" + pDest.pace];
this.renderRates(pDest);
}
function drawMap(pMap) {
if (this.mgr.isCheck()) {
pMap.pace = 2;
pMap.map = pMap.mcMap2;
} else {
pMap.pace = 3 + this.mgr.getPace();
pMap.map = pMap["mcMap" + pMap.pace];
}
var lLen = (pMap.pace - 3);
var lRate = this.mgr.getRate();
pMap.rates = new Array();
var lInd = 0;
while (lInd < lLen) {
pMap.rates[lInd] = lRate * Math.random();
lInd++;
}
this.renderRates(pMap);
}
function moveClip(pDCamX) {
var lZoneX = (this.zone._x - pDCamX);
if (lZoneX > (-this.limClip)) {
lZoneX = lZoneX - this.mapW;
this.copyMap(this.map0, this.map1);
this.drawMap(this.map0);
this.onScrollL();
} else if (lZoneX < ((this.limClip - (2 * this.mapW)) + this.camW)) {
lZoneX = lZoneX + this.mapW;
this.copyMap(this.map1, this.map0);
this.drawMap(this.map1);
this.onScrollR();
}
this.zone._x = lZoneX;
}
function moveClip2(pDCamX) {
var lZoneX = (this.zone._x - pDCamX);
if (this.toL) {
this.toL = false;
lZoneX = lZoneX - this.mapW;
this.onScrollL();
} else if (lZoneX > (-this.limClip)) {
this.toL = true;
this.copyMap(this.map0, this.map1);
this.drawMap(this.map0);
}
if (this.toR) {
this.toR = false;
lZoneX = lZoneX + this.mapW;
this.onScrollR();
} else if (lZoneX < ((this.limClip - (2 * this.mapW)) + this.camW)) {
this.toR = true;
this.copyMap(this.map1, this.map0);
this.drawMap(this.map1);
}
this.zone._x = lZoneX;
}
function getCoef(pVirtuX) {
if (this.isInInertZone(pVirtuX)) {
if (this.inertCtr <= 0) {
return(this.inertMax);
}
this.inertCtr--;
return((((this.inertMin - this.inertMax) * this.inertCtr) * this.inertFreq) + this.inertMax);
}
if (this.inertCtr >= this.inertDelay) {
return(this.inertMin);
}
this.inertCtr++;
return((((this.inertMin - this.inertMax) * this.inertCtr) * this.inertFreq) + this.inertMax);
}
function isInInertZone(pVirtuX) {
return((pVirtuX > this.inertXMin) && (pVirtuX < this.inertXMax));
}
if (Mobiclip == undefined) {
_level0.Mobiclip = {};
_global.Mobiclip = _level0.Mobiclip;
}
if (Mobiclip.globz == undefined) {
Mobiclip.globz = {};
}
if (Mobiclip.globz.moto == undefined) {
Mobiclip.globz.moto = {};
}
Mobiclip.globz.moto.MyScroll = this;
this.ctrStep = 0;
inertMin = 0.142857104539871;
inertMax = 0.035714291036129;
inertDelay = 60;
limClip = 40;
Symbol 8 MovieClip Frame 1
function init(pZone, pMgr) {
this.mgr = pMgr;
this.zone = pZone;
this.mapW = this.zone.mcSizer._width;
this.sol = this.zone.mcSol._y;
this.cellS = 100;
this.tabL = new Object();
this.tabR = new Object();
this.isLock = false;
}
function isBounce(pX, pY) {
pX = pX - this.zone._x;
pY = pY - this.zone._y;
if (pY >= this.sol) {
return(true);
}
if (this.isLock) {
return(false);
}
if (pX < this.mapW) {
return(this.isBounceOn(pX, pY, this.tabL));
}
return(this.isBounceOn(pX - this.mapW, pY, this.tabR));
}
function updateMaps(pL, pR) {
this.tabR = new Object();
this.tabL = new Object();
this.update(pL);
this.update(pR);
}
function lock(pLock) {
this.isLock = pLock;
}
function update(pMap) {
var lInd = 0;
var lMc = pMap.mc0;
var lSp = null;
var lIndSp = 0;
while (lMc != undefined) {
lSp = lMc.mc0;
lIndSp = 0;
while (lSp != undefined) {
this.register(lSp);
lIndSp++;
lSp = lMc["mc" + lIndSp];
}
lInd++;
lMc = pMap["mc" + lInd];
}
this.isLock = false;
}
function register(pSp) {
var lX = (pSp._x + pSp._parent._x);
var lSize = this.cellS;
var lCol = Math.floor(lX / lSize);
var lLin = Math.floor(pSp._y / lSize);
var lMaxC = ((lX + pSp.mcHit._width) / lSize);
var lMaxL = ((pSp._y + pSp.mcHit._height) / lSize);
var lTab = null;
if ((lX + pSp._parent._parent._parent._x) < this.mapW) {
lTab = this.tabL;
} else {
lTab = this.tabR;
}
var lIndC = lCol;
while (lIndC <= lMaxC) {
var lIndL = lLin;
while (lIndL <= lMaxL) {
this.registerAt(lIndC, lIndL, lTab, pSp);
lIndL++;
}
lIndC++;
}
}
function registerAt(pCol, pLin, pTab, pSp) {
if (pTab[pCol] == undefined) {
pTab[pCol] = new Object();
}
if (pTab[pCol][pLin] == undefined) {
pTab[pCol][pLin] = new Array();
}
pTab[pCol][pLin][pTab[pCol][pLin].length] = pSp;
}
function isBounceOn(pX, pY, pTab) {
var lCell = pTab[Math.floor(pX / this.cellS)][Math.floor(pY / this.cellS)];
var lSp = null;
if (lCell) {
var lInd = 0;
while (lInd < lCell.length) {
lSp = lCell[lInd];
if (lSp.mcHit.testHit((pX - lSp._x) - lSp._parent._x, (pY - lSp._y) - lSp._parent._y)) {
return(true);
}
lInd++;
}
}
return(false);
}
if (Mobiclip == undefined) {
_level0.Mobiclip = {};
_global.Mobiclip = _level0.Mobiclip;
}
if (Mobiclip.globz == undefined) {
Mobiclip.globz = {};
}
if (Mobiclip.globz.moto == undefined) {
Mobiclip.globz.moto = {};
}
Mobiclip.globz.moto.Sprites = this;
Symbol 1 MovieClip Frame 1
function init(pScene) {
this.scene = pScene;
this.perso = Mobiclip.globz.moto.Perso;
this.control = Mobiclip.globz.moto.Control;
this.scroller = Mobiclip.globz.moto.MyScroll;
this.sprites = Mobiclip.globz.moto.Sprites;
this.meterMc = this.scene.mcMeter;
this.isLost = false;
this.meterCtr = 0;
this.perso.init(this.scene.mcPerso, this, this.control, this.scroller, this.sprites);
this.scroller.init(this.scene.mcZone, this.perso, this.scene.mcCadre, this.scene.mcInerte, this.sprites, this);
this.sprites.init(this.scene.mcZone, this);
this.meterMc.init();
this.scene.life = this.maxTry;
this.scene.score = 0;
}
function startGame() {
this.scene.mcSequence.gotoAndPlay(2);
this.scene.gotoAndStop("game");
}
function onGo() {
this.gotoAndStop("loop");
this.perso.onPlay();
}
function doLoop() {
this.perso.doAction();
}
function onRoue() {
if (!this.isLost) {
var lTry = Number(this.scene.life);
if (lTry > 0) {
lTry--;
this.scene.life = lTry;
} else {
this.perso.onGameover();
this.isLost = true;
this.scene.score = Math.floor(this.meterCtr * 100);
this.scene.mcGameover.gotoAndPlay(2);
}
}
}
function onFatal() {
if (!this.isLost) {
this.scene.life = 0;
this.perso.onFatal();
this.isLost = true;
this.scene.score = Math.floor(this.meterCtr * 100);
this.scene.mcGameover.gotoAndPlay(2);
}
}
function onDX(pX) {
if (!this.isLost) {
var lMeter = this.scroller.getStep(pX);
if (lMeter > this.meterCtr) {
this.meterCtr = lMeter;
this.meterMc.setVal(Math.floor(lMeter * 100));
}
}
}
function isCheck() {
return(((this.scroller.ctrStep + 1) % this.checkPeriode) == 0);
}
function getPace() {
if (((this.scroller.ctrStep + 1) / this.checkPeriode) >= this.soft2Hard) {
return(this.hardPace[this.scroller.ctrStep % this.checkPeriode]);
}
return(this.softPace[this.scroller.ctrStep % this.checkPeriode]);
}
function getRate() {
var lStep = ((this.scroller.ctrStep + 1) / this.checkPeriode);
if (lStep >= this.hardRate) {
return(1);
}
var lPool = (1 - this.minRate);
var lRand = (Math.random() - 1);
return(this.minRate + ((((1 - (lRand * lRand)) * (1 - this.minRate)) * lStep) / this.hardRate));
}
function gameover() {
this.scene.gotoAndStop("gameover");
}
if (Mobiclip == undefined) {
_level0.Mobiclip = {};
_global.Mobiclip = _level0.Mobiclip;
}
if (Mobiclip.globz == undefined) {
Mobiclip.globz = {};
}
if (Mobiclip.globz.moto == undefined) {
Mobiclip.globz.moto = {};
}
Mobiclip.globz.moto.GMgr = this;
maxTry = 3;
checkPeriode = 5;
softPace = [0, 1, 2, 1];
hardPace = [1, 1, 2, 2];
soft2Hard = 1;
minRate = 0.300000011920929;
hardRate = 8;
stop();
Symbol 1 MovieClip Frame 6
play();
Symbol 1 MovieClip Frame 7
doLoop();
prevFrame();
Symbol 12 MovieClip Frame 1
stop();
Symbol 9 MovieClip Frame 1
function init() {
this.deg = 0;
this.decDeg = 0;
var lDigits = mcCtr;
var lInd = 0;
while (lDigits["mc" + lInd]) {
lDigits["mc" + (lInd++)].gotoAndStop(1);
}
this.deg = lInd;
lInd = 1;
while (lDigits["mc_" + lInd]) {
lDigits["mc_" + (lInd++)].gotoAndStop(1);
}
this.decDeg = lInd - 1;
}
function setVal(pVal) {
var lDigits = mcCtr;
var lDec = this.decDeg;
var lDeg = this.deg;
var lVal = String(pVal);
var lLen = lVal.length;
var lInd = (-lDec);
var lName = "";
while (lInd < lDeg) {
if (lInd < 0) {
lName = "mc_";
} else {
lName = "mc";
}
if ((lInd + lDec) < lLen) {
lDigits[lName + Math.abs(lInd)].gotoAndStop(Number(lVal.charAt(((lLen - lInd) - lDec) - 1)) + 1);
} else {
lDigits[lName + Math.abs(lInd)].gotoAndStop(1);
}
lInd++;
}
}
Symbol 24 MovieClip Frame 1
play();
Symbol 24 MovieClip Frame 8
gotoAndPlay (1);
Symbol 32 MovieClip Frame 1
nextFrame();
Symbol 32 MovieClip Frame 2
play();
Symbol 32 MovieClip Frame 27
_parent.gotoAndStop("Home");
Symbol 45 MovieClip Frame 1
function testHit(pX, pY) {
var lRay = (this._width / 2);
pX = pX - this._x;
pY = pY - this._y;
return(((pX * pX) + (pY * pY)) <= (lRay * lRay));
}
_visible = false;
setProperty("", _visible, false);
_visible = false;
setProperty("", _visible, false);
Symbol 49 MovieClip Frame 1
function testHit(pX, pY) {
pX = pX - this._x;
pY = pY - this._y;
return((((pX >= 0) && (pX <= this._width)) && (pY >= 0)) && (pY <= this._height));
}
_visible = false;
setProperty("", _visible, false);
_visible = false;
setProperty("", _visible, false);
Symbol 55 MovieClip Frame 1
function testHit(pX, pY) {
pX = pX - this._x;
pY = pY - this._y;
return(((((pX >= 0) && (pX <= this._width)) && (pY >= 0)) && (pY <= this._height)) && (((pY + ((pX * this._height) / this._width)) - this._height) >= 0));
}
_visible = false;
setProperty("", _visible, false);
_visible = false;
setProperty("", _visible, false);
Symbol 59 MovieClip Frame 1
function testHit(pX, pY) {
pX = pX - this._x;
pY = pY - this._y;
return(((((pX >= 0) && (pX <= this._width)) && (pY >= 0)) && (pY <= this._height)) && ((((pX * this._height) / this._width) - pY) <= 0));
}
_visible = false;
setProperty("", _visible, false);
_visible = false;
setProperty("", _visible, false);
Symbol 43 MovieClip Frame 1
stop();
Symbol 42 MovieClip Frame 1
_visible = false;
setProperty("", _visible, false);
_visible = false;
setProperty("", _visible, false);
Symbol 74 MovieClip Frame 1
Mobiclip.globz.moto.Sprites.register(this);
Symbol 73 MovieClip Frame 1
stop();
Symbol 72 MovieClip Frame 1
_visible = false;
setProperty("", _visible, false);
_visible = false;
setProperty("", _visible, false);
Symbol 79 MovieClip Frame 1
_visible = false;
setProperty("", _visible, false);
_visible = false;
setProperty("", _visible, false);
Symbol 86 MovieClip Frame 1
stop();
Symbol 99 MovieClip Frame 1
_visible = false;
setProperty("", _visible, false);
_visible = false;
setProperty("", _visible, false);
Symbol 100 MovieClip Frame 1
function doCtr() {
if (!vMap._visible) {
if (!this.vIsLab) {
var lIsLast = ((vTail._name.substr(6) == "1") ? -1 : -2);
var lStep = Mobiclip.globz.moto.MyScroll.ctrStep;
var lP = Mobiclip.globz.moto.GMgr.checkPeriode;
var lStep = String(Math.round(((lStep == 0) ? (lP) : ((lStep + lIsLast) + lP))));
var lLab = lStep.length;
var lInd = 1;
while (_parent["mcCtr" + lInd] != undefined) {
if (lInd == lLab) {
_parent.mcCtr = _parent["mcCtr" + lLab];
_parent.mcCtr._visible = true;
} else {
_parent["mcCtr" + lInd]._visible = false;
}
lInd++;
}
_parent.init();
_parent.setVal(lStep + "0");
this.vIsLab = true;
}
} else if (this.vIsLab) {
this.vIsLab = false;
}
}
vMap = _parent._parent;
vTail = vMap._parent;
vIsLab = false;
gotoAndStop (6);
Symbol 100 MovieClip Frame 6
doCtr();
play();
Symbol 100 MovieClip Frame 7
prevFrame();
Symbol 82 MovieClip Frame 1
function init() {
this.deg = 0;
this.decDeg = 0;
var lDigits = mcCtr;
var lInd = 0;
while (lDigits["mc" + lInd]) {
lDigits["mc" + (lInd++)].gotoAndStop(1);
}
this.deg = lInd;
lInd = 1;
while (lDigits["mc_" + lInd]) {
lDigits["mc_" + (lInd++)].gotoAndStop(1);
}
this.decDeg = lInd - 1;
}
function setVal(pVal) {
var lDigits = mcCtr;
var lDec = this.decDeg;
var lDeg = this.deg;
var lVal = String(pVal);
var lLen = lVal.length;
var lInd = (-lDec);
var lName = "";
while (lInd < lDeg) {
if (lInd < 0) {
lName = "mc_";
} else {
lName = "mc";
}
if ((lInd + lDec) < lLen) {
lDigits[lName + Math.abs(lInd)].gotoAndStop(Number(lVal.charAt(((lLen - lInd) - lDec) - 1)) + 1);
} else {
lDigits[lName + Math.abs(lInd)].gotoAndStop(1);
}
lInd++;
}
}
Symbol 80 MovieClip Frame 1
_visible = false;
setProperty("", _visible, false);
_visible = false;
setProperty("", _visible, false);
Symbol 105 MovieClip Frame 1
_visible = false;
setProperty("", _visible, false);
_visible = false;
setProperty("", _visible, false);
Symbol 109 MovieClip Frame 1
stop();
Symbol 112 MovieClip Frame 1
play();
Symbol 111 MovieClip Frame 1
stop();
Symbol 111 MovieClip Frame 56
Mobiclip.globz.moto.Perso.isBlink = false;
stop();
Symbol 115 MovieClip Frame 1
gotoAndStop (17);
Symbol 115 MovieClip Frame 11
play();
Symbol 115 MovieClip Frame 16
play();
Symbol 115 MovieClip Frame 17
if (random(300) == 0) {
gotoAndStop (11);
} else {
prevFrame();
}
Symbol 120 MovieClip Frame 1
play();
Symbol 118 MovieClip Frame 1
stop();
Symbol 125 MovieClip Frame 1
_visible = false;
setProperty("", _visible, false);
_visible = false;
setProperty("", _visible, false);
Symbol 107 MovieClip Frame 1
stop();
Symbol 128 MovieClip Frame 1
_visible = false;
setProperty("", _visible, false);
_visible = false;
setProperty("", _visible, false);
Symbol 132 MovieClip Frame 1
stop();
Symbol 132 MovieClip Frame 92
stop();
Mobiclip.globz.moto.GMgr.onGo();
Symbol 137 MovieClip Frame 1
stop();
Symbol 137 MovieClip Frame 80
stop();
Mobiclip.globz.moto.GMgr.gameover();
Symbol 142 Button
on (release) {
_parent.gotoAndStop("Rules");
}
Symbol 146 Button
on (release) {
MovieClip.prototype._player = new Object();
_player.name = pName;
_player.id = pId;
_player.score = pScore;
Mobiclip.globz.moto.GMgr.startGame();
gotoAndStop (41);
}
Symbol 150 MovieClip Frame 1
function GetPath(pURL) {
while (pURL != "") {
var lLastChar = (substring(pURL, length(pURL), 1));
if ((lLastChar == "/") || (lLastChar == "\\")) {
break;
}
pURL = substring(pURL, 1, length(pURL) - 1);
}
return(pURL);
}
_visible = false;
setProperty("", _visible, false);
_visible = false;
setProperty("", _visible, false);
if (_parent._v == undefined) {
vURL = GetPath(_url) + "../loginglobz.swf";
} else {
vURL = (GetPath(_url) + "../loginglobz.swf?_v=") + _parent._v;
}
this.loadMovie(vURL);
delete vURL;
Symbol 153 MovieClip Frame 1
vT1 = getTimer();
Symbol 153 MovieClip Frame 3
vT2 = getTimer();
vText = (int(2000 / ((vT2 - vT1) / 10)) / 10) add " fps";
Symbol 162 Button
on (release) {
_bdd.submitScore(_parent, "submitDone", _score);
_parent.gotoAndStop("Wait");
}
Symbol 164 Button
on (release) {
_parent.gotoAndStop("Home");
}
Symbol 156 MovieClip Frame 1
gotoAndStop (11);
stop();
_score = Math.round(_parent.score / 10);
Symbol 166 Button
on (release) {
gotoAndStop (17);
}
Symbol 169 MovieClip Frame 1
function update(pPos, pName, pScore) {
if (pName == "") {
_visible = false;
setProperty("", _visible, false);
_visible = false;
setProperty("", _visible, false);
return(null);
}
_visible = true;
setProperty("", _visible, true);
_visible = true;
setProperty("", _visible, true);
pos = pPos;
pseudo = pName;
score = pScore;
}
function hide() {
_visible = false;
setProperty("", _visible, false);
_visible = false;
setProperty("", _visible, false);
}
hide();
stop();
Symbol 173 Button
on (release) {
prevPage();
}
Symbol 177 Button
on (release) {
nextPage();
}
Symbol 179 Button
on (release) {
endPage();
}
Symbol 183 Button
on (release) {
beginPage();
}
Symbol 168 MovieClip Frame 1
function getScores() {
gotoAndStop (9);
_bdd.getScores(this, "onScores", _page);
}
function onScores(pPos, pScores, pPage, pNbPage) {
gotoAndStop (17);
pPos = parseInt(pPos);
for (var i in pScores) {
this["mcLine" + i].update((pPos + parseInt(i)) - 1, pScores[i].name, pScores[i].score);
}
_page = pPage;
_pageMax = pNbPage;
if (_pageMax == 0) {
pager = "0-0";
} else {
pager = (_page + "-") + _pageMax;
}
if (_page == _pageMax) {
bNext._visible = false;
bEnd._visible = false;
}
if (_page == 1) {
bPrev._visible = false;
bBegin._visible = false;
}
}
function nextPage() {
_page++;
getScores();
}
function prevPage() {
_page--;
getScores();
}
function beginPage() {
_page = 1;
getScores();
}
function endPage() {
_page = _pageMax;
getScores();
}
function search() {
_page = -1;
_searchname = escape(_search);
_search = "";
getScores();
}
play();
Symbol 168 MovieClip Frame 2
_page = 1;
getScores();
gotoAndStop (9);
Symbol 168 MovieClip Frame 9
var i = 1;
while (i <= 10) {
this["mcLine" + i].hide();
i++;
}
stop();
Symbol 168 MovieClip Frame 17
if (_player.id > 0) {
_search = _player.name;
}
Selection.setFocus("_search");