
let debug_mode=false;


let current_tex=GetCurrentScriptDirectory~".\GameData\ImageData\";
let tex=[current_tex~"Tex_System.png",
		 current_tex~"Tex_FrameBackground.png",
		 current_tex~"Tex_FrameBackground_r.png",
		 current_tex~"Tex_FrameBorder.png",
		 current_tex~"Tex_FrameTitle.png",
		 current_tex~"Tex_FrameNoize.png",
		 current_tex~"Tex_WhiteBG.png",
		 current_tex~"Tex_MenuText.png",
		 current_tex~"Tex_SpellName.png",
		 current_tex~"Tex_Result.png"];
let TEX_SYSTEM=0;
let TEX_FRAMEBACK=1;
let TEX_FRAMEBACK2=2;
let TEX_FRAMEBORDER=3;
let TEX_FRAMETITLE=4;
let TEX_FRAMENOIZE=5;
let TEX_WHITE=6;
let TEX_MENUTEXT=7;
let TEX_SPELLNAME=8;
let TEX_RESULT=9;


let current_bgm=GetCurrentScriptDirectory~".\GameData\SoundData\BGM\";
let bgm=[current_bgm~"title.wav"];

let current_se=GetCurrentScriptDirectory~".\GameData\SoundData\SE\";
let se=[current_se~"cursor7.wav",
		current_se~"cursor3.wav",
		current_se~"decide14.wav",
		current_se~"tm2_gun000.wav",
		current_se~"tm2_power000.wav",
		current_se~"tm2_power001.wav",
		current_se~"tm2_coin000.wav",
		current_se~"alarm00.wav",
		current_se~"noise11_a.wav"];
let SE_MENU_SELECT=0;
let SE_MENU_CANCEL=1;
let SE_MENU_DECIDE=2;
let SE_BREAK=3;
let SE_ITEM_BOMB=4;
let SE_ITEM_1UP=5;
let SE_ITEM_MULTI=6;
let SE_WARNING=7;
let SE_SHOTDEL=8;


let cenX=GetCenterX;
let cenY=GetCenterY;
let minX=GetClipMinX;
let maxX=GetClipMaxX;
let minY=GetClipMinY;
let maxY=GetClipMaxY;


let tuning_difficulty=3;
let tuning_lightmode=0;
let tuning_playmusic=1;
let tuning_continue=1;




let bg_vector3=[0,0,0];
let bg_pos=[0,0,0];
let bg_alpha=[];

let bg_eye_lookat=[0,0,0];
let bg_eye_viewfrom=[500,90,45];
let bg_perspectiveclip=[10,1500];
let bg_fog_perspectiveclip=[0,0];
let bg_fogcolor=[255,255,255];


let stage_tex=[];

let frame_rflg=false;

let enemylife_scale=0;
let enemylife_flame=0;
let enemylife_num=0;


let stagenum=0;
let stagepart=0;


let gameloop_count=0;
let stage_count=0;

let itempoint=10000;
let itempoint_prev=itempoint;
let itemrate_num=1;
let itemrate_prev=1;
let itemconv_delay=0;
let itemconv_flg=false;
let itemborder=160;

let itempoint_totalcount=0;
let itemmulti_totalcount=0;
let itempoint_getcount=0;
let itemmulti_getcount=0;
let extend_1up=1000;
let extend_bomb=700;

let graze_break=200;

let multiply_num=0;
let multiply_delay=0;

let red_num=0;
let red_alpha=255;

let score=0;
let scorestack=0;
let gamemode=0;
let menu_playstage=0;
let menu_flg=true;
let config_effectlevel=0;

let replayflg=false;

let bombflg=false;

let memory_highscore=[];
let memory_highscore_stage=[];
let memory_spell_totalcount=[];
let memory_spell_getcount=[];
let memory_flg=[];
let memory_tuning=[];
let memory_others=[];

let replay_highscore=[];
let replay_highscore_stage=[];
let replay_spell_totalcount=[];
let replay_spell_getcount=[];
let replay_flg=[];
let replay_tuning=[];
let replay_others=[];

let timer_hours=0;
let timer_minutes=0;
let timer_seconds=0;

let play_count=0;


let area1_standby=false;
let area2_standby=false;
let area3_standby=false;
let area4_standby=false;
let area5_standby=false;
let area6_standby=false;
let unseenarea1_standby=false;
let unseenarea2_standby=false;
let unseenarea3_standby=false;

let unseenarea1_flg=false;
let unseenarea2_flg=false;
let unseenarea3_flg=false;

function wait(let n){loop(n){yield;}}
function GetGapLength(x1,y1,x2,y2){return((x2-x1)^2+(y2-y1)^2)^0.5;}
function GetGapX(x,gapLength,gapAngle){return x+gapLength*cos(gapAngle);}
function GetGapY(y,gapLength,gapAngle){return y+gapLength*sin(gapAngle);}


function waitzero{while(IsBossExisting){yield;}}



