gdjs.RestartCode = {};
gdjs.RestartCode.localVariables = [];
gdjs.RestartCode.idToCallbackMap = new Map();
gdjs.RestartCode.GDNewSpriteObjects1= [];
gdjs.RestartCode.GDNewSpriteObjects2= [];
gdjs.RestartCode.GDScore2Objects1= [];
gdjs.RestartCode.GDScore2Objects2= [];
gdjs.RestartCode.GDNewTextObjects1= [];
gdjs.RestartCode.GDNewTextObjects2= [];
gdjs.RestartCode.GDBlackDecoratedButtonObjects1= [];
gdjs.RestartCode.GDBlackDecoratedButtonObjects2= [];
gdjs.RestartCode.GDMedievalButtonBeigeObjects1= [];
gdjs.RestartCode.GDMedievalButtonBeigeObjects2= [];


gdjs.RestartCode.eventsList0 = function(runtimeScene) {

{


let isConditionTrue_0 = false;
isConditionTrue_0 = false;
isConditionTrue_0 = gdjs.evtTools.runtimeScene.sceneJustBegins(runtimeScene);
if (isConditionTrue_0) {
gdjs.copyArray(runtimeScene.getObjects("NewSprite"), gdjs.RestartCode.GDNewSpriteObjects1);
{gdjs.evtTools.camera.setCameraZoom(runtimeScene, 1.5, "", 0);
}
{gdjs.evtTools.camera.centerCamera(runtimeScene, (gdjs.RestartCode.GDNewSpriteObjects1.length !== 0 ? gdjs.RestartCode.GDNewSpriteObjects1[0] : null), true, "", 0);
}
elseEventsChainSatisfied = true;
}

}


{


let isConditionTrue_0 = false;
{
gdjs.copyArray(runtimeScene.getObjects("Score2"), gdjs.RestartCode.GDScore2Objects1);
{for(var i = 0, len = gdjs.RestartCode.GDScore2Objects1.length ;i < len;++i) {
    gdjs.RestartCode.GDScore2Objects1[i].getBehavior("Text").setText(runtimeScene.getGame().getVariables().getFromIndex(0).getAsString());
}
}
elseEventsChainSatisfied = true;
}

}


{

gdjs.copyArray(runtimeScene.getObjects("BlackDecoratedButton"), gdjs.RestartCode.GDBlackDecoratedButtonObjects1);

let isConditionTrue_0 = false;
isConditionTrue_0 = false;
for (var i = 0, k = 0, l = gdjs.RestartCode.GDBlackDecoratedButtonObjects1.length;i<l;++i) {
    if ( gdjs.RestartCode.GDBlackDecoratedButtonObjects1[i].IsClicked(null) ) {
        isConditionTrue_0 = true;
        gdjs.RestartCode.GDBlackDecoratedButtonObjects1[k] = gdjs.RestartCode.GDBlackDecoratedButtonObjects1[i];
        ++k;
    }
}
gdjs.RestartCode.GDBlackDecoratedButtonObjects1.length = k;
if (isConditionTrue_0) {
{gdjs.evtTools.runtimeScene.pushScene(runtimeScene, "Choose character");
}
elseEventsChainSatisfied = true;
}

}


{

gdjs.copyArray(runtimeScene.getObjects("MedievalButtonBeige"), gdjs.RestartCode.GDMedievalButtonBeigeObjects1);

let isConditionTrue_0 = false;
isConditionTrue_0 = false;
for (var i = 0, k = 0, l = gdjs.RestartCode.GDMedievalButtonBeigeObjects1.length;i<l;++i) {
    if ( gdjs.RestartCode.GDMedievalButtonBeigeObjects1[i].IsClicked(null) ) {
        isConditionTrue_0 = true;
        gdjs.RestartCode.GDMedievalButtonBeigeObjects1[k] = gdjs.RestartCode.GDMedievalButtonBeigeObjects1[i];
        ++k;
    }
}
gdjs.RestartCode.GDMedievalButtonBeigeObjects1.length = k;
if (isConditionTrue_0) {
{gdjs.evtTools.runtimeScene.replaceScene(runtimeScene, "Main menu", true);
}
elseEventsChainSatisfied = true;
}

}


};

gdjs.RestartCode.func = function(runtimeScene) {
runtimeScene.getOnceTriggers().startNewFrame();

gdjs.RestartCode.GDNewSpriteObjects1.length = 0;
gdjs.RestartCode.GDNewSpriteObjects2.length = 0;
gdjs.RestartCode.GDScore2Objects1.length = 0;
gdjs.RestartCode.GDScore2Objects2.length = 0;
gdjs.RestartCode.GDNewTextObjects1.length = 0;
gdjs.RestartCode.GDNewTextObjects2.length = 0;
gdjs.RestartCode.GDBlackDecoratedButtonObjects1.length = 0;
gdjs.RestartCode.GDBlackDecoratedButtonObjects2.length = 0;
gdjs.RestartCode.GDMedievalButtonBeigeObjects1.length = 0;
gdjs.RestartCode.GDMedievalButtonBeigeObjects2.length = 0;

gdjs.RestartCode.eventsList0(runtimeScene);
gdjs.RestartCode.GDNewSpriteObjects1.length = 0;
gdjs.RestartCode.GDNewSpriteObjects2.length = 0;
gdjs.RestartCode.GDScore2Objects1.length = 0;
gdjs.RestartCode.GDScore2Objects2.length = 0;
gdjs.RestartCode.GDNewTextObjects1.length = 0;
gdjs.RestartCode.GDNewTextObjects2.length = 0;
gdjs.RestartCode.GDBlackDecoratedButtonObjects1.length = 0;
gdjs.RestartCode.GDBlackDecoratedButtonObjects2.length = 0;
gdjs.RestartCode.GDMedievalButtonBeigeObjects1.length = 0;
gdjs.RestartCode.GDMedievalButtonBeigeObjects2.length = 0;


return;

}

gdjs['RestartCode'] = gdjs.RestartCode;
