Frame 1
function loadModelAndPlay(nom, score) {
demandeParcours = new LoadVars();
demandeParcours.action = "oneparcours";
demandeParcours.sonnom = nom;
demandeParcours.sonscore = score;
demandeParcours.sendAndLoad("plovboat.php", demandeParcours, "POST");
demandeParcours.onLoad = function () {
occurence = this.sonparcours.indexOf("_", 0);
version = this.sonparcours.substring(0, occurence);
_root.voitureverte.initReplayRec();
if ((version == "1.00") && (occurence != -1)) {
occurence = occurence + 1;
while (occurence != -2) {
occurence1 = this.sonparcours.indexOf("_", occurence);
occurence2 = this.sonparcours.indexOf("_", occurence1 + 1);
occurence3 = this.sonparcours.indexOf("_", occurence2 + 1);
frame = this.sonparcours.substring(occurence, occurence1);
updown = this.sonparcours.substring(occurence1 + 1, occurence2);
if (occurence3 == -1) {
key = this.sonparcours.substring(occurence2 + 1);
occurence = -2;
} else {
key = this.sonparcours.substring(occurence2 + 1, occurence3);
occurence = occurence3 + 1;
}
_root.voitureverte.replayEvents[_root.voitureverte.replayRecEventsIndex] = {framenb:frame, updown:updown, keycode:key};
_root.voitureverte.replayRecEventsIndex = _root.voitureverte.replayRecEventsIndex + 1;
}
_root.voitureverte.startReplayPlay();
} else if ((version == "1.01") && (occurence != -1)) {
occurence = occurence + 1;
while (occurence != 0) {
occurence1 = this.sonparcours.indexOf("!", occurence);
if (occurence1 == -1) {
keysequence = this.sonparcours.substring(occurence);
} else {
keysequence = this.sonparcours.substring(occurence, occurence1);
}
occurence2 = keysequence.indexOf("_", 0);
var updown = keysequence.substring(0, occurence2);
occurence2++;
occurence3 = keysequence.indexOf("_", occurence2);
var key = _root.getNumber(keysequence.substring(occurence2, occurence3));
occurence3++;
var frame = -1;
while (occurence3 != 0) {
occurence4 = keysequence.indexOf("_", occurence3);
if (occurence4 == -1) {
tmpframe = _root.getNumber(keysequence.substring(occurence3));
} else {
tmpframe = _root.getNumber(keysequence.substring(occurence3, occurence4));
}
if (frame == -1) {
frame = tmpframe;
} else {
frame = frame + tmpframe;
}
_root.voitureverte.replayEvents[_root.voitureverte.replayRecEventsIndex] = {framenb:frame, updown:updown, keycode:key};
_root.voitureverte.replayRecEventsIndex = _root.voitureverte.replayRecEventsIndex + 1;
occurence3 = occurence4 + 1;
}
occurence = occurence1 + 1;
}
_root.voitureverte.replayEvents.sortOn("framenb", Array.NUMERIC);
_root.voitureverte.startReplayPlay();
} else {
_root.message.messagetext = "\nECHEC :(";
_root.message.gotoAndPlay(2);
}
_root.menuder.gotoAndPlay(45);
};
}
function getAlphaNum(number) {
toReturn = "";
while (number > 0) {
unite = number % baseAlphaNum;
if (unite < 10) {
toReturn = String.fromCharCode(unite + 48) + toReturn;
} else if (unite < 36) {
toReturn = String.fromCharCode(unite + 55) + toReturn;
} else {
toReturn = String.fromCharCode(unite + 61) + toReturn;
}
number = (number - unite) / baseAlphaNum;
}
return(toReturn);
}
function getNumber(alphanum) {
toReturn = 0;
l = alphanum.length;
i = 0;
while (i < l) {
unite = alphanum.charCodeAt(i);
if ((unite >= 48) && (unite < 58)) {
toReturn = ((toReturn * baseAlphaNum) + unite) - 48;
} else if ((unite >= 65) && (unite < 91)) {
toReturn = ((toReturn * baseAlphaNum) + unite) - 55;
} else if ((unite >= 97) && (unite < 123)) {
toReturn = ((toReturn * baseAlphaNum) + unite) - 61;
}
i++;
}
return(toReturn);
}
function playSurround(show) {
if (show) {
playback._visible = play_btn._visible;
playback.gotoAndPlay(1);
} else {
playback._visible = false;
}
}
function showButtons(vis) {
pause_btn._visible = vis;
play_btn._visible = vis;
stop_btn._visible = vis;
playback._visible = vis;
}
function clicStart() {
if (!_root.timing) {
menuder._visible = false;
if (_root.voitureverte.gare && (_root.voitureverte.replayPlay == false)) {
_root.timer_txt = "00:00:00:00";
_root.voitureverte.init();
_root.voitureverte.initReplayRec();
}
if (_root.paused) {
} else {
startFrame = frame;
}
_root.paused = false;
_root.timing = true;
aidetimestart = -1;
}
}
function clicStop() {
_root.timing = false;
_root.paused = false;
_root.timer_txt = "00:00:00:00";
playSurround(true);
menuder._visible = true;
_root.voitureverte.init();
_root.voitureverte.initReplayRec();
aidetimestart = getTimer();
}
var vX = _root.voitureverte._x;
var vY = _root.voitureverte._y;
var vRot = _root.voitureverte._rotation;
var rotCorps = _root.voitureverte.bustebras._rotation;
var xCorps = _root.voitureverte.bustebras._x;
var yCorps = _root.voitureverte.bustebras._y;
var xTete = _root.voitureverte.tete._x;
var yTete = _root.voitureverte.tete._y;
var frame = 0;
var startFrame = 0;
var baseAlphaNum = 62;
var timing = false;
aidetimestart = getTimer();
_root.play_btn.onPress = function () {
clicStart();
};
_root.stop_btn.onPress = function () {
clicStop();
};
_root.pause_btn.onPress = function () {
if (_root.timing) {
_root.timing = false;
_root.paused = true;
playSurround(true);
}
};
_root.pcButton.onPress = function () {
_root.voitureverte.details++;
if (_root.voitureverte.details > 2) {
_root.voitureverte.details = 0;
}
pcButton.gotoAndPlay(_root.voitureverte.details + 1);
_root.voitureverte.thedetails();
_root.voitureverte.tete.details();
_root.bouees.details();
};
_root.onEnterFrame = function () {
if (chocs_txttmp != chocs_txt) {
chocs_txt = chocs_txttmp;
}
if ((aidetimestart != -1) && ((getTimer() - aidetimestart) > 2000)) {
_root.aide._visible = true;
} else {
_root.aide._visible = false;
}
if (timing) {
playSurround(false);
elapsedTime = ((frame - startFrame) * 100) / 3;
elapsedHours = Math.floor(elapsedTime / 3600000);
remaining = elapsedTime - (elapsedHours * 3600000);
elapsedM = Math.floor(remaining / 60000);
remaining = remaining - (elapsedM * 60000);
elapsedS = Math.floor(remaining / 1000);
remaining = remaining - (elapsedS * 1000);
elapsedH = Math.floor(remaining / 10);
if (elapsedHours < 10) {
hours = "0" + elapsedHours.toString();
} else {
hours = elapsedHours.toString();
}
if (elapsedM < 10) {
minutes = "0" + elapsedM.toString();
} else {
minutes = elapsedM.toString();
}
if (elapsedS < 10) {
seconds = "0" + elapsedS.toString();
} else {
seconds = elapsedS.toString();
}
if (elapsedH < 10) {
hundredths = "0" + elapsedH.toString();
} else {
hundredths = elapsedH.toString();
}
_root.timer_txt = (((((hours + ":") + minutes) + ":") + seconds) + ":") + hundredths;
frame++;
}
};
Instance of Symbol 3 MovieClip in Frame 1
on (press) {
getURL ("http://www.pepere.org/aventures/pepere.php");
}
Instance of Symbol 51 MovieClip "voitureverte" in Frame 1
onClipEvent (load) {
function thedetails() {
tracespneu = new Array();
tracespneuStart = 0;
tracespneuEnd = 0;
pneuRecCount = 0;
pneuFrame = 0;
if (details == 0) {
pneuPeriod = 4;
nbTracesPneu = 2;
_root.voitureverte.vaguelettes._visible = true;
} else if (details == 1) {
pneuPeriod = 4;
nbTracesPneu = 1;
_root.voitureverte.vaguelettes._visible = true;
} else if (details == 2) {
pneuPeriod = 100;
nbTracesPneu = -1;
_root.voitureverte.vaguelettes._visible = false;
}
}
function setBrasRotation() {
aarapport = wheelRotation / maxWheelAngle;
angleAbsCorps = _rotation + bustebras._rotation;
aaepaule = {x:0, y:-10};
bustebras.localToGlobal(aaepaule);
aamain = {x:5 + (2 * aarapport), y:-5 + (2 * aarapport)};
localToGlobal(aamain);
aadiff = {x:aamain.x - aaepaule.x, y:aamain.y - aaepaule.y};
aadiffPol = getPolaire(aadiff);
aaD = aadiffPol.d;
aaA = (aadiffPol.a * 180) / Math.PI;
alpha = (Math.asin(aaD / (2 * lBrasScaled)) * 180) / Math.PI;
beta = (-(90 - alpha)) + aaA;
gama = 2 * alpha;
bustebras.brasgaucheplein._rotation = beta - angleAbsCorps;
bustebras.contourbrasgauche._rotation = beta - angleAbsCorps;
bustebras.contourbrasgauche.avantbras._rotation = 180 - gama;
aaepaule = {x:0, y:10};
bustebras.localToGlobal(aaepaule);
aamain = {x:16, y:-3};
moteur.localToGlobal(aamain);
aadiff = {x:aamain.x - aaepaule.x, y:aamain.y - aaepaule.y};
aadiffPol = getPolaire(aadiff);
aaD = aadiffPol.d;
aaA = (aadiffPol.a * 180) / Math.PI;
alpha = (Math.asin(aaD / (2 * lBrasScaled)) * 180) / Math.PI;
beta = (90 - alpha) + aaA;
gama = 2 * alpha;
bustebras.brasdroitplein._rotation = beta - angleAbsCorps;
bustebras.contourbrasdroit._rotation = beta - angleAbsCorps;
bustebras.contourbrasdroit.avantbras._rotation = gama - 180;
}
function init() {
_xscale = 100;
_yscale = _xscale;
remousframe = 0;
remousframeinit = 17;
speedDecay = 0.85;
maxSpeed = 7;
incRotation = 0;
incRotationQuanta = 8;
maxWheelAngle = 45;
incSpeed = 0;
incSpeedQuanta = 0.2;
speed = 0;
wheelRotation = 0;
remousRotation = 0;
carLength = 90;
carLengthScaled = (carLength * _xscale) / 100;
incy = 0;
incx = 0;
_x = _root.vX;
_y = _root.vY;
_rotation = _root.vRot;
pX = _x;
pY = _y;
pRot = _rotation;
moteur._rotation = -wheelRotation;
remous._rotation = -remousRotation;
memoX = pX;
memoY = pY;
memoRot = pRot;
etape = 0;
gagne = false;
gare = false;
_root.gagnos._visible = false;
reposBonhommeVolant = 20;
rayonVolant = 8;
posBrasGaucheVolant = 0;
posBrasDroitVolant = 0;
corpsDeltaX = 0;
corpsDeltaY = 0;
maxCorpsDeltaY = 2;
corpsSpeedX = 0;
maxCorpsDeltaX = 8;
minCorpsDeltaX = -5;
corpsDecay = 0.5;
bustebras._x = _root.xCorps + corpsDeltaX;
bustebras._y = _root.yCorps + corpsDeltaY;
maxCorpsDeltaRot = 20;
teteDeltaX = 0;
teteDeltaY = 0;
teteDecay = 0.5;
maxTeteDeltaX = 10;
minTeteDeltaX = -8;
teteSpeedX = 0;
tete._x = (_root.xTete + corpsDeltaX) + teteDeltaX;
tete._y = (_root.yTete + corpsDeltaY) + teteDeltaY;
bustebras._x = _root.xCorps;
bustebras._y = _root.yCorps;
lBras = 14;
lBrasScaled = (lBras * _xscale) / 100;
lEpaule = 10;
setBrasRotation();
tuturevertefeuxarr.gotoAndStop(1);
chocs = 0;
forceChocs = 0;
score = 0;
thedetails();
_root.bouees.init();
_root.tracespneu.createEmptyMovieClip("tracespneu", 1);
tracespneuClip = _root.tracespneu.tracespneu;
}
function initReplayRec() {
replayRecFrame = 0;
replayPlayFrame = 0;
replayRecEventsIndex = 0;
replayPlayEventsIndex = 0;
replayEvents = new Array();
replayPlay = false;
_root.replayos.gotoAndStop(1);
_root.repclign.stop();
_root.repclign._visible = false;
}
function hit(clip) {
return(((((((((((((clip.hitTest(arriere) || (clip.hitTest(arrieregauche))) || (clip.hitTest(arrieregauche2))) || (clip.hitTest(gauche))) || (clip.hitTest(avantgauche3))) || (clip.hitTest(avantgauche2))) || (clip.hitTest(avantgauche))) || (clip.hitTest(avant))) || (clip.hitTest(avantdroite))) || (clip.hitTest(avantdroite3))) || (clip.hitTest(avantdroite2))) || (clip.hitTest(droite))) || (clip.hitTest(arrieredroite))) || (clip.hitTest(arrieredroite2)));
}
function startReplayPlay() {
init();
replayPlayFrame = 0;
replayPlayEventsIndex = 0;
replayPlay = true;
_root.timing = true;
_root.paused = false;
_root.timer_txt = "00:00:00:00";
_root.startFrame = _root.frame;
_root.repclign._visible = true;
_root.repclign.gotoAndPlay(1);
}
function keyDownAction(t) {
toreturn = false;
if (t == 39) {
if (incRotation != incRotationQuanta) {
incRotation = incRotationQuanta;
toreturn = true;
}
} else if (t == 37) {
if (incRotation != (-incRotationQuanta)) {
incRotation = -incRotationQuanta;
toreturn = true;
}
} else if (t == 40) {
if (incSpeed != (-incSpeedQuanta)) {
incSpeed = -incSpeedQuanta;
toreturn = true;
}
} else if (t == 38) {
if (incSpeed != incSpeedQuanta) {
incSpeed = incSpeedQuanta;
toreturn = true;
}
} else if (t == 32) {
return(false);
}
return(toreturn);
}
function getNewCoord(v, va, vb) {
return({a:((v.y * vb.x) - (v.x * vb.y)) / ((va.y * vb.x) - (va.x * vb.y)), b:((v.y * va.x) - (v.x * va.y)) / ((vb.y * va.x) - (vb.x * va.y))});
}
function getProjection(v, va) {
return(((v.y * va.y) + (v.x * va.x)) / ((va.y * va.y) + (va.x * va.x)));
}
function getNormedProjection(v, va) {
return((v.y * va.y) + (v.x * va.x));
}
function getPolaire(v) {
dx = v.x;
dy = v.y;
d = Math.sqrt((dx * dx) + (dy * dy));
if (d == 0) {
a = 0;
} else {
a = Math.acos(dx / d);
if (dy < 0) {
a = -a;
}
}
return({a:a, d:d});
}
function keyUpAction(t) {
if (t == 39) {
if (incRotation > 0) {
incRotation = 0;
}
} else if (t == 37) {
if (incRotation < 0) {
incRotation = 0;
}
} else if (t == 40) {
if (incSpeed < 0) {
incSpeed = 0;
}
} else if (t == 38) {
if (incSpeed > 0) {
incSpeed = 0;
}
} else if (t == 32) {
}
}
var details = 0;
debug = false;
init();
initReplayRec();
}
onClipEvent (keyDown) {
if ((_root.timing == true) && (replayPlay == false)) {
t = Key.getCode();
if (keyDownAction(t)) {
if (((replayRecEventsIndex > 0) && (replayEvents[replayRecEventsIndex - 1].keycode == t)) && (replayEvents[replayRecEventsIndex - 1].framenb == replayRecFrame)) {
replayRecEventsIndex--;
}
replayEvents[replayRecEventsIndex] = {framenb:replayRecFrame, updown:1, keycode:t};
replayRecEventsIndex = replayRecEventsIndex + 1;
}
}
}
onClipEvent (keyUp) {
t = Key.getCode();
a = Key.getAscii();
if (a == 115) {
if (((_root.timing == false) && (replayPlay == false)) && (_root.gagnos._visible == false)) {
_root.clicStart();
} else if (_root.timing == true) {
_root.clicStop();
}
} else if ((_root.timing == true) && (replayPlay == false)) {
keyUpAction(t);
if (((replayRecEventsIndex > 0) && (replayEvents[replayRecEventsIndex - 1].keycode == t)) && (replayEvents[replayRecEventsIndex - 1].framenb == replayRecFrame)) {
replayRecEventsIndex--;
}
replayEvents[replayRecEventsIndex] = {framenb:replayRecFrame, updown:0, keycode:t};
replayRecEventsIndex = replayRecEventsIndex + 1;
}
}
onClipEvent (enterFrame) {
if ((_root.timing == true) && (_root.paused == false)) {
if (replayPlay) {
currentFrameIsEvented = true;
while (currentFrameIsEvented) {
nextFrame = replayEvents[replayPlayEventsIndex].framenb;
if (nextFrame == replayPlayFrame) {
if (replayEvents[replayPlayEventsIndex].updown == 0) {
keyUpAction(replayEvents[replayPlayEventsIndex].keycode);
} else {
keyDownAction(replayEvents[replayPlayEventsIndex].keycode);
}
replayPlayEventsIndex = replayPlayEventsIndex + 1;
} else {
currentFrameIsEvented = false;
}
}
replayPlayFrame = replayPlayFrame + 1;
}
if (debug) {
_root.createEmptyMovieClip("traces", replayRecFrame);
traceClip = _root.traces;
}
inertieX = pX - memoX;
inertieY = pY - memoY;
inertieRot = pRot - memoRot;
memoX = pX;
memoY = pY;
memoRot = pRot;
oldRot = wheelRotation;
oldSpeed = speed;
oldCorpsSpeedX = corpsSpeedX;
parrg = {x:-50, y:-27};
localToGlobal(parrg);
parrd = {x:-50, y:27};
localToGlobal(parrd);
tracespneu[tracespneuEnd] = {frame:pneuFrame, type:1, pneus:new Array(parrd, parrg)};
pneuRecCount++;
if (pneuRecCount == pneuPeriod) {
pneuRecCount = 0;
tracespneuEnd++;
tracespneu[tracespneuEnd] = tracespneu[tracespneuEnd - 1];
}
if (incSpeed > 0) {
if (remousframe < remousframeinit) {
remousframe++;
if (remousframe == remousframeinit) {
remous.gotoAndPlay(remousframe);
} else {
remous.gotoAndStop(remousframe);
}
}
} else if (remousframe > 0) {
remous.gotoAndStop(remousframe);
remousframe--;
}
wheelRotation = wheelRotation + incRotation;
if (wheelRotation > maxWheelAngle) {
wheelRotation = maxWheelAngle;
} else if (wheelRotation < (-maxWheelAngle)) {
wheelRotation = -maxWheelAngle;
}
remousDiff = wheelRotation - remousRotation;
if (remousDiff > (incRotationQuanta / 2)) {
remousDiff = incRotationQuanta / 2;
} else if (remousDiff < ((-incRotationQuanta) / 2)) {
remousDiff = (-incRotationQuanta) / 2;
}
remousRotation = remousRotation + remousDiff;
remous._rotation = -remousRotation;
if (oldRot != wheelRotation) {
moteur._rotation = -wheelRotation;
}
_root.tracespneu.createEmptyMovieClip("tracespneu", 1);
tracespneuClip = _root.tracespneu.tracespneu;
k = 0;
while (k < 1) {
if (k == 1) {
pneucouleur = 16777215 /* 0xFFFFFF */;
pneulargeur = 2;
decalpneux = 0;
decalpneuy = 0;
grossi = 0.1;
} else if (k == 0) {
pneucouleur = 16777215 /* 0xFFFFFF */;
pneulargeur = 4;
decalpneux = 0;
decalpneuy = 0;
grossi = 0.4;
}
j = 0;
while (j < nbTracesPneu) {
curveInd = 0;
curveX = -1;
curveY = -1;
i = tracespneuStart;
while (i < (tracespneuEnd + 1)) {
pneu = tracespneu[i];
alphacol = (30 - (pneuFrame - pneu.frame)) * 3;
pneulargeur2 = pneulargeur + ((100 - alphacol) * grossi);
if (alphacol > 0) {
tracespneuClip.lineStyle(pneulargeur2, pneucouleur, alphacol);
if ((i == tracespneuStart) || (pneu.type == 0)) {
if (nbTracesPneu == 1) {
tracespneuClip.moveTo(((pneu.pneus[j].x + pneu.pneus[j + 1].x) / 2) + decalpneux, ((pneu.pneus[j].y + pneu.pneus[j + 1].y) / 2) + decalpneuy);
} else if (nbTracesPneu == 2) {
tracespneuClip.moveTo(pneu.pneus[j].x + decalpneux, pneu.pneus[j].y + decalpneuy);
}
} else if (nbTracesPneu == 1) {
tracespneuClip.lineTo(((pneu.pneus[j].x + pneu.pneus[j + 1].x) / 2) + decalpneux, ((pneu.pneus[j].y + pneu.pneus[j + 1].y) / 2) + decalpneuy);
} else {
tracespneuClip.lineTo(pneu.pneus[j].x + decalpneux, pneu.pneus[j].y + decalpneuy);
}
} else {
tracespneu[i] = NaN;
tracespneuStart++;
}
i++;
}
j++;
}
k++;
}
if (nbTracesPneu > 1) {
i = tracespneuStart;
while (i < tracespneuEnd) {
pneu = tracespneu[i];
pneu1 = pneu.pneus[0];
pneu2 = pneu.pneus[1];
pneumiddle = {x:(pneu1.x + pneu2.x) / 2, y:(pneu1.y + pneu2.y) / 2};
distancePneusCarre = ((pneu1.x - pneu2.x) * (pneu1.x - pneu2.x)) + ((pneu1.y - pneu2.y) * (pneu1.y - pneu2.y));
rappEcarte = (20 * (0.1 + Math.abs(speed))) / distancePneusCarre;
pneu.pneus[0] = {x:pneu1.x + ((pneu1.x - pneumiddle.x) * rappEcarte), y:pneu1.y + ((pneu1.y - pneumiddle.y) * rappEcarte)};
pneu.pneus[1] = {x:pneu2.x + ((pneu2.x - pneumiddle.x) * rappEcarte), y:pneu2.y + ((pneu2.y - pneumiddle.y) * rappEcarte)};
i++;
}
}
speed = speed + incSpeed;
if (speed > maxSpeed) {
speed = maxSpeed;
} else if (speed < (-maxSpeed)) {
speed = -maxSpeed;
}
if (incSpeed == 0) {
speed = speed * speedDecay;
}
speed = speed + incSpeed;
if (speed > maxSpeed) {
speed = maxSpeed;
} else if (speed < (-maxSpeed)) {
speed = -maxSpeed;
}
incx = Math.sin(wheelRotation * (Math.PI/180)) * speed;
pRot = pRot + (((((Math.atan(incx / carLengthScaled) * 180) / Math.PI) * 0.15) + (inertieRot * 1)) * 0.9);
incy = Math.cos(wheelRotation * (Math.PI/180)) * speed;
pY = pY + ((((Math.sin((_rotation + 0) * (Math.PI/180)) * incy) * 0.2) + (inertieY * 1)) * 0.9);
pX = pX + ((((Math.cos((_rotation + 0) * (Math.PI/180)) * incy) * 0.2) + (inertieX * 1)) * 0.9);
_x = pX;
_y = pY;
_rotation = pRot;
tmpP1 = {x:arriere._x, y:arriere._y};
localToGlobal(tmpP1);
A = _root.ralenti.hitTest(tmpP1.x, tmpP1.y, true);
tmpP2 = {x:avant._x, y:avant._y};
localToGlobal(tmpP2);
B = _root.ralenti.hitTest(tmpP2.x, tmpP2.y, true);
if (A || (B)) {
tmpP1 = {x:arriere._x, y:arriere._y};
localToGlobal(tmpP1);
A = _root.plage.hitTest(tmpP1.x, tmpP1.y, true);
tmpP2 = {x:avant._x, y:avant._y};
localToGlobal(tmpP2);
B = _root.plage.hitTest(tmpP2.x, tmpP2.y, true);
if (A || (B)) {
pX = memoX;
pY = memoY;
pRot = memoRot;
speed = 0;
_x = pX;
_y = pY;
_rotation = pRot;
} else {
memoX = memoX + ((pX - memoX) * 0.2);
memoY = memoY + ((pY - memoY) * 0.2);
speed = speed * 0.95;
}
} else {
if (_root.bouees.gagne) {
gagne = true;
}
if (gagne == true) {
gare = true;
if (replayPlay) {
_root.timing = false;
replayPlay = false;
_root.replayos.gotoAndPlay(2);
} else {
_root.gagnos._visible = true;
_root.gagnos.gotoAndPlay(1);
_root.elapsedTime = (Math.ceil(_root.elapsedTime) + 8) - random(16);
score = (2000000 / _root.elapsedTime) - forceChocs;
_root.timing = false;
_root.paused = false;
}
_root.playSurround(true);
}
}
forceAccelerationY = oldSpeed - speed;
if (corpsDeltaY > 0) {
forceBack = (-corpsDeltaX) * 0.5;
} else {
forceBack = (-corpsDeltaX) * 2;
}
corpsSpeedX = corpsSpeedX + (forceAccelerationY + forceBack);
oldCorpsDeltaX = corpsDeltaX;
corpsDeltaX = corpsDeltaX + corpsSpeedX;
if (corpsDeltaX > maxCorpsDeltaX) {
corpsDeltaX = maxCorpsDeltaX;
} else if (corpsDeltaX < minCorpsDeltaX) {
corpsDeltaX = minCorpsDeltaX;
}
bustebras._x = _root.xCorps + corpsDeltaX;
corpsSpeedX = corpsSpeedX * corpsDecay;
teteDeltaX = teteDeltaX + (oldCorpsDeltaX - corpsDeltaX);
teteSpeedX = teteSpeedX + ((-teteDeltaX) * 0.5);
teteDeltaX = teteDeltaX + teteSpeedX;
if (teteDeltaX > maxTeteDeltaX) {
teteDeltaX = maxTeteDeltaX;
} else if (teteDeltaX < minTeteDeltaX) {
teteDeltaX = minTeteDeltaX;
}
tete._x = (_root.xTete + corpsDeltaX) + teteDeltaX;
teteSpeedX = teteSpeedX * teteDecay;
if (((oldRot != wheelRotation) || (oldSpeed != speed)) || (oldCorpsSpeedX != corpsSpeedX)) {
corpsDeltaY = (wheelRotation * maxCorpsDeltaY) / maxWheelAngle;
bustebras._y = _root.yCorps - corpsDeltaY;
corpsDeltaRot = (wheelRotation * maxCorpsDeltaRot) / maxWheelAngle;
bustebras._rotation = _root.rotCorps + corpsDeltaRot;
teteDeltaY = corpsDeltaY * 0.3;
tete._y = (_root.yTete - corpsDeltaY) - teteDeltaY;
posBrasDroitVolant = rayonVolant * Math.sin((Math.abs(2 * wheelRotation) * Math.PI) / (2 * maxWheelAngle));
posBrasGaucheVolant = rayonVolant * Math.sin((Math.abs(2 * wheelRotation) * Math.PI) / (2 * maxWheelAngle));
setBrasRotation();
}
if (!replayPlay) {
replayRecFrame = replayRecFrame + 1;
}
pneuFrame++;
}
}
Instance of Symbol 60 MovieClip "bouees" in Frame 1
onClipEvent (load) {
function init() {
etape = 0;
b1_1_pass = false;
b1_2_pass = false;
b2_1_pass = false;
b2_2_pass = false;
gagne = false;
details();
i = 0;
while (i < nbBouees) {
tabBouees[i].init();
tabBouees[i].fleche._visible = false;
i++;
}
}
function details() {
if (_root.voitureverte.details <= 1) {
remVis = true;
} else {
remVis = false;
}
i = 0;
while (i < nbBouees) {
_root.remousbouees["rb" + i]._visible = remVis;
i++;
}
}
function isIn(bObj, direc, horiz, rot) {
xV = _root.voitureverte._x;
yV = _root.voitureverte._y;
if (rot == 0) {
xMin = bObj._x + (40 * horiz);
xMax = bObj._x + (80 * horiz);
if (xMin > xMax) {
xTmp = xMax;
xMax = xMin;
xMin = xTmp;
}
if (((xV > xMin) && (xV < xMax)) && ((direc * (yV - bObj._y)) > 0)) {
return(true);
}
return(false);
}
yMin = bObj._y - 20;
yMax = bObj._y + 20;
if (((yV > yMin) && (yV < yMax)) && ((horiz * (xV - bObj._x)) > 0)) {
return(true);
}
return(false);
}
function isThru(bObj1, bObj2, horiz) {
xV = _root.voitureverte._x;
yV = _root.voitureverte._y;
v1 = {x:bObj1._x - xV, y:bObj1._y - yV};
v2 = {x:bObj2._x - xV, y:bObj2._y - yV};
v12 = {x:bObj2._x - bObj1._x, y:bObj2._y - bObj1._y};
v12Ortho = {x:v12.y, y:-v12.x};
projV1 = _root.voitureverte.getProjection(v1, v2);
projv12Ortho = _root.voitureverte.getProjection(v1, v12Ortho);
if ((projV1 < 0) && (((horiz * projv12Ortho) + 0.2) < 0)) {
return(true);
}
return(false);
}
function boueesChocs(bInd) {
j = 0;
while (j < nbBouees) {
if (j != bInd) {
tabBouees[j].pushed(tabBouees[bInd]);
}
j++;
}
}
tabBouees = new Array();
nbBouees = 7;
i = 0;
while (i < nbBouees) {
tabBouees[i] = this["bouee" + i];
tabBouees[i].setIndice(i);
i++;
}
etapes = new Array();
etapes[0] = {b1:0, dir1:-1, hor1:1, rot:0, b2:-1, dir2:0, hor2:0};
etapes[1] = {b1:1, dir1:1, hor1:1, rot:0, b2:-1, dir2:0, hor2:0};
etapes[2] = {b1:2, dir1:-1, hor1:1, rot:1, b2:-1, dir2:0, hor2:0};
etapes[3] = {b1:3, dir1:1, hor1:-1, rot:0, b2:4, dir2:-1, hor2:-1};
etapes[4] = {b1:5, dir1:1, hor1:-1, rot:0, b2:6, dir2:-1, hor2:-1};
etapes[5] = {b1:0, dir1:-1, hor1:1, rot:0, b2:-1, dir2:0, hor2:0};
nbEtapes = 6;
init();
}
onClipEvent (enterFrame) {
vCoord = {x:0, y:0};
vRot = 0;
i = 0;
while (i < nbBouees) {
force = tabBouees[i].getForce();
if (force != 0) {
versCenter = {x:_root.voitureverte.pX - force.x, y:_root.voitureverte.pY - force.y};
resForce = _root.voitureverte.getNewCoord({x:(force.xOrtho * force.dCarre) / 6000, y:(force.yOrtho * force.dCarre) / 6000}, versCenter, {x:versCenter.y, y:-versCenter.x});
vCoord = {x:vCoord.x + (resForce.a * versCenter.x), y:vCoord.y + (resForce.a * versCenter.y)};
vRot = vRot + ((resForce.b * 1.5) / force.d);
}
i++;
}
_root.voitureverte.memoX = _root.voitureverte.memoX - vCoord.x;
_root.voitureverte.memoY = _root.voitureverte.memoY - vCoord.y;
_root.voitureverte.memoRot = _root.voitureverte.memoRot - vRot;
if (!gagne) {
theEtape = etapes[etape];
etapesuivante = false;
if (theEtape.b2 == -1) {
b = tabBouees[theEtape.b1];
b.fleche._rotation = 90 * theEtape.dir1;
b.fleche._visible = true;
if (b1_1_pass == false) {
b1_1_pass = isIn(b, theEtape.dir1, -theEtape.hor1, 0);
} else if (b1_2_pass == false) {
b1_2_pass = isIn(b, theEtape.dir1, theEtape.hor1, theEtape.rot);
}
if (b1_1_pass && (b1_2_pass)) {
etapesuivante = true;
tabBouees[theEtape.b1].fleche._visible = false;
}
} else {
b1 = tabBouees[theEtape.b1];
b2 = tabBouees[theEtape.b2];
b1.fleche._rotation = 90 * theEtape.dir1;
b1.fleche._visible = true;
b2.fleche._rotation = 90 * theEtape.dir2;
b2.fleche._visible = true;
if (b1_1_pass == false) {
b1_1_pass = isThru(b1, b2, -theEtape.hor1);
} else if (b1_2_pass == false) {
b1_2_pass = isThru(b1, b2, theEtape.hor1);
}
if (b1_1_pass && (b1_2_pass)) {
etapesuivante = true;
tabBouees[theEtape.b1].fleche._visible = false;
tabBouees[theEtape.b2].fleche._visible = false;
}
}
if (etapesuivante) {
etape++;
b1_1_pass = false;
b1_2_pass = false;
b2_1_pass = false;
b2_2_pass = false;
if (etape >= nbEtapes) {
gagne = true;
}
}
}
}
Instance of Symbol 132 MovieClip "menuder" in Frame 1
onClipEvent (enterFrame) {
if (initDone && (openDone)) {
}
}
Instance of Symbol 145 MovieClip "message" in Frame 1
onClipEvent (load) {
var messagetext;
}
Instance of Symbol 161 MovieClip "aide" in Frame 1
/* no clip actions */
Symbol 7 MovieClip Frame 32
gotoAndPlay (1);
Symbol 16 MovieClip Frame 35
gotoAndPlay (1);
Symbol 25 MovieClip Frame 15
gotoAndPlay (1);
Symbol 34 MovieClip Frame 31
gotoAndPlay(_root.voitureverte.remousframeinit);
Instance of Symbol 48 MovieClip "tete" in Symbol 51 MovieClip Frame 1
onClipEvent (load) {
function details() {
if (_root.voitureverte.details == 0) {
nbFils = 3;
} else if (_root.voitureverte.details == 1) {
nbFils = 1;
} else if (_root.voitureverte.details == 2) {
nbFils = 0;
}
}
oscilator = 0;
fils = new Array();
color = 16764006 /* 0xFFCC66 */;
largeur = 1;
fils[0] = {x:-7, y:-1, tx:-7, ty:-2, fx:-8, fy:-3, r:20, color:color, largeur:largeur};
fils[1] = {x:-7, y:1, tx:-7, ty:2, fx:-8, fy:3, r:20, color:color, largeur:largeur};
fils[2] = {x:-7, y:0, tx:-7, ty:0, fx:-8, fy:0, r:20, color:color, largeur:largeur};
details();
memoP = {x:_x, y:_y};
localToGlobal(memoP);
}
onClipEvent (enterFrame) {
p = {x:_x, y:_y};
localToGlobal(p);
vitesse = {x:p.x - memoP.x, y:p.y - memoP.y};
vitessePol = _root.voitureverte.getPolaire(vitesse);
if (vitessePol.d > 20) {
vitessePol.d = 20;
}
vitessePol.a = vitessePol.a + Math.PI;
rapport = vitessePol.d / 20;
angleRelatif = vitessePol.a - ((_root.voitureverte._rotation * Math.PI) / 180);
_root.voitureverte.createEmptyMovieClip("fils", 102);
filsClip = _root.voitureverte.fils;
i = 0;
while (i < nbFils) {
filsClip.lineStyle(fils[i].largeur, fils[i].color, 100);
filsClip.moveTo(_x + fils[i].x, _y + fils[i].y);
rayonVit = fils[i].r * rapport;
angleOscil = Math.cos(((oscilator * Math.PI) / 180) + (i * 2)) / 10;
filsClip.curveTo(_x + fils[i].tx, _y + fils[i].ty, (_x + fils[i].fx) + (rayonVit * Math.cos(angleRelatif + angleOscil)), (_y + fils[i].fy) + (rayonVit * Math.sin(angleRelatif + angleOscil)));
i++;
}
oscilator = oscilator + (1 + (vitessePol.d * 4));
memoP = p;
}
Instance of Symbol 50 MovieClip "flagavant" in Symbol 51 MovieClip Frame 1
onClipEvent (load) {
oscilator = 0;
fils = new Array();
color1 = 16711680 /* 0xFF0000 */;
color2 = 13421772 /* 0xCCCCCC */;
color3 = 255;
largeur = 4;
fils[0] = {x:-1, y:-1, tx:-4, ty:-0.5, fx:-7, fy:-0.5, r:30, color:color2, largeur:largeur};
fils[1] = {x:-1, y:1, tx:-4, ty:0.5, fx:-7, fy:0.5, r:30, color:color2, largeur:largeur};
nbFils = 2;
memoP = {x:_x, y:_y};
localToGlobal(memoP);
}
onClipEvent (enterFrame) {
p = {x:_x, y:_y};
localToGlobal(p);
vitesse = {x:p.x - memoP.x, y:p.y - memoP.y};
vitessePol = _root.voitureverte.getPolaire(vitesse);
if (vitessePol.d > 20) {
vitessePol.d = 20;
}
vitessePol.a = vitessePol.a + Math.PI;
rapport = vitessePol.d / 20;
angleRelatif = vitessePol.a - ((_root.voitureverte._rotation * Math.PI) / 180);
_root.voitureverte.createEmptyMovieClip("fils2", 103);
filsClip = _root.voitureverte.fils2;
i = 0;
while (i < nbFils) {
filsClip.lineStyle(fils[i].largeur, fils[i].color, 100);
filsClip.moveTo(_x + fils[i].x, _y + fils[i].y);
rayonVit = fils[i].r * rapport;
angleOscil = Math.cos(((oscilator * Math.PI) / 180) + (i * 2)) / 5;
filsClip.curveTo(_x + fils[i].tx, _y + fils[i].ty, (_x + fils[i].fx) + (rayonVit * Math.cos(angleRelatif + angleOscil)), (_y + fils[i].fy) + (rayonVit * Math.sin(angleRelatif + angleOscil)));
i++;
}
oscilator = oscilator + (1 + (vitessePol.d * 4));
memoP = p;
}
Symbol 58 MovieClip Frame 10
gotoAndPlay (1);
Instance of Symbol 59 MovieClip "bouee1" in Symbol 60 MovieClip Frame 1
onClipEvent (load) {
function setIndice(pI) {
num = pI;
}
function init() {
_x = xInit;
_y = yInit;
pX = _x;
pY = _y;
memoX = _x;
memoY = _y;
frame = 0;
}
function pushed(boueeClip) {
diffBouees = {x:pX - boueeClip.pX, y:pY - boueeClip.pY};
dCarre = (diffBouees.x * diffBouees.x) + (diffBouees.y * diffBouees.y);
if (dCarre < 1600) {
memoX = pX;
memoY = pY;
dPasCarre = Math.sqrt(dCarre);
pX = boueeClip.pX + ((diffBouees.x * 41) / dPasCarre);
pY = boueeClip.pY + ((diffBouees.y * 41) / dPasCarre);
_x = pX;
_y = pY;
_root.bouees.boueesChocs(num);
remous();
}
}
function getForce() {
tmpP = {x:0, y:0};
localToGlobal(tmpP);
hit = _root.voitureverte.bump.hitTest(tmpP.x, tmpP.y, true);
if (hit) {
versCentre = {x:_root.voitureverte._x - tmpP.x, y:_root.voitureverte._y - tmpP.y};
verCentrePol = _root.voitureverte.getPolaire(versCentre);
nRec = 7;
tR = 5;
angleBas = 0;
angleHaut = Math.PI;
i = 0;
while (i < nRec) {
tmpAngle = (angleBas + angleHaut) / 2;
pTest = {x:tmpP.x + (tR * Math.cos(verCentrePol.a + tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a + tmpAngle))};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
angleBas = tmpAngle;
} else {
angleHaut = tmpAngle;
}
i++;
}
tmpAngle = (angleBas + angleHaut) / 2;
pGauche = {x:tmpP.x + (tR * Math.cos(verCentrePol.a + tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a + tmpAngle))};
angleBas = 0;
angleHaut = Math.PI;
i = 0;
while (i < nRec) {
tmpAngle = (angleBas + angleHaut) / 2;
pTest = {x:tmpP.x + (tR * Math.cos(verCentrePol.a - tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a - tmpAngle))};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
angleBas = tmpAngle;
} else {
angleHaut = tmpAngle;
}
i++;
}
tmpAngle = (angleBas + angleHaut) / 2;
pDroite = {x:tmpP.x + (tR * Math.cos(verCentrePol.a - tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a - tmpAngle))};
vTan = {x:pDroite.x - pGauche.x, y:pDroite.y - pGauche.y};
dTan = Math.sqrt((vTan.x * vTan.x) + (vTan.y * vTan.y));
vOrtho = {x:vTan.y / dTan, y:(-vTan.x) / dTan};
up = 100;
down = 0;
hit = true;
i = 0;
while ((i < nRec) || (hit == true)) {
tmpUpDown = (up + down) / 2;
pTest = {x:tmpP.x + (tmpUpDown * vOrtho.x), y:tmpP.y + (tmpUpDown * vOrtho.y)};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
hit = true;
down = tmpUpDown;
} else {
hit = false;
up = tmpUpDown;
}
i++;
}
memoX = pX;
memoY = pY;
pX = pTest.x;
pY = pTest.y;
_x = pX;
_y = pY;
_root.bouees.boueesChocs(num);
remous();
versInit = {x:xInit - pX, y:yInit - pY};
versInitDCarre = (1 + (versInit.x * versInit.x)) + (versInit.y * versInit.y);
return({x:pX, y:pY, d:verCentrePol.d, a:verCentrePol.a, vX:versInit.x, vY:versInit.y, xOrtho:-vOrtho.x, yOrtho:-vOrtho.y, dCarre:versInitDCarre});
}
return(0);
}
function remous() {
_root.remousbouees["rb" + num]._x = _x;
_root.remousbouees["rb" + num]._y = _y;
_root.tracespneu.createEmptyMovieClip("remous" + num, 2 + num);
remousClip = _root.tracespneu["remous" + num];
if ((Math.abs(pX - memoX) > 2) || (Math.abs(pY - memoY) > 2)) {
remousClip.lineStyle(35, 16777215, 90);
remousClip.moveTo(memoX, memoY);
remousClip.lineTo(pX, pY);
}
}
xInit = _x;
yInit = _y;
init();
num = 1;
}
onClipEvent (enterFrame) {
inertie = {x:pX - memoX, y:pY - memoY};
versInit = {x:xInit - pX, y:yInit - pY};
memoX = pX;
memoY = pY;
pX = pX + ((versInit.x * 0.1) + (inertie.x * 0.1));
pY = pY + ((versInit.y * 0.1) + (inertie.y * 0.1));
_x = pX;
_y = pY;
remous();
if ((Math.abs(pX - memoX) > 2) || (Math.abs(pY - memoY) > 2)) {
_root.bouees.boueesChocs(num);
}
frame++;
}
Instance of Symbol 59 MovieClip "bouee6" in Symbol 60 MovieClip Frame 1
onClipEvent (load) {
function setIndice(pI) {
num = pI;
}
function init() {
_x = xInit;
_y = yInit;
pX = _x;
pY = _y;
memoX = _x;
memoY = _y;
frame = 0;
}
function pushed(boueeClip) {
diffBouees = {x:pX - boueeClip.pX, y:pY - boueeClip.pY};
dCarre = (diffBouees.x * diffBouees.x) + (diffBouees.y * diffBouees.y);
if (dCarre < 1600) {
memoX = pX;
memoY = pY;
dPasCarre = Math.sqrt(dCarre);
pX = boueeClip.pX + ((diffBouees.x * 41) / dPasCarre);
pY = boueeClip.pY + ((diffBouees.y * 41) / dPasCarre);
_x = pX;
_y = pY;
_root.bouees.boueesChocs(num);
remous();
}
}
function getForce() {
tmpP = {x:0, y:0};
localToGlobal(tmpP);
hit = _root.voitureverte.bump.hitTest(tmpP.x, tmpP.y, true);
if (hit) {
versCentre = {x:_root.voitureverte._x - tmpP.x, y:_root.voitureverte._y - tmpP.y};
verCentrePol = _root.voitureverte.getPolaire(versCentre);
nRec = 7;
tR = 5;
angleBas = 0;
angleHaut = Math.PI;
i = 0;
while (i < nRec) {
tmpAngle = (angleBas + angleHaut) / 2;
pTest = {x:tmpP.x + (tR * Math.cos(verCentrePol.a + tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a + tmpAngle))};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
angleBas = tmpAngle;
} else {
angleHaut = tmpAngle;
}
i++;
}
tmpAngle = (angleBas + angleHaut) / 2;
pGauche = {x:tmpP.x + (tR * Math.cos(verCentrePol.a + tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a + tmpAngle))};
angleBas = 0;
angleHaut = Math.PI;
i = 0;
while (i < nRec) {
tmpAngle = (angleBas + angleHaut) / 2;
pTest = {x:tmpP.x + (tR * Math.cos(verCentrePol.a - tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a - tmpAngle))};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
angleBas = tmpAngle;
} else {
angleHaut = tmpAngle;
}
i++;
}
tmpAngle = (angleBas + angleHaut) / 2;
pDroite = {x:tmpP.x + (tR * Math.cos(verCentrePol.a - tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a - tmpAngle))};
vTan = {x:pDroite.x - pGauche.x, y:pDroite.y - pGauche.y};
dTan = Math.sqrt((vTan.x * vTan.x) + (vTan.y * vTan.y));
vOrtho = {x:vTan.y / dTan, y:(-vTan.x) / dTan};
up = 100;
down = 0;
hit = true;
i = 0;
while ((i < nRec) || (hit == true)) {
tmpUpDown = (up + down) / 2;
pTest = {x:tmpP.x + (tmpUpDown * vOrtho.x), y:tmpP.y + (tmpUpDown * vOrtho.y)};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
hit = true;
down = tmpUpDown;
} else {
hit = false;
up = tmpUpDown;
}
i++;
}
memoX = pX;
memoY = pY;
pX = pTest.x;
pY = pTest.y;
_x = pX;
_y = pY;
_root.bouees.boueesChocs(num);
remous();
versInit = {x:xInit - pX, y:yInit - pY};
versInitDCarre = (1 + (versInit.x * versInit.x)) + (versInit.y * versInit.y);
return({x:pX, y:pY, d:verCentrePol.d, a:verCentrePol.a, vX:versInit.x, vY:versInit.y, xOrtho:-vOrtho.x, yOrtho:-vOrtho.y, dCarre:versInitDCarre});
}
return(0);
}
function remous() {
_root.remousbouees["rb" + num]._x = _x;
_root.remousbouees["rb" + num]._y = _y;
_root.tracespneu.createEmptyMovieClip("remous" + num, 2 + num);
remousClip = _root.tracespneu["remous" + num];
if ((Math.abs(pX - memoX) > 2) || (Math.abs(pY - memoY) > 2)) {
remousClip.lineStyle(35, 16777215, 90);
remousClip.moveTo(memoX, memoY);
remousClip.lineTo(pX, pY);
}
}
xInit = _x;
yInit = _y;
init();
num = 6;
}
onClipEvent (enterFrame) {
inertie = {x:pX - memoX, y:pY - memoY};
versInit = {x:xInit - pX, y:yInit - pY};
memoX = pX;
memoY = pY;
pX = pX + ((versInit.x * 0.1) + (inertie.x * 0.1));
pY = pY + ((versInit.y * 0.1) + (inertie.y * 0.1));
_x = pX;
_y = pY;
remous();
if ((Math.abs(pX - memoX) > 2) || (Math.abs(pY - memoY) > 2)) {
_root.bouees.boueesChocs(num);
}
frame++;
}
Instance of Symbol 59 MovieClip "bouee3" in Symbol 60 MovieClip Frame 1
onClipEvent (load) {
function setIndice(pI) {
num = pI;
}
function init() {
_x = xInit;
_y = yInit;
pX = _x;
pY = _y;
memoX = _x;
memoY = _y;
frame = 0;
}
function pushed(boueeClip) {
diffBouees = {x:pX - boueeClip.pX, y:pY - boueeClip.pY};
dCarre = (diffBouees.x * diffBouees.x) + (diffBouees.y * diffBouees.y);
if (dCarre < 1600) {
memoX = pX;
memoY = pY;
dPasCarre = Math.sqrt(dCarre);
pX = boueeClip.pX + ((diffBouees.x * 41) / dPasCarre);
pY = boueeClip.pY + ((diffBouees.y * 41) / dPasCarre);
_x = pX;
_y = pY;
_root.bouees.boueesChocs(num);
remous();
}
}
function getForce() {
tmpP = {x:0, y:0};
localToGlobal(tmpP);
hit = _root.voitureverte.bump.hitTest(tmpP.x, tmpP.y, true);
if (hit) {
versCentre = {x:_root.voitureverte._x - tmpP.x, y:_root.voitureverte._y - tmpP.y};
verCentrePol = _root.voitureverte.getPolaire(versCentre);
nRec = 7;
tR = 5;
angleBas = 0;
angleHaut = Math.PI;
i = 0;
while (i < nRec) {
tmpAngle = (angleBas + angleHaut) / 2;
pTest = {x:tmpP.x + (tR * Math.cos(verCentrePol.a + tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a + tmpAngle))};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
angleBas = tmpAngle;
} else {
angleHaut = tmpAngle;
}
i++;
}
tmpAngle = (angleBas + angleHaut) / 2;
pGauche = {x:tmpP.x + (tR * Math.cos(verCentrePol.a + tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a + tmpAngle))};
angleBas = 0;
angleHaut = Math.PI;
i = 0;
while (i < nRec) {
tmpAngle = (angleBas + angleHaut) / 2;
pTest = {x:tmpP.x + (tR * Math.cos(verCentrePol.a - tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a - tmpAngle))};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
angleBas = tmpAngle;
} else {
angleHaut = tmpAngle;
}
i++;
}
tmpAngle = (angleBas + angleHaut) / 2;
pDroite = {x:tmpP.x + (tR * Math.cos(verCentrePol.a - tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a - tmpAngle))};
vTan = {x:pDroite.x - pGauche.x, y:pDroite.y - pGauche.y};
dTan = Math.sqrt((vTan.x * vTan.x) + (vTan.y * vTan.y));
vOrtho = {x:vTan.y / dTan, y:(-vTan.x) / dTan};
up = 100;
down = 0;
hit = true;
i = 0;
while ((i < nRec) || (hit == true)) {
tmpUpDown = (up + down) / 2;
pTest = {x:tmpP.x + (tmpUpDown * vOrtho.x), y:tmpP.y + (tmpUpDown * vOrtho.y)};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
hit = true;
down = tmpUpDown;
} else {
hit = false;
up = tmpUpDown;
}
i++;
}
memoX = pX;
memoY = pY;
pX = pTest.x;
pY = pTest.y;
_x = pX;
_y = pY;
_root.bouees.boueesChocs(num);
remous();
versInit = {x:xInit - pX, y:yInit - pY};
versInitDCarre = (1 + (versInit.x * versInit.x)) + (versInit.y * versInit.y);
return({x:pX, y:pY, d:verCentrePol.d, a:verCentrePol.a, vX:versInit.x, vY:versInit.y, xOrtho:-vOrtho.x, yOrtho:-vOrtho.y, dCarre:versInitDCarre});
}
return(0);
}
function remous() {
_root.remousbouees["rb" + num]._x = _x;
_root.remousbouees["rb" + num]._y = _y;
_root.tracespneu.createEmptyMovieClip("remous" + num, 2 + num);
remousClip = _root.tracespneu["remous" + num];
if ((Math.abs(pX - memoX) > 2) || (Math.abs(pY - memoY) > 2)) {
remousClip.lineStyle(35, 16777215, 90);
remousClip.moveTo(memoX, memoY);
remousClip.lineTo(pX, pY);
}
}
xInit = _x;
yInit = _y;
init();
num = 3;
}
onClipEvent (enterFrame) {
inertie = {x:pX - memoX, y:pY - memoY};
versInit = {x:xInit - pX, y:yInit - pY};
memoX = pX;
memoY = pY;
pX = pX + ((versInit.x * 0.1) + (inertie.x * 0.1));
pY = pY + ((versInit.y * 0.1) + (inertie.y * 0.1));
_x = pX;
_y = pY;
remous();
if ((Math.abs(pX - memoX) > 2) || (Math.abs(pY - memoY) > 2)) {
_root.bouees.boueesChocs(num);
}
frame++;
}
Instance of Symbol 59 MovieClip "bouee2" in Symbol 60 MovieClip Frame 1
onClipEvent (load) {
function setIndice(pI) {
num = pI;
}
function init() {
_x = xInit;
_y = yInit;
pX = _x;
pY = _y;
memoX = _x;
memoY = _y;
frame = 0;
}
function pushed(boueeClip) {
diffBouees = {x:pX - boueeClip.pX, y:pY - boueeClip.pY};
dCarre = (diffBouees.x * diffBouees.x) + (diffBouees.y * diffBouees.y);
if (dCarre < 1600) {
memoX = pX;
memoY = pY;
dPasCarre = Math.sqrt(dCarre);
pX = boueeClip.pX + ((diffBouees.x * 41) / dPasCarre);
pY = boueeClip.pY + ((diffBouees.y * 41) / dPasCarre);
_x = pX;
_y = pY;
_root.bouees.boueesChocs(num);
remous();
}
}
function getForce() {
tmpP = {x:0, y:0};
localToGlobal(tmpP);
hit = _root.voitureverte.bump.hitTest(tmpP.x, tmpP.y, true);
if (hit) {
versCentre = {x:_root.voitureverte._x - tmpP.x, y:_root.voitureverte._y - tmpP.y};
verCentrePol = _root.voitureverte.getPolaire(versCentre);
nRec = 7;
tR = 5;
angleBas = 0;
angleHaut = Math.PI;
i = 0;
while (i < nRec) {
tmpAngle = (angleBas + angleHaut) / 2;
pTest = {x:tmpP.x + (tR * Math.cos(verCentrePol.a + tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a + tmpAngle))};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
angleBas = tmpAngle;
} else {
angleHaut = tmpAngle;
}
i++;
}
tmpAngle = (angleBas + angleHaut) / 2;
pGauche = {x:tmpP.x + (tR * Math.cos(verCentrePol.a + tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a + tmpAngle))};
angleBas = 0;
angleHaut = Math.PI;
i = 0;
while (i < nRec) {
tmpAngle = (angleBas + angleHaut) / 2;
pTest = {x:tmpP.x + (tR * Math.cos(verCentrePol.a - tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a - tmpAngle))};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
angleBas = tmpAngle;
} else {
angleHaut = tmpAngle;
}
i++;
}
tmpAngle = (angleBas + angleHaut) / 2;
pDroite = {x:tmpP.x + (tR * Math.cos(verCentrePol.a - tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a - tmpAngle))};
vTan = {x:pDroite.x - pGauche.x, y:pDroite.y - pGauche.y};
dTan = Math.sqrt((vTan.x * vTan.x) + (vTan.y * vTan.y));
vOrtho = {x:vTan.y / dTan, y:(-vTan.x) / dTan};
up = 100;
down = 0;
hit = true;
i = 0;
while ((i < nRec) || (hit == true)) {
tmpUpDown = (up + down) / 2;
pTest = {x:tmpP.x + (tmpUpDown * vOrtho.x), y:tmpP.y + (tmpUpDown * vOrtho.y)};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
hit = true;
down = tmpUpDown;
} else {
hit = false;
up = tmpUpDown;
}
i++;
}
memoX = pX;
memoY = pY;
pX = pTest.x;
pY = pTest.y;
_x = pX;
_y = pY;
_root.bouees.boueesChocs(num);
remous();
versInit = {x:xInit - pX, y:yInit - pY};
versInitDCarre = (1 + (versInit.x * versInit.x)) + (versInit.y * versInit.y);
return({x:pX, y:pY, d:verCentrePol.d, a:verCentrePol.a, vX:versInit.x, vY:versInit.y, xOrtho:-vOrtho.x, yOrtho:-vOrtho.y, dCarre:versInitDCarre});
}
return(0);
}
function remous() {
_root.remousbouees["rb" + num]._x = _x;
_root.remousbouees["rb" + num]._y = _y;
_root.tracespneu.createEmptyMovieClip("remous" + num, 2 + num);
remousClip = _root.tracespneu["remous" + num];
if ((Math.abs(pX - memoX) > 2) || (Math.abs(pY - memoY) > 2)) {
remousClip.lineStyle(35, 16777215, 90);
remousClip.moveTo(memoX, memoY);
remousClip.lineTo(pX, pY);
}
}
xInit = _x;
yInit = _y;
init();
num = 2;
}
onClipEvent (enterFrame) {
inertie = {x:pX - memoX, y:pY - memoY};
versInit = {x:xInit - pX, y:yInit - pY};
memoX = pX;
memoY = pY;
pX = pX + ((versInit.x * 0.1) + (inertie.x * 0.1));
pY = pY + ((versInit.y * 0.1) + (inertie.y * 0.1));
_x = pX;
_y = pY;
remous();
if ((Math.abs(pX - memoX) > 2) || (Math.abs(pY - memoY) > 2)) {
_root.bouees.boueesChocs(num);
}
frame++;
}
Instance of Symbol 59 MovieClip "bouee4" in Symbol 60 MovieClip Frame 1
onClipEvent (load) {
function setIndice(pI) {
num = pI;
}
function init() {
_x = xInit;
_y = yInit;
pX = _x;
pY = _y;
memoX = _x;
memoY = _y;
frame = 0;
}
function pushed(boueeClip) {
diffBouees = {x:pX - boueeClip.pX, y:pY - boueeClip.pY};
dCarre = (diffBouees.x * diffBouees.x) + (diffBouees.y * diffBouees.y);
if (dCarre < 1600) {
memoX = pX;
memoY = pY;
dPasCarre = Math.sqrt(dCarre);
pX = boueeClip.pX + ((diffBouees.x * 41) / dPasCarre);
pY = boueeClip.pY + ((diffBouees.y * 41) / dPasCarre);
_x = pX;
_y = pY;
_root.bouees.boueesChocs(num);
remous();
}
}
function getForce() {
tmpP = {x:0, y:0};
localToGlobal(tmpP);
hit = _root.voitureverte.bump.hitTest(tmpP.x, tmpP.y, true);
if (hit) {
versCentre = {x:_root.voitureverte._x - tmpP.x, y:_root.voitureverte._y - tmpP.y};
verCentrePol = _root.voitureverte.getPolaire(versCentre);
nRec = 7;
tR = 5;
angleBas = 0;
angleHaut = Math.PI;
i = 0;
while (i < nRec) {
tmpAngle = (angleBas + angleHaut) / 2;
pTest = {x:tmpP.x + (tR * Math.cos(verCentrePol.a + tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a + tmpAngle))};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
angleBas = tmpAngle;
} else {
angleHaut = tmpAngle;
}
i++;
}
tmpAngle = (angleBas + angleHaut) / 2;
pGauche = {x:tmpP.x + (tR * Math.cos(verCentrePol.a + tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a + tmpAngle))};
angleBas = 0;
angleHaut = Math.PI;
i = 0;
while (i < nRec) {
tmpAngle = (angleBas + angleHaut) / 2;
pTest = {x:tmpP.x + (tR * Math.cos(verCentrePol.a - tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a - tmpAngle))};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
angleBas = tmpAngle;
} else {
angleHaut = tmpAngle;
}
i++;
}
tmpAngle = (angleBas + angleHaut) / 2;
pDroite = {x:tmpP.x + (tR * Math.cos(verCentrePol.a - tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a - tmpAngle))};
vTan = {x:pDroite.x - pGauche.x, y:pDroite.y - pGauche.y};
dTan = Math.sqrt((vTan.x * vTan.x) + (vTan.y * vTan.y));
vOrtho = {x:vTan.y / dTan, y:(-vTan.x) / dTan};
up = 100;
down = 0;
hit = true;
i = 0;
while ((i < nRec) || (hit == true)) {
tmpUpDown = (up + down) / 2;
pTest = {x:tmpP.x + (tmpUpDown * vOrtho.x), y:tmpP.y + (tmpUpDown * vOrtho.y)};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
hit = true;
down = tmpUpDown;
} else {
hit = false;
up = tmpUpDown;
}
i++;
}
memoX = pX;
memoY = pY;
pX = pTest.x;
pY = pTest.y;
_x = pX;
_y = pY;
_root.bouees.boueesChocs(num);
remous();
versInit = {x:xInit - pX, y:yInit - pY};
versInitDCarre = (1 + (versInit.x * versInit.x)) + (versInit.y * versInit.y);
return({x:pX, y:pY, d:verCentrePol.d, a:verCentrePol.a, vX:versInit.x, vY:versInit.y, xOrtho:-vOrtho.x, yOrtho:-vOrtho.y, dCarre:versInitDCarre});
}
return(0);
}
function remous() {
_root.remousbouees["rb" + num]._x = _x;
_root.remousbouees["rb" + num]._y = _y;
_root.tracespneu.createEmptyMovieClip("remous" + num, 2 + num);
remousClip = _root.tracespneu["remous" + num];
if ((Math.abs(pX - memoX) > 2) || (Math.abs(pY - memoY) > 2)) {
remousClip.lineStyle(35, 16777215, 90);
remousClip.moveTo(memoX, memoY);
remousClip.lineTo(pX, pY);
}
}
xInit = _x;
yInit = _y;
init();
num = 4;
}
onClipEvent (enterFrame) {
inertie = {x:pX - memoX, y:pY - memoY};
versInit = {x:xInit - pX, y:yInit - pY};
memoX = pX;
memoY = pY;
pX = pX + ((versInit.x * 0.1) + (inertie.x * 0.1));
pY = pY + ((versInit.y * 0.1) + (inertie.y * 0.1));
_x = pX;
_y = pY;
remous();
if ((Math.abs(pX - memoX) > 2) || (Math.abs(pY - memoY) > 2)) {
_root.bouees.boueesChocs(num);
}
frame++;
}
Instance of Symbol 59 MovieClip "bouee5" in Symbol 60 MovieClip Frame 1
onClipEvent (load) {
function setIndice(pI) {
num = pI;
}
function init() {
_x = xInit;
_y = yInit;
pX = _x;
pY = _y;
memoX = _x;
memoY = _y;
frame = 0;
}
function pushed(boueeClip) {
diffBouees = {x:pX - boueeClip.pX, y:pY - boueeClip.pY};
dCarre = (diffBouees.x * diffBouees.x) + (diffBouees.y * diffBouees.y);
if (dCarre < 1600) {
memoX = pX;
memoY = pY;
dPasCarre = Math.sqrt(dCarre);
pX = boueeClip.pX + ((diffBouees.x * 41) / dPasCarre);
pY = boueeClip.pY + ((diffBouees.y * 41) / dPasCarre);
_x = pX;
_y = pY;
_root.bouees.boueesChocs(num);
remous();
}
}
function getForce() {
tmpP = {x:0, y:0};
localToGlobal(tmpP);
hit = _root.voitureverte.bump.hitTest(tmpP.x, tmpP.y, true);
if (hit) {
versCentre = {x:_root.voitureverte._x - tmpP.x, y:_root.voitureverte._y - tmpP.y};
verCentrePol = _root.voitureverte.getPolaire(versCentre);
nRec = 7;
tR = 5;
angleBas = 0;
angleHaut = Math.PI;
i = 0;
while (i < nRec) {
tmpAngle = (angleBas + angleHaut) / 2;
pTest = {x:tmpP.x + (tR * Math.cos(verCentrePol.a + tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a + tmpAngle))};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
angleBas = tmpAngle;
} else {
angleHaut = tmpAngle;
}
i++;
}
tmpAngle = (angleBas + angleHaut) / 2;
pGauche = {x:tmpP.x + (tR * Math.cos(verCentrePol.a + tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a + tmpAngle))};
angleBas = 0;
angleHaut = Math.PI;
i = 0;
while (i < nRec) {
tmpAngle = (angleBas + angleHaut) / 2;
pTest = {x:tmpP.x + (tR * Math.cos(verCentrePol.a - tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a - tmpAngle))};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
angleBas = tmpAngle;
} else {
angleHaut = tmpAngle;
}
i++;
}
tmpAngle = (angleBas + angleHaut) / 2;
pDroite = {x:tmpP.x + (tR * Math.cos(verCentrePol.a - tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a - tmpAngle))};
vTan = {x:pDroite.x - pGauche.x, y:pDroite.y - pGauche.y};
dTan = Math.sqrt((vTan.x * vTan.x) + (vTan.y * vTan.y));
vOrtho = {x:vTan.y / dTan, y:(-vTan.x) / dTan};
up = 100;
down = 0;
hit = true;
i = 0;
while ((i < nRec) || (hit == true)) {
tmpUpDown = (up + down) / 2;
pTest = {x:tmpP.x + (tmpUpDown * vOrtho.x), y:tmpP.y + (tmpUpDown * vOrtho.y)};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
hit = true;
down = tmpUpDown;
} else {
hit = false;
up = tmpUpDown;
}
i++;
}
memoX = pX;
memoY = pY;
pX = pTest.x;
pY = pTest.y;
_x = pX;
_y = pY;
_root.bouees.boueesChocs(num);
remous();
versInit = {x:xInit - pX, y:yInit - pY};
versInitDCarre = (1 + (versInit.x * versInit.x)) + (versInit.y * versInit.y);
return({x:pX, y:pY, d:verCentrePol.d, a:verCentrePol.a, vX:versInit.x, vY:versInit.y, xOrtho:-vOrtho.x, yOrtho:-vOrtho.y, dCarre:versInitDCarre});
}
return(0);
}
function remous() {
_root.remousbouees["rb" + num]._x = _x;
_root.remousbouees["rb" + num]._y = _y;
_root.tracespneu.createEmptyMovieClip("remous" + num, 2 + num);
remousClip = _root.tracespneu["remous" + num];
if ((Math.abs(pX - memoX) > 2) || (Math.abs(pY - memoY) > 2)) {
remousClip.lineStyle(35, 16777215, 90);
remousClip.moveTo(memoX, memoY);
remousClip.lineTo(pX, pY);
}
}
xInit = _x;
yInit = _y;
init();
num = 5;
}
onClipEvent (enterFrame) {
inertie = {x:pX - memoX, y:pY - memoY};
versInit = {x:xInit - pX, y:yInit - pY};
memoX = pX;
memoY = pY;
pX = pX + ((versInit.x * 0.1) + (inertie.x * 0.1));
pY = pY + ((versInit.y * 0.1) + (inertie.y * 0.1));
_x = pX;
_y = pY;
remous();
if ((Math.abs(pX - memoX) > 2) || (Math.abs(pY - memoY) > 2)) {
_root.bouees.boueesChocs(num);
}
frame++;
}
Instance of Symbol 59 MovieClip "bouee0" in Symbol 60 MovieClip Frame 1
onClipEvent (load) {
function setIndice(pI) {
num = pI;
}
function init() {
_x = xInit;
_y = yInit;
pX = _x;
pY = _y;
memoX = _x;
memoY = _y;
frame = 0;
}
function pushed(boueeClip) {
diffBouees = {x:pX - boueeClip.pX, y:pY - boueeClip.pY};
dCarre = (diffBouees.x * diffBouees.x) + (diffBouees.y * diffBouees.y);
if (dCarre < 1600) {
memoX = pX;
memoY = pY;
dPasCarre = Math.sqrt(dCarre);
pX = boueeClip.pX + ((diffBouees.x * 41) / dPasCarre);
pY = boueeClip.pY + ((diffBouees.y * 41) / dPasCarre);
_x = pX;
_y = pY;
_root.bouees.boueesChocs(num);
remous();
}
}
function getForce() {
tmpP = {x:0, y:0};
localToGlobal(tmpP);
hit = _root.voitureverte.bump.hitTest(tmpP.x, tmpP.y, true);
if (hit) {
versCentre = {x:_root.voitureverte._x - tmpP.x, y:_root.voitureverte._y - tmpP.y};
verCentrePol = _root.voitureverte.getPolaire(versCentre);
nRec = 7;
tR = 5;
angleBas = 0;
angleHaut = Math.PI;
i = 0;
while (i < nRec) {
tmpAngle = (angleBas + angleHaut) / 2;
pTest = {x:tmpP.x + (tR * Math.cos(verCentrePol.a + tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a + tmpAngle))};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
angleBas = tmpAngle;
} else {
angleHaut = tmpAngle;
}
i++;
}
tmpAngle = (angleBas + angleHaut) / 2;
pGauche = {x:tmpP.x + (tR * Math.cos(verCentrePol.a + tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a + tmpAngle))};
angleBas = 0;
angleHaut = Math.PI;
i = 0;
while (i < nRec) {
tmpAngle = (angleBas + angleHaut) / 2;
pTest = {x:tmpP.x + (tR * Math.cos(verCentrePol.a - tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a - tmpAngle))};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
angleBas = tmpAngle;
} else {
angleHaut = tmpAngle;
}
i++;
}
tmpAngle = (angleBas + angleHaut) / 2;
pDroite = {x:tmpP.x + (tR * Math.cos(verCentrePol.a - tmpAngle)), y:tmpP.y + (tR * Math.sin(verCentrePol.a - tmpAngle))};
vTan = {x:pDroite.x - pGauche.x, y:pDroite.y - pGauche.y};
dTan = Math.sqrt((vTan.x * vTan.x) + (vTan.y * vTan.y));
vOrtho = {x:vTan.y / dTan, y:(-vTan.x) / dTan};
up = 100;
down = 0;
hit = true;
i = 0;
while ((i < nRec) || (hit == true)) {
tmpUpDown = (up + down) / 2;
pTest = {x:tmpP.x + (tmpUpDown * vOrtho.x), y:tmpP.y + (tmpUpDown * vOrtho.y)};
if (_root.voitureverte.bump.hitTest(pTest.x, pTest.y, true)) {
hit = true;
down = tmpUpDown;
} else {
hit = false;
up = tmpUpDown;
}
i++;
}
memoX = pX;
memoY = pY;
pX = pTest.x;
pY = pTest.y;
_x = pX;
_y = pY;
_root.bouees.boueesChocs(num);
remous();
versInit = {x:xInit - pX, y:yInit - pY};
versInitDCarre = (1 + (versInit.x * versInit.x)) + (versInit.y * versInit.y);
return({x:pX, y:pY, d:verCentrePol.d, a:verCentrePol.a, vX:versInit.x, vY:versInit.y, xOrtho:-vOrtho.x, yOrtho:-vOrtho.y, dCarre:versInitDCarre});
}
return(0);
}
function remous() {
_root.remousbouees["rb" + num]._x = _x;
_root.remousbouees["rb" + num]._y = _y;
_root.tracespneu.createEmptyMovieClip("remous" + num, 2 + num);
remousClip = _root.tracespneu["remous" + num];
if ((Math.abs(pX - memoX) > 2) || (Math.abs(pY - memoY) > 2)) {
remousClip.lineStyle(35, 16777215, 90);
remousClip.moveTo(memoX, memoY);
remousClip.lineTo(pX, pY);
}
}
xInit = _x;
yInit = _y;
init();
num = 0;
}
onClipEvent (enterFrame) {
inertie = {x:pX - memoX, y:pY - memoY};
versInit = {x:xInit - pX, y:yInit - pY};
memoX = pX;
memoY = pY;
pX = pX + ((versInit.x * 0.1) + (inertie.x * 0.1));
pY = pY + ((versInit.y * 0.1) + (inertie.y * 0.1));
_x = pX;
_y = pY;
remous();
if ((Math.abs(pX - memoX) > 2) || (Math.abs(pY - memoY) > 2)) {
_root.bouees.boueesChocs(num);
}
frame++;
}
Symbol 81 MovieClip Frame 15
stop();
var seschocs = _root.voitureverte.chocs;
var sonscore = Math.ceil(_root.voitureverte.score * 100);
var sontemps = _root.elapsedTime;
chocs.text = "";
score.text = "score : " + (sonscore / 100);
var position = -1;
var total = -1;
var parcoursenr = 0;
enregistrer.onPress = function () {
_root.showButtons(false);
gotoAndPlay (16);
myVar = new LoadVars();
myVar.seschocs = seschocs;
myVar.sonscore = sonscore;
myVar.sontemps = sontemps;
myVar.sonnom = sonnom;
myVar.sonsite = sonsite;
myVar.fc = _root.voitureverte.forceChocs;
myVar.position = -1;
myVar.total = -1;
myVar.sendAndLoad("lovboat.php", myVar, "POST");
myVar.onLoad = function () {
position = this.position;
total = this.total;
if (this.askparcours == 1) {
_root.message.messagetext = "Enregistrement\ndu parcours";
_root.message.gotoAndPlay(2);
myParcours = new LoadVars();
myParcours.sonnom = sonnom;
myParcours.sonscore = sonscore;
myParcours.parcours = "1.01_";
tmpA = new Array();
i = 0;
while (i < _root.voitureverte.replayRecEventsIndex) {
tmpA[i] = {clef:(_root.voitureverte.replayEvents[i].updown + "_") + _root.getAlphaNum(_root.voitureverte.replayEvents[i].keycode), framenb:_root.voitureverte.replayEvents[i].framenb};
i++;
}
tmpA.sortOn(["clef", "framenb"], Array.NUMERIC);
theCurrentKey = "";
i = 0;
while (i < _root.voitureverte.replayRecEventsIndex) {
key = tmpA[i].clef;
if (key != theCurrentKey) {
if (theCurrentKey != "") {
myParcours.parcours = myParcours.parcours + "!";
}
theCurrentKey = key;
myParcours.parcours = myParcours.parcours + ((theCurrentKey + "_") + _root.getAlphaNum(tmpA[i].framenb));
} else {
myParcours.parcours = myParcours.parcours + ("_" + _root.getAlphaNum(tmpA[i].framenb - tmpA[i - 1].framenb));
}
i++;
}
tmpA = new Array();
myParcours.sendAndLoad("lovboat.php", myParcours, "POST");
myParcours.onLoad = function () {
parcoursenr = this.parcoursenr;
_root.replayos.gotoAndPlay(2);
_root.showButtons(true);
};
} else {
_root.replayos.gotoAndPlay(2);
_root.showButtons(true);
}
};
};
Symbol 81 MovieClip Frame 30
_visible = false;
stop();
Symbol 89 MovieClip Frame 1
_visible = false;
stop();
Symbol 89 MovieClip Frame 2
_visible = true;
Symbol 89 MovieClip Frame 15
stop();
classement.text = "";
if ((_root.gagnos.position > 0) && (_root.gagnos.total > 0)) {
if (_root.gagnos.position == 1) {
eme = "er";
} else {
eme = "\u00E8me";
}
classement.text = (((_root.gagnos.position + "") + eme) + " sur ") + _root.gagnos.total;
}
goreplay.onPress = function () {
gotoAndPlay (16);
_root.voitureverte.startReplayPlay();
};
Symbol 89 MovieClip Frame 30
_visible = false;
stop();
Symbol 92 MovieClip Frame 1
onRollOut = function () {
_root.menuder.gotoAndPlay(1);
};
onRollOver = function () {
_root.menuder.gotoAndPlay(2);
};
onPress = function () {
_root.menuder.gotoAndPlay(8);
};
Symbol 109 MovieClip Frame 15
gotoAndPlay (1);
Symbol 123 MovieClip Frame 1
stop();
Symbol 123 MovieClip Frame 4
gotoAndPlay (2);
Symbol 126 MovieClip Frame 1
stop();
Symbol 126 MovieClip Frame 4
gotoAndPlay (2);
Symbol 129 MovieClip Frame 1
stop();
onRollOut = function () {
gotoAndPlay (1);
};
onRollOver = function () {
gotoAndPlay (2);
};
onPress = function () {
_root.menuder.theparcours.loadModelAndPlay(theindice);
stop();
};
coupcoeur.gotoAndPlay(1);
coupcoeur._visible = thecoeur;
nouv.gotoAndPlay(1);
nouv._visible = thenouv;
parcourstexte.text = thetext;
Symbol 129 MovieClip Frame 2
onRollOut = function () {
gotoAndPlay (1);
};
onRollOver = function () {
};
onPress = function () {
_root.menuder.theparcours.loadModelAndPlay(theindice);
stop();
};
coupcoeur.gotoAndPlay(2);
coupcoeur._visible = thecoeur;
nouv.gotoAndPlay(2);
nouv._visible = thenouv;
parcourstexte.text = thetext;
Symbol 129 MovieClip Frame 7
stop();
onPress = function () {
_root.menuder.theparcours.loadModelAndPlay(theindice);
stop();
};
coupcoeur._visible = thecoeur;
nouv._visible = thenouv;
parcourstexte.text = thetext;
Instance of Symbol 129 MovieClip "themodel1" in Symbol 130 MovieClip Frame 1
onClipEvent (load) {
var thetext;
var theindice;
var thecoeur;
var thenouv;
}
Instance of Symbol 129 MovieClip "themodel2" in Symbol 130 MovieClip Frame 1
onClipEvent (load) {
var thetext;
var theindice;
}
Instance of Symbol 129 MovieClip "themodel10" in Symbol 130 MovieClip Frame 1
onClipEvent (load) {
var thetext;
var theindice;
}
Instance of Symbol 129 MovieClip "themodel9" in Symbol 130 MovieClip Frame 1
onClipEvent (load) {
var thetext;
var theindice;
}
Instance of Symbol 129 MovieClip "themodel8" in Symbol 130 MovieClip Frame 1
onClipEvent (load) {
var thetext;
var theindice;
}
Instance of Symbol 129 MovieClip "themodel7" in Symbol 130 MovieClip Frame 1
onClipEvent (load) {
var thetext;
var theindice;
}
Instance of Symbol 129 MovieClip "themodel6" in Symbol 130 MovieClip Frame 1
onClipEvent (load) {
var thetext;
var theindice;
}
Instance of Symbol 129 MovieClip "themodel5" in Symbol 130 MovieClip Frame 1
onClipEvent (load) {
var thetext;
var theindice;
}
Instance of Symbol 129 MovieClip "themodel4" in Symbol 130 MovieClip Frame 1
onClipEvent (load) {
var thetext;
var theindice;
}
Instance of Symbol 129 MovieClip "themodel3" in Symbol 130 MovieClip Frame 1
onClipEvent (load) {
var thetext;
var theindice;
}
Symbol 132 MovieClip Frame 1
initDone = false;
openDone = false;
index = 0;
parcoursArray = new Array();
stop();
Symbol 132 MovieClip Frame 2
initDone = false;
openDone = false;
Symbol 132 MovieClip Frame 7
gotoAndPlay (2);
Symbol 132 MovieClip Frame 8
_root.showButtons(false);
_root.chrono._visible = false;
_root.replayos._alpha = 30;
_root.gagnos.position = 0;
_root.gagnos.total = 0;
_root.aidetimestart = -1;
initDone = false;
openDone = false;
parcoursArray = new Array();
index = 0;
demandeParcours = new LoadVars();
demandeParcours.action = "allparcours";
demandeParcours.sendAndLoad("plovboat.php", demandeParcours, "POST");
demandeParcours.onLoad = function () {
occurence = -1;
while (occurence != -2) {
occurence1 = this.allparcours.indexOf("_", occurence);
occurence2 = this.allparcours.indexOf("_", occurence1 + 1);
score = this.allparcours.substring(occurence, occurence1);
if (occurence2 == -1) {
nom = this.allparcours.substring(occurence1 + 1);
occurence = -2;
} else if (occurence2 == undefined) {
nom = "Echec";
score = "0";
occurence = -2;
} else {
nom = this.allparcours.substring(occurence1 + 1, occurence2);
occurence = occurence2 + 1;
}
if (score.substring(0, 1) == "#") {
score = score.substring(1);
coeur = true;
} else {
coeur = false;
}
if (score.substring(0, 1) == "N") {
score = score.substring(1);
nouv = true;
} else {
nouv = false;
}
parcoursArray[index] = new Array(nom, score, coeur, nouv);
index = index + 1;
}
initDone = true;
};
Symbol 132 MovieClip Frame 44
openDone = true;
closemenu.onPress = function () {
gotoAndPlay (45);
};
stop();
Instance of Symbol 130 MovieClip "theparcours" in Symbol 132 MovieClip Frame 44
onClipEvent (load) {
function models() {
if (!loadingparcours) {
indFirst = Math.round((-yFirst) / 30);
decal = (-yFirst) - (indFirst * 30);
max = 10;
if (objectNumber < 10) {
max = objectNumber;
}
i = 0;
while (i < max) {
objet = this["themodel" + (i + 1)];
objet._visible = true;
objet.theindice = indFirst + i;
objet.thetext = objectList[objet.theindice];
objet.thecoeur = _root.menuder.parcoursArray[objet.theindice][2];
objet.coupcoeur._visible = objet.thecoeur;
objet.thenouv = _root.menuder.parcoursArray[objet.theindice][3];
objet.nouv._visible = objet.thenouv;
objet.parcourstexte.text = objet.thetext;
objet._y = (30 * i) - decal;
i++;
}
i = max + 1;
while (i < 10) {
objet = this["themodel" + (i + 1)];
objet._visible = false;
i++;
}
}
}
function loadModelAndPlay(ind) {
loadingparcours = true;
_root.menuder.closemenu._visible = false;
i = 0;
while (i < 10) {
objet = this["themodel" + (i + 1)];
objet._visible = false;
i++;
}
_root.loadModelAndPlay(_root.menuder.parcoursArray[ind][0], _root.menuder.parcoursArray[ind][1]);
}
loadingparcours = false;
initDone = false;
objectList = new Array();
objectNumber = 0;
incy = 0;
yFirst = 0;
listeHeight = 0;
closemenu._visible = true;
i = 0;
while (i < 10) {
objet = this["themodel" + (i + 1)];
objet._visible = false;
i++;
}
}
onClipEvent (unload) {
}
onClipEvent (enterFrame) {
if (initDone == false) {
if (_root.menuder.initDone && (_root.menuder.openDone)) {
initDone = true;
titre.text = "Liste des parcours";
objectNumber = _root.menuder.index;
listeHeight = (objectNumber + 1) * 30;
i = 0;
while (i < objectNumber) {
scoretmp = _root.menuder.parcoursArray[i][1] / 100;
nomtmp = _root.menuder.parcoursArray[i][0];
objectList[i] = (nomtmp + " ") + scoretmp;
i++;
}
} else {
titre.text = "Chargement...";
}
} else {
if (objectNumber > 9) {
if ((_ymouse - 150) > 0) {
incy = (-(_ymouse - 150)) / 5;
} else if ((_ymouse - 120) < 0) {
incy = (-(_ymouse - 120)) / 5;
} else {
incy = 0;
}
} else {
incy = 0;
}
if (incy > 100) {
incy = 100;
} else if (incy < -100) {
incy = -100;
}
oldYFirst = yFirst;
yFirst = yFirst + incy;
if (yFirst >= 0) {
yFirst = 0;
} else if ((yFirst + listeHeight) < 300) {
yFirst = 300 - listeHeight;
}
models();
}
}
Symbol 132 MovieClip Frame 45
_root.replayos._alpha = 100;
Symbol 132 MovieClip Frame 60
initDone = false;
_root.showButtons(true);
_root.chrono._visible = true;
gotoAndPlay (1);
Symbol 135 MovieClip Frame 15
stop();
Symbol 138 MovieClip Frame 40
gotoAndPlay (1);
Symbol 145 MovieClip Frame 1
stop();
Symbol 145 MovieClip Frame 10
msg.text = messagetext;
Symbol 145 MovieClip Frame 41
msg.text = messagetext;
Symbol 149 MovieClip Frame 1
stop();
onRollOut = function () {
gotoAndPlay (1);
};
onRollOver = function () {
gotoAndPlay (2);
};
Symbol 149 MovieClip Frame 5
gotoAndPlay (2);
Symbol 154 MovieClip Frame 1
stop();
onRollOut = function () {
gotoAndPlay (1);
};
onRollOver = function () {
gotoAndPlay (2);
};
Symbol 154 MovieClip Frame 5
gotoAndPlay (2);
Symbol 158 MovieClip Frame 1
stop();
onRollOut = function () {
gotoAndPlay (1);
};
onRollOver = function () {
gotoAndPlay (2);
};
Symbol 158 MovieClip Frame 5
gotoAndPlay (2);
Symbol 166 MovieClip Frame 1
stop();
Symbol 166 MovieClip Frame 2
stop();
Symbol 166 MovieClip Frame 3
stop();