const DISPLAY_SIZE_X=640;const DISPLAY_SIZE_Y=480;const GAME_FPS=30;const KEY_WAIT=3;const SCENE_TITLE=0;const SCENE_IN_NAME=1;const SCENE_IN_NAME2=2;const SCENE_OP=3;const SCENE_TOWN=4;const SCENE_SET_PARTY=5;const SCENE_EQUIPMENT=6;const SCENE_EQUIPMENT2=7;const SCENE_STATES=8;const SCENE_GAL_M=9;const SCENE_SHOP=10;const SCENE_INN=11;const SCENE_INN2=12;const SCENE_LV_SHOP=13;const SCENE_ITEM=14;const SCENE_DIFFICULTY=15;const SCENE_KEYCONFIG=16;const SCENE_WORD_POSITION=17;const SCENE_SELECT_USE_ITEM=18;const SCENE_SAVE=19;const SCENE_GO_TO_DUNGEON=20;const SCENE_DUNGEON=21;const SCENE_DUNGEON_MENU=22;const SCENE_DUNGEON_ITEM=23;const SCENE_ENCOUNT=24;const SCENE_S_COMMAND=25;const SCENE_P_ATTACK=26;const SCENE_E_DATA=27;const SCENE_TURN_END=28;const SCENE_ENEMY_ATTACK=29;const SCENE_WIN=30;const SCENE_LOSE=31;const SCENE_ENDING=32;const SCENE_FREE_BATTLE=33;const SCENE_HELP_BATTLE=34;const SCENE_SELECT_ENEMY=35;const SCENE_INFO=36;const BS_TITLE=0;const BS_TOWN=1;const BS_DUNGEON=2;const BS_FREE=3;const BATTLE_OFF=0;const BATTLE_ON=1;let battleSwitch=BATTLE_OFF;const BGM_ON=1;const BGM_OFF=0;const DUNGEON_MAX=2;const AL_SIZE_X=14;const AL_SIZE_Y=22;let gameScene=SCENE_TITLE;let backScene=BS_TITLE;let timer=0;let bgmSwitch=BGM_OFF;let day_num=1;let dungeon_count=0;let area_flag=1