gdjs.JeuCode = {};
gdjs.JeuCode.forEachIndex2 = 0;

gdjs.JeuCode.forEachObjects2 = [];

gdjs.JeuCode.forEachTemporary2 = null;

gdjs.JeuCode.forEachTotalCount2 = 0;

gdjs.JeuCode.repeatCount3 = 0;

gdjs.JeuCode.repeatIndex3 = 0;



gdjs.JeuCode.GDAimantObjects1= [];
gdjs.JeuCode.GDAimantObjects2= [];
gdjs.JeuCode.GDAimantObjects3= [];
gdjs.JeuCode.GDWallpaperObjects1= [];
gdjs.JeuCode.GDWallpaperObjects2= [];
gdjs.JeuCode.GDWallpaperObjects3= [];
gdjs.JeuCode.GDBalleObjects1= [];
gdjs.JeuCode.GDBalleObjects2= [];
gdjs.JeuCode.GDBalleObjects3= [];
gdjs.JeuCode.GDOmbreBalleObjects1= [];
gdjs.JeuCode.GDOmbreBalleObjects2= [];
gdjs.JeuCode.GDOmbreBalleObjects3= [];
gdjs.JeuCode.GDTrouObjects1= [];
gdjs.JeuCode.GDTrouObjects2= [];
gdjs.JeuCode.GDTrouObjects3= [];
gdjs.JeuCode.GDMenuObjects1= [];
gdjs.JeuCode.GDMenuObjects2= [];
gdjs.JeuCode.GDMenuObjects3= [];
gdjs.JeuCode.GDGradientForLoosingObjects1= [];
gdjs.JeuCode.GDGradientForLoosingObjects2= [];
gdjs.JeuCode.GDGradientForLoosingObjects3= [];
gdjs.JeuCode.GDDeafeatObjects1= [];
gdjs.JeuCode.GDDeafeatObjects2= [];
gdjs.JeuCode.GDDeafeatObjects3= [];
gdjs.JeuCode.GDVictoryObjects1= [];
gdjs.JeuCode.GDVictoryObjects2= [];
gdjs.JeuCode.GDVictoryObjects3= [];
gdjs.JeuCode.GDToolbarObjects1= [];
gdjs.JeuCode.GDToolbarObjects2= [];
gdjs.JeuCode.GDToolbarObjects3= [];
gdjs.JeuCode.GDRetryObjects1= [];
gdjs.JeuCode.GDRetryObjects2= [];
gdjs.JeuCode.GDRetryObjects3= [];
gdjs.JeuCode.GDDirectionObjects1= [];
gdjs.JeuCode.GDDirectionObjects2= [];
gdjs.JeuCode.GDDirectionObjects3= [];
gdjs.JeuCode.GDTryMoreDifficultObjects1= [];
gdjs.JeuCode.GDTryMoreDifficultObjects2= [];
gdjs.JeuCode.GDTryMoreDifficultObjects3= [];
gdjs.JeuCode.GDUnWritableObjects1= [];
gdjs.JeuCode.GDUnWritableObjects2= [];
gdjs.JeuCode.GDUnWritableObjects3= [];
gdjs.JeuCode.GDBoussoleObjects1= [];
gdjs.JeuCode.GDBoussoleObjects2= [];
gdjs.JeuCode.GDBoussoleObjects3= [];

gdjs.JeuCode.conditionTrue_0 = {val:false};
gdjs.JeuCode.condition0IsTrue_0 = {val:false};
gdjs.JeuCode.condition1IsTrue_0 = {val:false};
gdjs.JeuCode.condition2IsTrue_0 = {val:false};
gdjs.JeuCode.condition3IsTrue_0 = {val:false};
gdjs.JeuCode.condition4IsTrue_0 = {val:false};
gdjs.JeuCode.conditionTrue_1 = {val:false};
gdjs.JeuCode.condition0IsTrue_1 = {val:false};
gdjs.JeuCode.condition1IsTrue_1 = {val:false};
gdjs.JeuCode.condition2IsTrue_1 = {val:false};
gdjs.JeuCode.condition3IsTrue_1 = {val:false};
gdjs.JeuCode.condition4IsTrue_1 = {val:false};

gdjs.JeuCode.func = function(runtimeScene, context) {
context.startNewFrame();
gdjs.JeuCode.GDAimantObjects1.length = 0;
gdjs.JeuCode.GDAimantObjects2.length = 0;
gdjs.JeuCode.GDAimantObjects3.length = 0;
gdjs.JeuCode.GDWallpaperObjects1.length = 0;
gdjs.JeuCode.GDWallpaperObjects2.length = 0;
gdjs.JeuCode.GDWallpaperObjects3.length = 0;
gdjs.JeuCode.GDBalleObjects1.length = 0;
gdjs.JeuCode.GDBalleObjects2.length = 0;
gdjs.JeuCode.GDBalleObjects3.length = 0;
gdjs.JeuCode.GDOmbreBalleObjects1.length = 0;
gdjs.JeuCode.GDOmbreBalleObjects2.length = 0;
gdjs.JeuCode.GDOmbreBalleObjects3.length = 0;
gdjs.JeuCode.GDTrouObjects1.length = 0;
gdjs.JeuCode.GDTrouObjects2.length = 0;
gdjs.JeuCode.GDTrouObjects3.length = 0;
gdjs.JeuCode.GDMenuObjects1.length = 0;
gdjs.JeuCode.GDMenuObjects2.length = 0;
gdjs.JeuCode.GDMenuObjects3.length = 0;
gdjs.JeuCode.GDGradientForLoosingObjects1.length = 0;
gdjs.JeuCode.GDGradientForLoosingObjects2.length = 0;
gdjs.JeuCode.GDGradientForLoosingObjects3.length = 0;
gdjs.JeuCode.GDDeafeatObjects1.length = 0;
gdjs.JeuCode.GDDeafeatObjects2.length = 0;
gdjs.JeuCode.GDDeafeatObjects3.length = 0;
gdjs.JeuCode.GDVictoryObjects1.length = 0;
gdjs.JeuCode.GDVictoryObjects2.length = 0;
gdjs.JeuCode.GDVictoryObjects3.length = 0;
gdjs.JeuCode.GDToolbarObjects1.length = 0;
gdjs.JeuCode.GDToolbarObjects2.length = 0;
gdjs.JeuCode.GDToolbarObjects3.length = 0;
gdjs.JeuCode.GDRetryObjects1.length = 0;
gdjs.JeuCode.GDRetryObjects2.length = 0;
gdjs.JeuCode.GDRetryObjects3.length = 0;
gdjs.JeuCode.GDDirectionObjects1.length = 0;
gdjs.JeuCode.GDDirectionObjects2.length = 0;
gdjs.JeuCode.GDDirectionObjects3.length = 0;
gdjs.JeuCode.GDTryMoreDifficultObjects1.length = 0;
gdjs.JeuCode.GDTryMoreDifficultObjects2.length = 0;
gdjs.JeuCode.GDTryMoreDifficultObjects3.length = 0;
gdjs.JeuCode.GDUnWritableObjects1.length = 0;
gdjs.JeuCode.GDUnWritableObjects2.length = 0;
gdjs.JeuCode.GDUnWritableObjects3.length = 0;
gdjs.JeuCode.GDBoussoleObjects1.length = 0;
gdjs.JeuCode.GDBoussoleObjects2.length = 0;
gdjs.JeuCode.GDBoussoleObjects3.length = 0;


{

gdjs.JeuCode.GDOmbreBalleObjects1.createFrom(runtimeScene.getObjects("OmbreBalle"));
gdjs.JeuCode.GDUnWritableObjects1.createFrom(runtimeScene.getObjects("UnWritable"));

gdjs.JeuCode.condition0IsTrue_0.val = false;
{
gdjs.JeuCode.condition0IsTrue_0.val = gdjs.evtTools.runtimeScene.sceneJustBegins(runtimeScene);
}if (gdjs.JeuCode.condition0IsTrue_0.val) {
{gdjs.evtTools.camera.hideLayer(runtimeScene, "Gagné");
}{gdjs.evtTools.camera.hideLayer(runtimeScene, "Perdu");
}{for(var i = 0, len = gdjs.JeuCode.GDUnWritableObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDUnWritableObjects1[i].hide();
}
for(var i = 0, len = gdjs.JeuCode.GDOmbreBalleObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDOmbreBalleObjects1[i].hide();
}
}}

}


{



}


{

gdjs.JeuCode.GDOmbreBalleObjects1.createFrom(runtimeScene.getObjects("OmbreBalle"));

gdjs.JeuCode.condition0IsTrue_0.val = false;
{
for(var i = 0, k = 0, l = gdjs.JeuCode.GDOmbreBalleObjects1.length;i<l;++i) {
    if ( gdjs.JeuCode.GDOmbreBalleObjects1[i].getX() > 1200 ) {
        gdjs.JeuCode.condition0IsTrue_0.val = true;
        gdjs.JeuCode.GDOmbreBalleObjects1[k] = gdjs.JeuCode.GDOmbreBalleObjects1[i];
        ++k;
    }
}
gdjs.JeuCode.GDOmbreBalleObjects1.length = k;}if (gdjs.JeuCode.condition0IsTrue_0.val) {
{for(var i = 0, len = gdjs.JeuCode.GDOmbreBalleObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDOmbreBalleObjects1[i].setX(-1100);
}
}}

}


{

gdjs.JeuCode.GDOmbreBalleObjects1.createFrom(runtimeScene.getObjects("OmbreBalle"));

gdjs.JeuCode.condition0IsTrue_0.val = false;
{
for(var i = 0, k = 0, l = gdjs.JeuCode.GDOmbreBalleObjects1.length;i<l;++i) {
    if ( gdjs.JeuCode.GDOmbreBalleObjects1[i].getX() < -1200 ) {
        gdjs.JeuCode.condition0IsTrue_0.val = true;
        gdjs.JeuCode.GDOmbreBalleObjects1[k] = gdjs.JeuCode.GDOmbreBalleObjects1[i];
        ++k;
    }
}
gdjs.JeuCode.GDOmbreBalleObjects1.length = k;}if (gdjs.JeuCode.condition0IsTrue_0.val) {
{for(var i = 0, len = gdjs.JeuCode.GDOmbreBalleObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDOmbreBalleObjects1[i].setX(1100);
}
}}

}


{

gdjs.JeuCode.GDOmbreBalleObjects1.createFrom(runtimeScene.getObjects("OmbreBalle"));

gdjs.JeuCode.condition0IsTrue_0.val = false;
{
for(var i = 0, k = 0, l = gdjs.JeuCode.GDOmbreBalleObjects1.length;i<l;++i) {
    if ( gdjs.JeuCode.GDOmbreBalleObjects1[i].getY() > 1200 ) {
        gdjs.JeuCode.condition0IsTrue_0.val = true;
        gdjs.JeuCode.GDOmbreBalleObjects1[k] = gdjs.JeuCode.GDOmbreBalleObjects1[i];
        ++k;
    }
}
gdjs.JeuCode.GDOmbreBalleObjects1.length = k;}if (gdjs.JeuCode.condition0IsTrue_0.val) {
{for(var i = 0, len = gdjs.JeuCode.GDOmbreBalleObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDOmbreBalleObjects1[i].setY(-1100);
}
}}

}


{

gdjs.JeuCode.GDOmbreBalleObjects1.createFrom(runtimeScene.getObjects("OmbreBalle"));

gdjs.JeuCode.condition0IsTrue_0.val = false;
{
for(var i = 0, k = 0, l = gdjs.JeuCode.GDOmbreBalleObjects1.length;i<l;++i) {
    if ( gdjs.JeuCode.GDOmbreBalleObjects1[i].getY() < -1200 ) {
        gdjs.JeuCode.condition0IsTrue_0.val = true;
        gdjs.JeuCode.GDOmbreBalleObjects1[k] = gdjs.JeuCode.GDOmbreBalleObjects1[i];
        ++k;
    }
}
gdjs.JeuCode.GDOmbreBalleObjects1.length = k;}if (gdjs.JeuCode.condition0IsTrue_0.val) {
{for(var i = 0, len = gdjs.JeuCode.GDOmbreBalleObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDOmbreBalleObjects1[i].setY(1100);
}
}}

}


{



}


{



}


{

gdjs.JeuCode.GDTrouObjects1.createFrom(runtimeScene.getObjects("Trou"));

for(gdjs.JeuCode.forEachIndex2 = 0;gdjs.JeuCode.forEachIndex2 < gdjs.JeuCode.GDTrouObjects1.length;++gdjs.JeuCode.forEachIndex2) {
gdjs.JeuCode.GDTrouObjects2.createFrom(gdjs.JeuCode.GDTrouObjects1);
gdjs.JeuCode.GDUnWritableObjects2.createFrom(runtimeScene.getObjects("UnWritable"));

gdjs.JeuCode.forEachTemporary2 = gdjs.JeuCode.GDTrouObjects1[gdjs.JeuCode.forEachIndex2];
gdjs.JeuCode.GDTrouObjects2.length = 0;
gdjs.JeuCode.GDTrouObjects2.push(gdjs.JeuCode.forEachTemporary2);
gdjs.JeuCode.condition0IsTrue_0.val = false;
{
gdjs.JeuCode.condition0IsTrue_0.val = gdjs.evtTools.object.hitBoxesCollisionTest(context.clearEventsObjectsMap().addObjectsToEventsMap("Trou", gdjs.JeuCode.GDTrouObjects2).getEventsObjectsMap(), context.clearEventsObjectsMap().addObjectsToEventsMap("UnWritable", gdjs.JeuCode.GDUnWritableObjects2).getEventsObjectsMap(), false, runtimeScene);
}if (gdjs.JeuCode.condition0IsTrue_0.val) {
{for(var i = 0, len = gdjs.JeuCode.GDTrouObjects2.length ;i < len;++i) {
    gdjs.JeuCode.GDTrouObjects2[i].deleteFromScene(runtimeScene);
}
}}
}

}


{


gdjs.JeuCode.condition0IsTrue_0.val = false;
{
gdjs.JeuCode.condition0IsTrue_0.val = gdjs.evtTools.runtimeScene.sceneJustBegins(runtimeScene);
}if (gdjs.JeuCode.condition0IsTrue_0.val) {
{runtimeScene.getVariables().getFromIndex(0).setNumber(gdjs.random(100));
}
{ //Subevents

{

gdjs.JeuCode.GDAimantObjects2.createFrom(runtimeScene.getObjects("Aimant"));
gdjs.JeuCode.GDBalleObjects2.createFrom(runtimeScene.getObjects("Balle"));
gdjs.JeuCode.GDTrouObjects2.createFrom(runtimeScene.getObjects("Trou"));

gdjs.JeuCode.condition0IsTrue_0.val = false;
{
gdjs.JeuCode.condition0IsTrue_0.val = gdjs.evtTools.object.distanceTest(context.clearEventsObjectsMap().addObjectsToEventsMap("Balle", gdjs.JeuCode.GDBalleObjects2).getEventsObjectsMap(), context.clearEventsObjectsMap().addObjectsToEventsMap("Trou", gdjs.JeuCode.GDTrouObjects2).getEventsObjectsMap(), 0, false);
}if (gdjs.JeuCode.condition0IsTrue_0.val) {
{for(var i = 0, len = gdjs.JeuCode.GDTrouObjects2.length ;i < len;++i) {
    gdjs.JeuCode.GDTrouObjects2[i].addForceTowardObject((gdjs.JeuCode.GDAimantObjects2.length !== 0 ? gdjs.JeuCode.GDAimantObjects2[0] : null), (gdjs.JeuCode.GDTrouObjects2[i].getDistanceFrom(gdjs.JeuCode.GDTrouObjects2[i])), 0);
}
}}

}


{


gdjs.JeuCode.repeatCount3 = gdjs.evtTools.common.getVariableNumber(runtimeScene.getVariables().getFromIndex(0))+20;
for(gdjs.JeuCode.repeatIndex3 = 0;gdjs.JeuCode.repeatIndex3 < gdjs.JeuCode.repeatCount3;++gdjs.JeuCode.repeatIndex3) {
gdjs.JeuCode.GDTrouObjects3.length = 0;

if (true)
{
{runtimeScene.getVariables().getFromIndex(1).setNumber(gdjs.random(2000)-1000);
}{runtimeScene.getVariables().getFromIndex(2).setNumber(gdjs.random(2000)-1000);
}{gdjs.evtTools.object.createObjectOnScene(runtimeScene, context.clearEventsObjectsMap().addObjectsToEventsMap("Trou", gdjs.JeuCode.GDTrouObjects3).getEventsObjectsMap(), gdjs.evtTools.common.getVariableNumber(runtimeScene.getVariables().getFromIndex(1)), gdjs.evtTools.common.getVariableNumber(runtimeScene.getVariables().getFromIndex(2)), "");
}}
}

}

} //End of subevents
}

}


{


gdjs.JeuCode.condition0IsTrue_0.val = false;
{
{gdjs.JeuCode.conditionTrue_1 = gdjs.JeuCode.condition0IsTrue_0;
gdjs.JeuCode.conditionTrue_1.val = context.triggerOnce(399712280);
}
}if (gdjs.JeuCode.condition0IsTrue_0.val) {

{ //Subevents

{

gdjs.JeuCode.GDBalleObjects2.createFrom(runtimeScene.getObjects("Balle"));
gdjs.JeuCode.GDTrouObjects2.createFrom(runtimeScene.getObjects("Trou"));

gdjs.JeuCode.condition0IsTrue_0.val = false;
gdjs.JeuCode.condition1IsTrue_0.val = false;
{
gdjs.JeuCode.condition0IsTrue_0.val = gdjs.evtTools.object.distanceTest(context.clearEventsObjectsMap().addObjectsToEventsMap("Trou", gdjs.JeuCode.GDTrouObjects2).getEventsObjectsMap(), context.clearEventsObjectsMap().addObjectsToEventsMap("Balle", gdjs.JeuCode.GDBalleObjects2).getEventsObjectsMap(), 20*(gdjs.evtTools.common.getVariableNumber(runtimeScene.getGame().getVariables().getFromIndex(0))-1), true);
}if ( gdjs.JeuCode.condition0IsTrue_0.val ) {
{
gdjs.JeuCode.condition1IsTrue_0.val = gdjs.evtTools.object.pickRandomObject(runtimeScene, context.clearEventsObjectsMap().addObjectsToEventsMap("Trou", gdjs.JeuCode.GDTrouObjects2).getEventsObjectsMap());
}}
if (gdjs.JeuCode.condition1IsTrue_0.val) {
{for(var i = 0, len = gdjs.JeuCode.GDTrouObjects2.length ;i < len;++i) {
    gdjs.JeuCode.GDTrouObjects2[i].setAnimation(1);
}
}}

}

} //End of subevents
}

}


{



}


{



}


{

gdjs.JeuCode.GDAimantObjects1.createFrom(runtimeScene.getObjects("Aimant"));
gdjs.JeuCode.GDBalleObjects1.createFrom(runtimeScene.getObjects("Balle"));
gdjs.JeuCode.GDDirectionObjects1.createFrom(runtimeScene.getObjects("Direction"));
gdjs.JeuCode.GDOmbreBalleObjects1.createFrom(runtimeScene.getObjects("OmbreBalle"));

{for(var i = 0, len = gdjs.JeuCode.GDAimantObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDAimantObjects1[i].turnTowardObject((gdjs.JeuCode.GDBalleObjects1.length !== 0 ? gdjs.JeuCode.GDBalleObjects1[0] : null));
}
}{gdjs.evtTools.camera.centerCamera(runtimeScene, (gdjs.JeuCode.GDBalleObjects1.length !== 0 ? gdjs.JeuCode.GDBalleObjects1[0] : null), false, "", 0);
}{for(var i = 0, len = gdjs.JeuCode.GDDirectionObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDDirectionObjects1[i].setPosition((( gdjs.JeuCode.GDBalleObjects1.length === 0 ) ? 0 :gdjs.JeuCode.GDBalleObjects1[0].getPointX("")),(( gdjs.JeuCode.GDBalleObjects1.length === 0 ) ? 0 :gdjs.JeuCode.GDBalleObjects1[0].getPointY("")));
}
}{for(var i = 0, len = gdjs.JeuCode.GDBalleObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDBalleObjects1[i].setPosition((( gdjs.JeuCode.GDOmbreBalleObjects1.length === 0 ) ? 0 :gdjs.JeuCode.GDOmbreBalleObjects1[0].getPointX(""))-9,(( gdjs.JeuCode.GDOmbreBalleObjects1.length === 0 ) ? 0 :gdjs.JeuCode.GDOmbreBalleObjects1[0].getPointY(""))-29);
}
}{for(var i = 0, len = gdjs.JeuCode.GDAimantObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDAimantObjects1[i].setPosition(gdjs.evtTools.input.getMouseX(runtimeScene, "", 0),gdjs.evtTools.input.getMouseY(runtimeScene, "", 0));
}
}
}


{



}


{

gdjs.JeuCode.GDAimantObjects1.createFrom(runtimeScene.getObjects("Aimant"));
gdjs.JeuCode.GDBalleObjects1.createFrom(runtimeScene.getObjects("Balle"));
gdjs.JeuCode.GDOmbreBalleObjects1.createFrom(runtimeScene.getObjects("OmbreBalle"));

gdjs.JeuCode.condition0IsTrue_0.val = false;
{
for(var i = 0, k = 0, l = gdjs.JeuCode.GDBalleObjects1.length;i<l;++i) {
    if ( gdjs.JeuCode.GDBalleObjects1[i].getVariableNumber(gdjs.JeuCode.GDBalleObjects1[i].getVariables().get("Tombe")) == 0 ) {
        gdjs.JeuCode.condition0IsTrue_0.val = true;
        gdjs.JeuCode.GDBalleObjects1[k] = gdjs.JeuCode.GDBalleObjects1[i];
        ++k;
    }
}
gdjs.JeuCode.GDBalleObjects1.length = k;}if (gdjs.JeuCode.condition0IsTrue_0.val) {
{for(var i = 0, len = gdjs.JeuCode.GDOmbreBalleObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDOmbreBalleObjects1[i].addForceTowardObject((gdjs.JeuCode.GDAimantObjects1.length !== 0 ? gdjs.JeuCode.GDAimantObjects1[0] : null), 1/(( gdjs.JeuCode.GDBalleObjects1.length === 0 ) ? 0 :gdjs.JeuCode.GDBalleObjects1[0].getDistanceFrom((gdjs.JeuCode.GDAimantObjects1.length !== 0 ? gdjs.JeuCode.GDAimantObjects1[0] : null)))*400, 0.25);
}
}}

}


{



}


{

gdjs.JeuCode.GDAimantObjects1.createFrom(runtimeScene.getObjects("Aimant"));
gdjs.JeuCode.GDBalleObjects1.createFrom(runtimeScene.getObjects("Balle"));

gdjs.JeuCode.condition0IsTrue_0.val = false;
gdjs.JeuCode.condition1IsTrue_0.val = false;
{
gdjs.JeuCode.condition0IsTrue_0.val = gdjs.evtTools.object.hitBoxesCollisionTest(context.clearEventsObjectsMap().addObjectsToEventsMap("Balle", gdjs.JeuCode.GDBalleObjects1).getEventsObjectsMap(), context.clearEventsObjectsMap().addObjectsToEventsMap("Aimant", gdjs.JeuCode.GDAimantObjects1).getEventsObjectsMap(), false, runtimeScene);
}if ( gdjs.JeuCode.condition0IsTrue_0.val ) {
{
for(var i = 0, k = 0, l = gdjs.JeuCode.GDBalleObjects1.length;i<l;++i) {
    if ( gdjs.JeuCode.GDBalleObjects1[i].getVariableNumber(gdjs.JeuCode.GDBalleObjects1[i].getVariables().get("Tombe")) == 0 ) {
        gdjs.JeuCode.condition1IsTrue_0.val = true;
        gdjs.JeuCode.GDBalleObjects1[k] = gdjs.JeuCode.GDBalleObjects1[i];
        ++k;
    }
}
gdjs.JeuCode.GDBalleObjects1.length = k;}}
if (gdjs.JeuCode.condition1IsTrue_0.val) {
{for(var i = 0, len = gdjs.JeuCode.GDBalleObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDBalleObjects1[i].clearForces();
}
}}

}


{



}


{

gdjs.JeuCode.GDBalleObjects1.createFrom(runtimeScene.getObjects("Balle"));
gdjs.JeuCode.GDBoussoleObjects1.createFrom(runtimeScene.getObjects("Boussole"));
gdjs.JeuCode.GDDirectionObjects1.createFrom(runtimeScene.getObjects("Direction"));
gdjs.JeuCode.GDOmbreBalleObjects1.createFrom(runtimeScene.getObjects("OmbreBalle"));
gdjs.JeuCode.GDTrouObjects1.createFrom(runtimeScene.getObjects("Trou"));

gdjs.JeuCode.condition0IsTrue_0.val = false;
gdjs.JeuCode.condition1IsTrue_0.val = false;
{
gdjs.JeuCode.condition0IsTrue_0.val = gdjs.evtTools.object.hitBoxesCollisionTest(context.clearEventsObjectsMap().addObjectsToEventsMap("OmbreBalle", gdjs.JeuCode.GDOmbreBalleObjects1).getEventsObjectsMap(), context.clearEventsObjectsMap().addObjectsToEventsMap("Trou", gdjs.JeuCode.GDTrouObjects1).getEventsObjectsMap(), false, runtimeScene);
}if ( gdjs.JeuCode.condition0IsTrue_0.val ) {
{
gdjs.JeuCode.condition1IsTrue_0.val = gdjs.evtTools.object.distanceTest(context.clearEventsObjectsMap().addObjectsToEventsMap("Balle", gdjs.JeuCode.GDBalleObjects1).getEventsObjectsMap(), context.clearEventsObjectsMap().addObjectsToEventsMap("Trou", gdjs.JeuCode.GDTrouObjects1).getEventsObjectsMap(), -20, false);
}}
if (gdjs.JeuCode.condition1IsTrue_0.val) {
{for(var i = 0, len = gdjs.JeuCode.GDBalleObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDBalleObjects1[i].setVariableNumber(gdjs.JeuCode.GDBalleObjects1[i].getVariables().get("Tombe"), 1);
}
}{for(var i = 0, len = gdjs.JeuCode.GDOmbreBalleObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDOmbreBalleObjects1[i].addForceTowardObject((gdjs.JeuCode.GDTrouObjects1.length !== 0 ? gdjs.JeuCode.GDTrouObjects1[0] : null), 150, 0);
}
}{for(var i = 0, len = gdjs.JeuCode.GDBoussoleObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDBoussoleObjects1[i].hide();
}
for(var i = 0, len = gdjs.JeuCode.GDDirectionObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDDirectionObjects1[i].hide();
}
}{gdjs.evtTools.runtimeScene.setTimeScale(runtimeScene, 0);
}
{ //Subevents

{

gdjs.JeuCode.GDTrouObjects2.createFrom(gdjs.JeuCode.GDTrouObjects1);

gdjs.JeuCode.condition0IsTrue_0.val = false;
{
for(var i = 0, k = 0, l = gdjs.JeuCode.GDTrouObjects2.length;i<l;++i) {
    if ( gdjs.JeuCode.GDTrouObjects2[i].getAnimation() == 0 ) {
        gdjs.JeuCode.condition0IsTrue_0.val = true;
        gdjs.JeuCode.GDTrouObjects2[k] = gdjs.JeuCode.GDTrouObjects2[i];
        ++k;
    }
}
gdjs.JeuCode.GDTrouObjects2.length = k;}if (gdjs.JeuCode.condition0IsTrue_0.val) {
{gdjs.evtTools.camera.showLayer(runtimeScene, "Perdu");
}}

}


{

gdjs.JeuCode.GDTrouObjects2.createFrom(gdjs.JeuCode.GDTrouObjects1);

gdjs.JeuCode.condition0IsTrue_0.val = false;
{
for(var i = 0, k = 0, l = gdjs.JeuCode.GDTrouObjects2.length;i<l;++i) {
    if ( gdjs.JeuCode.GDTrouObjects2[i].getAnimation() == 1 ) {
        gdjs.JeuCode.condition0IsTrue_0.val = true;
        gdjs.JeuCode.GDTrouObjects2[k] = gdjs.JeuCode.GDTrouObjects2[i];
        ++k;
    }
}
gdjs.JeuCode.GDTrouObjects2.length = k;}if (gdjs.JeuCode.condition0IsTrue_0.val) {
{gdjs.evtTools.camera.showLayer(runtimeScene, "Gagné");
}}

}

} //End of subevents
}

}


{


gdjs.JeuCode.condition0IsTrue_0.val = false;
{
gdjs.JeuCode.condition0IsTrue_0.val = !(gdjs.evtTools.runtimeScene.sceneJustBegins(runtimeScene));
}if (gdjs.JeuCode.condition0IsTrue_0.val) {

{ //Subevents

{

gdjs.JeuCode.GDMenuObjects2.createFrom(runtimeScene.getObjects("Menu"));

gdjs.JeuCode.condition0IsTrue_0.val = false;
gdjs.JeuCode.condition1IsTrue_0.val = false;
gdjs.JeuCode.condition2IsTrue_0.val = false;
{
gdjs.JeuCode.condition0IsTrue_0.val = gdjs.evtTools.input.isMouseButtonPressed(runtimeScene, "Left");
}if ( gdjs.JeuCode.condition0IsTrue_0.val ) {
{
for(var i = 0, k = 0, l = gdjs.JeuCode.GDMenuObjects2.length;i<l;++i) {
    if ( gdjs.JeuCode.GDMenuObjects2[i].cursorOnObject(runtimeScene, false) ) {
        gdjs.JeuCode.condition1IsTrue_0.val = true;
        gdjs.JeuCode.GDMenuObjects2[k] = gdjs.JeuCode.GDMenuObjects2[i];
        ++k;
    }
}
gdjs.JeuCode.GDMenuObjects2.length = k;}if ( gdjs.JeuCode.condition1IsTrue_0.val ) {
{
{gdjs.JeuCode.conditionTrue_1 = gdjs.JeuCode.condition2IsTrue_0;
gdjs.JeuCode.conditionTrue_1.val = context.triggerOnce(147778880);
}
}}
}
if (gdjs.JeuCode.condition2IsTrue_0.val) {
{gdjs.evtTools.runtimeScene.changeScene(runtimeScene, "Menu");
}}

}


{

gdjs.JeuCode.GDRetryObjects2.createFrom(runtimeScene.getObjects("Retry"));

gdjs.JeuCode.condition0IsTrue_0.val = false;
gdjs.JeuCode.condition1IsTrue_0.val = false;
gdjs.JeuCode.condition2IsTrue_0.val = false;
{
gdjs.JeuCode.condition0IsTrue_0.val = gdjs.evtTools.input.isMouseButtonPressed(runtimeScene, "Left");
}if ( gdjs.JeuCode.condition0IsTrue_0.val ) {
{
for(var i = 0, k = 0, l = gdjs.JeuCode.GDRetryObjects2.length;i<l;++i) {
    if ( gdjs.JeuCode.GDRetryObjects2[i].cursorOnObject(runtimeScene, false) ) {
        gdjs.JeuCode.condition1IsTrue_0.val = true;
        gdjs.JeuCode.GDRetryObjects2[k] = gdjs.JeuCode.GDRetryObjects2[i];
        ++k;
    }
}
gdjs.JeuCode.GDRetryObjects2.length = k;}if ( gdjs.JeuCode.condition1IsTrue_0.val ) {
{
{gdjs.JeuCode.conditionTrue_1 = gdjs.JeuCode.condition2IsTrue_0;
gdjs.JeuCode.conditionTrue_1.val = context.triggerOnce(147777360);
}
}}
}
if (gdjs.JeuCode.condition2IsTrue_0.val) {
{gdjs.evtTools.runtimeScene.changeScene(runtimeScene, "Rebooter");
}}

}


{

gdjs.JeuCode.GDGradientForLoosingObjects2.createFrom(runtimeScene.getObjects("GradientForLoosing"));

gdjs.JeuCode.condition0IsTrue_0.val = false;
gdjs.JeuCode.condition1IsTrue_0.val = false;
gdjs.JeuCode.condition2IsTrue_0.val = false;
gdjs.JeuCode.condition3IsTrue_0.val = false;
{
gdjs.JeuCode.condition0IsTrue_0.val = gdjs.evtTools.input.isMouseButtonPressed(runtimeScene, "Left");
}if ( gdjs.JeuCode.condition0IsTrue_0.val ) {
{
for(var i = 0, k = 0, l = gdjs.JeuCode.GDGradientForLoosingObjects2.length;i<l;++i) {
    if ( gdjs.JeuCode.GDGradientForLoosingObjects2[i].cursorOnObject(runtimeScene, false) ) {
        gdjs.JeuCode.condition1IsTrue_0.val = true;
        gdjs.JeuCode.GDGradientForLoosingObjects2[k] = gdjs.JeuCode.GDGradientForLoosingObjects2[i];
        ++k;
    }
}
gdjs.JeuCode.GDGradientForLoosingObjects2.length = k;}if ( gdjs.JeuCode.condition1IsTrue_0.val ) {
{
for(var i = 0, k = 0, l = gdjs.JeuCode.GDGradientForLoosingObjects2.length;i<l;++i) {
    if ( gdjs.JeuCode.GDGradientForLoosingObjects2[i].getAnimation() == 2 ) {
        gdjs.JeuCode.condition2IsTrue_0.val = true;
        gdjs.JeuCode.GDGradientForLoosingObjects2[k] = gdjs.JeuCode.GDGradientForLoosingObjects2[i];
        ++k;
    }
}
gdjs.JeuCode.GDGradientForLoosingObjects2.length = k;}if ( gdjs.JeuCode.condition2IsTrue_0.val ) {
{
{gdjs.JeuCode.conditionTrue_1 = gdjs.JeuCode.condition3IsTrue_0;
gdjs.JeuCode.conditionTrue_1.val = context.triggerOnce(147532264);
}
}}
}
}
if (gdjs.JeuCode.condition3IsTrue_0.val) {
{gdjs.evtTools.runtimeScene.changeScene(runtimeScene, "Plus difficile");
}}

}


{



}

} //End of subevents
}

}


{

gdjs.JeuCode.GDDirectionObjects1.createFrom(runtimeScene.getObjects("Direction"));

{gdjs.evtTools.camera.setCameraX(runtimeScene, (( gdjs.JeuCode.GDDirectionObjects1.length === 0 ) ? 0 :gdjs.JeuCode.GDDirectionObjects1[0].getPointX(""))+15, "Dirrection", 0);
}{gdjs.evtTools.camera.setCameraY(runtimeScene, (( gdjs.JeuCode.GDDirectionObjects1.length === 0 ) ? 0 :gdjs.JeuCode.GDDirectionObjects1[0].getPointY(""))-175, "Dirrection", 0);
}
{ //Subevents

{

gdjs.JeuCode.GDDirectionObjects2.createFrom(gdjs.JeuCode.GDDirectionObjects1);
gdjs.JeuCode.GDTrouObjects2.createFrom(runtimeScene.getObjects("Trou"));

gdjs.JeuCode.condition0IsTrue_0.val = false;
gdjs.JeuCode.condition1IsTrue_0.val = false;
{
gdjs.JeuCode.condition0IsTrue_0.val = gdjs.evtTools.object.pickRandomObject(runtimeScene, context.clearEventsObjectsMap().addObjectsToEventsMap("Trou", gdjs.JeuCode.GDTrouObjects2).getEventsObjectsMap());
}if ( gdjs.JeuCode.condition0IsTrue_0.val ) {
{
for(var i = 0, k = 0, l = gdjs.JeuCode.GDTrouObjects2.length;i<l;++i) {
    if ( gdjs.JeuCode.GDTrouObjects2[i].getAnimation() == 1 ) {
        gdjs.JeuCode.condition1IsTrue_0.val = true;
        gdjs.JeuCode.GDTrouObjects2[k] = gdjs.JeuCode.GDTrouObjects2[i];
        ++k;
    }
}
gdjs.JeuCode.GDTrouObjects2.length = k;}}
if (gdjs.JeuCode.condition1IsTrue_0.val) {
{for(var i = 0, len = gdjs.JeuCode.GDDirectionObjects2.length ;i < len;++i) {
    gdjs.JeuCode.GDDirectionObjects2[i].turnTowardObject((gdjs.JeuCode.GDTrouObjects2.length !== 0 ? gdjs.JeuCode.GDTrouObjects2[0] : null));
}
}}

}

} //End of subevents

}


{



}


{



}


{

gdjs.JeuCode.GDDeafeatObjects1.createFrom(runtimeScene.getObjects("Deafeat"));
gdjs.JeuCode.GDTryMoreDifficultObjects1.createFrom(runtimeScene.getObjects("TryMoreDifficult"));
gdjs.JeuCode.GDVictoryObjects1.createFrom(runtimeScene.getObjects("Victory"));

gdjs.JeuCode.condition0IsTrue_0.val = false;
{
gdjs.JeuCode.condition0IsTrue_0.val = gdjs.evtTools.common.getVariableNumber(runtimeScene.getGame().getVariables().getFromIndex(1)) == 1;
}if (gdjs.JeuCode.condition0IsTrue_0.val) {
{for(var i = 0, len = gdjs.JeuCode.GDDeafeatObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDDeafeatObjects1[i].setString("Défaite");
}
}{for(var i = 0, len = gdjs.JeuCode.GDTryMoreDifficultObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDTryMoreDifficultObjects1[i].setString("Niveau superrieur");
}
}{for(var i = 0, len = gdjs.JeuCode.GDVictoryObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDVictoryObjects1[i].setString("Victoire");
}
}}

}


{

gdjs.JeuCode.GDDeafeatObjects1.createFrom(runtimeScene.getObjects("Deafeat"));
gdjs.JeuCode.GDTryMoreDifficultObjects1.createFrom(runtimeScene.getObjects("TryMoreDifficult"));
gdjs.JeuCode.GDVictoryObjects1.createFrom(runtimeScene.getObjects("Victory"));

{for(var i = 0, len = gdjs.JeuCode.GDDeafeatObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDDeafeatObjects1[i].setX(160-(gdjs.JeuCode.GDDeafeatObjects1[i].getWidth()));
}
for(var i = 0, len = gdjs.JeuCode.GDVictoryObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDVictoryObjects1[i].setX(160-(gdjs.JeuCode.GDVictoryObjects1[i].getWidth()));
}
for(var i = 0, len = gdjs.JeuCode.GDTryMoreDifficultObjects1.length ;i < len;++i) {
    gdjs.JeuCode.GDTryMoreDifficultObjects1[i].setX(160-(gdjs.JeuCode.GDTryMoreDifficultObjects1[i].getWidth()));
}
}
}

return;
}
gdjs['JeuCode']= gdjs.JeuCode;
