gdjs.MenuCode = {};


gdjs.MenuCode.GDPlatformObjects1= [];
gdjs.MenuCode.GDPlatformObjects2= [];
gdjs.MenuCode.GDPlatformObjects3= [];
gdjs.MenuCode.GDBloqueurObjects1= [];
gdjs.MenuCode.GDBloqueurObjects2= [];
gdjs.MenuCode.GDBloqueurObjects3= [];
gdjs.MenuCode.GDRunnerObjects1= [];
gdjs.MenuCode.GDRunnerObjects2= [];
gdjs.MenuCode.GDRunnerObjects3= [];
gdjs.MenuCode.GDTeleporterObjects1= [];
gdjs.MenuCode.GDTeleporterObjects2= [];
gdjs.MenuCode.GDTeleporterObjects3= [];
gdjs.MenuCode.GDHighScoreObjects1= [];
gdjs.MenuCode.GDHighScoreObjects2= [];
gdjs.MenuCode.GDHighScoreObjects3= [];
gdjs.MenuCode.GDToolbarObjects1= [];
gdjs.MenuCode.GDToolbarObjects2= [];
gdjs.MenuCode.GDToolbarObjects3= [];
gdjs.MenuCode.GDScoreNowObjects1= [];
gdjs.MenuCode.GDScoreNowObjects2= [];
gdjs.MenuCode.GDScoreNowObjects3= [];
gdjs.MenuCode.GDRunObjects1= [];
gdjs.MenuCode.GDRunObjects2= [];
gdjs.MenuCode.GDRunObjects3= [];

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

gdjs.MenuCode.func = function(runtimeScene, context) {
context.startNewFrame();
gdjs.MenuCode.GDPlatformObjects1.length = 0;
gdjs.MenuCode.GDPlatformObjects2.length = 0;
gdjs.MenuCode.GDPlatformObjects3.length = 0;
gdjs.MenuCode.GDBloqueurObjects1.length = 0;
gdjs.MenuCode.GDBloqueurObjects2.length = 0;
gdjs.MenuCode.GDBloqueurObjects3.length = 0;
gdjs.MenuCode.GDRunnerObjects1.length = 0;
gdjs.MenuCode.GDRunnerObjects2.length = 0;
gdjs.MenuCode.GDRunnerObjects3.length = 0;
gdjs.MenuCode.GDTeleporterObjects1.length = 0;
gdjs.MenuCode.GDTeleporterObjects2.length = 0;
gdjs.MenuCode.GDTeleporterObjects3.length = 0;
gdjs.MenuCode.GDHighScoreObjects1.length = 0;
gdjs.MenuCode.GDHighScoreObjects2.length = 0;
gdjs.MenuCode.GDHighScoreObjects3.length = 0;
gdjs.MenuCode.GDToolbarObjects1.length = 0;
gdjs.MenuCode.GDToolbarObjects2.length = 0;
gdjs.MenuCode.GDToolbarObjects3.length = 0;
gdjs.MenuCode.GDScoreNowObjects1.length = 0;
gdjs.MenuCode.GDScoreNowObjects2.length = 0;
gdjs.MenuCode.GDScoreNowObjects3.length = 0;
gdjs.MenuCode.GDRunObjects1.length = 0;
gdjs.MenuCode.GDRunObjects2.length = 0;
gdjs.MenuCode.GDRunObjects3.length = 0;


{



}


{



{ //Subevents

{


gdjs.MenuCode.condition0IsTrue_0.val = false;
{
gdjs.MenuCode.condition0IsTrue_0.val = gdjs.evtTools.runtimeScene.timerElapsedTime(runtimeScene, 0.1, "speeder");
}if (gdjs.MenuCode.condition0IsTrue_0.val) {
{runtimeScene.getVariables().getFromIndex(0).add(0.1);
}{gdjs.evtTools.runtimeScene.resetTimer(runtimeScene, "speeder");
}}

}


{

gdjs.MenuCode.GDRunnerObjects2.createFrom(runtimeScene.getObjects("Runner"));

{for(var i = 0, len = gdjs.MenuCode.GDRunnerObjects2.length ;i < len;++i) {
    gdjs.MenuCode.GDRunnerObjects2[i].hide();
}
}
{ //Subevents

{

gdjs.MenuCode.GDBloqueurObjects3.createFrom(runtimeScene.getObjects("Bloqueur"));
gdjs.MenuCode.GDRunnerObjects3.createFrom(gdjs.MenuCode.GDRunnerObjects2);

gdjs.MenuCode.condition0IsTrue_0.val = false;
{
gdjs.MenuCode.condition0IsTrue_0.val = gdjs.evtTools.object.hitBoxesCollisionTest(context.clearEventsObjectsMap().addObjectsToEventsMap("Runner", gdjs.MenuCode.GDRunnerObjects3).getEventsObjectsMap(), context.clearEventsObjectsMap().addObjectsToEventsMap("Bloqueur", gdjs.MenuCode.GDBloqueurObjects3).getEventsObjectsMap(), false, runtimeScene);
}if (gdjs.MenuCode.condition0IsTrue_0.val) {
{for(var i = 0, len = gdjs.MenuCode.GDRunnerObjects3.length ;i < len;++i) {
    gdjs.MenuCode.GDRunnerObjects3[i].setY(gdjs.MenuCode.GDRunnerObjects3[i].getY() - (1));
}
}}

}

} //End of subevents

}


{

gdjs.MenuCode.GDRunnerObjects2.createFrom(runtimeScene.getObjects("Runner"));
gdjs.MenuCode.GDTeleporterObjects2.createFrom(runtimeScene.getObjects("Teleporter"));

gdjs.MenuCode.condition0IsTrue_0.val = false;
{
gdjs.MenuCode.condition0IsTrue_0.val = gdjs.evtTools.object.hitBoxesCollisionTest(context.clearEventsObjectsMap().addObjectsToEventsMap("Runner", gdjs.MenuCode.GDRunnerObjects2).getEventsObjectsMap(), context.clearEventsObjectsMap().addObjectsToEventsMap("Teleporter", gdjs.MenuCode.GDTeleporterObjects2).getEventsObjectsMap(), false, runtimeScene);
}if (gdjs.MenuCode.condition0IsTrue_0.val) {
{for(var i = 0, len = gdjs.MenuCode.GDRunnerObjects2.length ;i < len;++i) {
    gdjs.MenuCode.GDRunnerObjects2[i].setX(-1150);
}
}{for(var i = 0, len = gdjs.MenuCode.GDRunnerObjects2.length ;i < len;++i) {
    gdjs.MenuCode.GDRunnerObjects2[i].setX(gdjs.MenuCode.GDRunnerObjects2[i].getX() + (150));
}
}}

}


{



{ //Subevents

{

gdjs.MenuCode.GDPlatformObjects3.createFrom(runtimeScene.getObjects("Platform"));

gdjs.MenuCode.condition0IsTrue_0.val = false;
{
for(var i = 0, k = 0, l = gdjs.MenuCode.GDPlatformObjects3.length;i<l;++i) {
    if ( gdjs.MenuCode.GDPlatformObjects3[i].isOnLayer("Plan2") ) {
        gdjs.MenuCode.condition0IsTrue_0.val = true;
        gdjs.MenuCode.GDPlatformObjects3[k] = gdjs.MenuCode.GDPlatformObjects3[i];
        ++k;
    }
}
gdjs.MenuCode.GDPlatformObjects3.length = k;}if (gdjs.MenuCode.condition0IsTrue_0.val) {
{for(var i = 0, len = gdjs.MenuCode.GDPlatformObjects3.length ;i < len;++i) {
    gdjs.MenuCode.GDPlatformObjects3[i].setOpacity(200);
}
}}

}


{

gdjs.MenuCode.GDPlatformObjects3.createFrom(runtimeScene.getObjects("Platform"));

gdjs.MenuCode.condition0IsTrue_0.val = false;
{
for(var i = 0, k = 0, l = gdjs.MenuCode.GDPlatformObjects3.length;i<l;++i) {
    if ( gdjs.MenuCode.GDPlatformObjects3[i].isOnLayer("Plan3") ) {
        gdjs.MenuCode.condition0IsTrue_0.val = true;
        gdjs.MenuCode.GDPlatformObjects3[k] = gdjs.MenuCode.GDPlatformObjects3[i];
        ++k;
    }
}
gdjs.MenuCode.GDPlatformObjects3.length = k;}if (gdjs.MenuCode.condition0IsTrue_0.val) {
{for(var i = 0, len = gdjs.MenuCode.GDPlatformObjects3.length ;i < len;++i) {
    gdjs.MenuCode.GDPlatformObjects3[i].setOpacity(125);
}
}}

}


{

gdjs.MenuCode.GDPlatformObjects3.createFrom(runtimeScene.getObjects("Platform"));

gdjs.MenuCode.condition0IsTrue_0.val = false;
{
for(var i = 0, k = 0, l = gdjs.MenuCode.GDPlatformObjects3.length;i<l;++i) {
    if ( gdjs.MenuCode.GDPlatformObjects3[i].isOnLayer("Arrière Plan4") ) {
        gdjs.MenuCode.condition0IsTrue_0.val = true;
        gdjs.MenuCode.GDPlatformObjects3[k] = gdjs.MenuCode.GDPlatformObjects3[i];
        ++k;
    }
}
gdjs.MenuCode.GDPlatformObjects3.length = k;}if (gdjs.MenuCode.condition0IsTrue_0.val) {
{for(var i = 0, len = gdjs.MenuCode.GDPlatformObjects3.length ;i < len;++i) {
    gdjs.MenuCode.GDPlatformObjects3[i].setOpacity(50);
}
}}

}

} //End of subevents

}


{

gdjs.MenuCode.GDRunnerObjects2.createFrom(runtimeScene.getObjects("Runner"));

{for(var i = 0, len = gdjs.MenuCode.GDRunnerObjects2.length ;i < len;++i) {
    gdjs.MenuCode.GDRunnerObjects2[i].setX(gdjs.MenuCode.GDRunnerObjects2[i].getX() + (5+(gdjs.evtTools.common.getVariableNumber(runtimeScene.getVariables().getFromIndex(0))/1000)));
}
}{runtimeScene.getVariables().getFromIndex(1).add(Math.round(1+(gdjs.evtTools.common.getVariableNumber(runtimeScene.getVariables().getFromIndex(0))/1000)));
}
}


{

gdjs.MenuCode.GDBloqueurObjects2.createFrom(runtimeScene.getObjects("Bloqueur"));
gdjs.MenuCode.GDRunnerObjects2.createFrom(runtimeScene.getObjects("Runner"));
gdjs.MenuCode.GDTeleporterObjects2.createFrom(runtimeScene.getObjects("Teleporter"));

{gdjs.evtTools.camera.setCameraX(runtimeScene, (( gdjs.MenuCode.GDRunnerObjects2.length === 0 ) ? 0 :gdjs.MenuCode.GDRunnerObjects2[0].getPointX("")), "", 0);
}{gdjs.evtTools.camera.setCameraX(runtimeScene, (( gdjs.MenuCode.GDRunnerObjects2.length === 0 ) ? 0 :gdjs.MenuCode.GDRunnerObjects2[0].getPointX(""))*0.75, "Plan2", 0);
}{gdjs.evtTools.camera.setCameraX(runtimeScene, (( gdjs.MenuCode.GDRunnerObjects2.length === 0 ) ? 0 :gdjs.MenuCode.GDRunnerObjects2[0].getPointX(""))*0.50, "Plan3", 0);
}{gdjs.evtTools.camera.setCameraX(runtimeScene, (( gdjs.MenuCode.GDRunnerObjects2.length === 0 ) ? 0 :gdjs.MenuCode.GDRunnerObjects2[0].getPointX(""))*0.25, "Arrière Plan4", 0);
}{for(var i = 0, len = gdjs.MenuCode.GDBloqueurObjects2.length ;i < len;++i) {
    gdjs.MenuCode.GDBloqueurObjects2[i].hide();
}
for(var i = 0, len = gdjs.MenuCode.GDTeleporterObjects2.length ;i < len;++i) {
    gdjs.MenuCode.GDTeleporterObjects2[i].hide();
}
}
}


{



}

} //End of subevents

}


{



}


{



{ //Subevents

{

gdjs.MenuCode.GDToolbarObjects2.createFrom(runtimeScene.getObjects("Toolbar"));

gdjs.MenuCode.condition0IsTrue_0.val = false;
gdjs.MenuCode.condition1IsTrue_0.val = false;
gdjs.MenuCode.condition2IsTrue_0.val = false;
gdjs.MenuCode.condition3IsTrue_0.val = false;
{
gdjs.MenuCode.condition0IsTrue_0.val = gdjs.evtTools.input.isMouseButtonPressed(runtimeScene, "Left");
}if ( gdjs.MenuCode.condition0IsTrue_0.val ) {
{
for(var i = 0, k = 0, l = gdjs.MenuCode.GDToolbarObjects2.length;i<l;++i) {
    if ( gdjs.MenuCode.GDToolbarObjects2[i].cursorOnObject(runtimeScene, true) ) {
        gdjs.MenuCode.condition1IsTrue_0.val = true;
        gdjs.MenuCode.GDToolbarObjects2[k] = gdjs.MenuCode.GDToolbarObjects2[i];
        ++k;
    }
}
gdjs.MenuCode.GDToolbarObjects2.length = k;}if ( gdjs.MenuCode.condition1IsTrue_0.val ) {
{
for(var i = 0, k = 0, l = gdjs.MenuCode.GDToolbarObjects2.length;i<l;++i) {
    if ( gdjs.MenuCode.GDToolbarObjects2[i].getAnimation() == 1 ) {
        gdjs.MenuCode.condition2IsTrue_0.val = true;
        gdjs.MenuCode.GDToolbarObjects2[k] = gdjs.MenuCode.GDToolbarObjects2[i];
        ++k;
    }
}
gdjs.MenuCode.GDToolbarObjects2.length = k;}if ( gdjs.MenuCode.condition2IsTrue_0.val ) {
{
{gdjs.MenuCode.conditionTrue_1 = gdjs.MenuCode.condition3IsTrue_0;
gdjs.MenuCode.conditionTrue_1.val = context.triggerOnce(166852080);
}
}}
}
}
if (gdjs.MenuCode.condition3IsTrue_0.val) {
{runtimeScene.getGame().getVariables().getFromIndex(0).setNumber(0);
}{gdjs.evtTools.runtimeScene.changeScene(runtimeScene, "Jeu");
}}

}

} //End of subevents

}


{



}


{



{ //Subevents

{


gdjs.MenuCode.condition0IsTrue_0.val = false;
{
gdjs.MenuCode.condition0IsTrue_0.val = gdjs.evtTools.runtimeScene.sceneJustBegins(runtimeScene);
}if (gdjs.MenuCode.condition0IsTrue_0.val) {
{gdjs.evtTools.storage.readNumberFromJSONFile("Distance.9gs", "Distance Max", runtimeScene, runtimeScene.getVariables().getFromIndex(2));
}}

}


{


gdjs.MenuCode.condition0IsTrue_0.val = false;
{
gdjs.MenuCode.condition0IsTrue_0.val = gdjs.evtTools.common.getVariableNumber(runtimeScene.getGame().getVariables().getFromIndex(0)) > gdjs.evtTools.common.getVariableNumber(runtimeScene.getVariables().getFromIndex(2));
}if (gdjs.MenuCode.condition0IsTrue_0.val) {
{gdjs.evtTools.storage.writeNumberInJSONFile("Distance.9gs", "Distance Max", gdjs.evtTools.common.getVariableNumber(runtimeScene.getGame().getVariables().getFromIndex(0)));
}{runtimeScene.getVariables().getFromIndex(2).setNumber(gdjs.evtTools.common.getVariableNumber(runtimeScene.getGame().getVariables().getFromIndex(0)));
}}

}

} //End of subevents

}


{



}


{



{ //Subevents

{

gdjs.MenuCode.GDHighScoreObjects2.createFrom(runtimeScene.getObjects("HighScore"));
gdjs.MenuCode.GDScoreNowObjects2.createFrom(runtimeScene.getObjects("ScoreNow"));

{for(var i = 0, len = gdjs.MenuCode.GDHighScoreObjects2.length ;i < len;++i) {
    gdjs.MenuCode.GDHighScoreObjects2[i].setString("Your best score: "+gdjs.evtTools.common.getVariableString(runtimeScene.getVariables().getFromIndex(2))+"m");
}
}{for(var i = 0, len = gdjs.MenuCode.GDScoreNowObjects2.length ;i < len;++i) {
    gdjs.MenuCode.GDScoreNowObjects2[i].setString("Your score: "+gdjs.evtTools.common.getVariableString(runtimeScene.getGame().getVariables().getFromIndex(0))+"m");
}
}
}


{

gdjs.MenuCode.GDRunObjects2.createFrom(runtimeScene.getObjects("Run"));

gdjs.MenuCode.condition0IsTrue_0.val = false;
{
gdjs.MenuCode.condition0IsTrue_0.val = gdjs.evtTools.common.getVariableNumber(runtimeScene.getGame().getVariables().getFromIndex(0)) > 0;
}if (gdjs.MenuCode.condition0IsTrue_0.val) {
{gdjs.evtTools.camera.showLayer(runtimeScene, "Score");
}{for(var i = 0, len = gdjs.MenuCode.GDRunObjects2.length ;i < len;++i) {
    gdjs.MenuCode.GDRunObjects2[i].setString("Run Again");
}
}}

}


{

gdjs.MenuCode.GDRunObjects2.createFrom(runtimeScene.getObjects("Run"));

gdjs.MenuCode.condition0IsTrue_0.val = false;
{
gdjs.MenuCode.condition0IsTrue_0.val = gdjs.evtTools.common.getVariableNumber(runtimeScene.getGame().getVariables().getFromIndex(0)) == 0;
}if (gdjs.MenuCode.condition0IsTrue_0.val) {
{gdjs.evtTools.camera.hideLayer(runtimeScene, "Score");
}{for(var i = 0, len = gdjs.MenuCode.GDRunObjects2.length ;i < len;++i) {
    gdjs.MenuCode.GDRunObjects2[i].setString("Run");
}
}}

}

} //End of subevents

}

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