random_set_seed(current_time)

icl(oBeginStepManager);
icl(oAudioManager);

global.input_handles_index = [
	"debug",
	"ingame",
	"inventory",
	"title",
	"pause"
]
create_dummy_handle();
for(var i = 0; i < array_length(global.input_handles_index); i++)
    variable_instance_set(id, global.input_handles_index[i], global.handle_dummy);
	
autoreg_handle("ingame", "ingame", 1);
autoreg_handle("title", "title", 100);

global.altcontrol = false;
global.audio_enabled = false;

_jump_p = undefined;
_jump_r = undefined;
_left = undefined;
_right = undefined;
_up = undefined;
_down = undefined;
_dash = undefined;
_attack = undefined;
_inventory = undefined;

_return = undefined;

_newgame = undefined;
_continue = undefined;
_quitgame = undefined;

_close = undefined;

global.in_game_manager = noone;
global.inventory = noone;
global.camera = noone;
global.player = noone;

global.difficulty = 2; // 0 = EASY, 1 = NORMAL, 2 = HARD

// debugging
global.developer_mode = true;

// save file
global.save_data = {};
global.save_filename = "ddmyx_save.dat";


// title UI (BETA)
menu_options = ["CONTINUE", "NEW GAME", "INFO", "CONTROL:", "EXIT"];
menu_index = 0;

animation_timer = 0;
lerp_speed = 0.15;

for(var i = 0; i < array_length(menu_options); i++)
    option_scale[i] = 1;
	
	
info1 = 
"真的有人阅读info欸！\n" +
"这是以建平筠溪树莓社名义开发的游戏原型。\n" +
"此原型是为义卖活动修改的特别版本，因时间原因，\n" +
"引入的美术与音乐素材较为有限。请不要嫌弃～\n" + 
"原型仅代表最终作品的主要玩法，\n" +
"最终解释权归全体开发人员所有。\n" +
"感谢你的试玩！任何游戏相关问题请咨询社长！\n" +
"预计发行时间：2027年暑假"
info_typer1 = typer_set(info1, 64, 64 * 7.5, 2, 1);

info2 = 
"你是一名优等生。\n" +
"这是建平筠溪，布置与现实有几分相似，\n" +
"却处处充满幻想与危机，熟悉而陌生。\n" +
"是梦……\n" + 
"以你的骄傲，象征成绩的「墨」，挥动钢笔杀敌；\n" +
"前往本部，集齐「建平五环」的品质击破梦境。\n" +
"抑或，在潜意识的旅途中再次结识平日熟识的师友，\n" +
"在他们口中寻得一切的真因？";
info_typer2 = typer_set(info2, 18 * 64, 64 * 7.5, 2, 1);

//favour_text = choose("这是一条风味文本……？");
bgm_play("title");