

script_enemy_main
{
    let cx = GetCenterX();
    let cy = GetCenterY();
    let count = 0;
    let count2 = 0;




    @Initialize()
    {
        SetLife(1);
        ForbidShot(true);
        ForbidBomb(true);
    }

    @MainLoop()
    {
        count2++;
        SetNormPoint(-1);
        if (OnEvent()==true) {
            break;
        }
        if (GetSpeed!=0) {
            break;
        }
        if (count == 2)
        {
            SetMovePosition02(cx+1,145,80);
            CreateEventFromScript("B");
        }
        if (count == 3)
        {
            VanishEnemy;
        }
        count++;
    }

    @DrawLoop
    {
    }

    @Finalize() {}
}

script_event B
{
    function IntToString(num) {
        let retStr = "";//戻り値
        let numStr = ToString(num);

        let i = 0;
        while (i < length(numStr)) {
            let tmp = numStr[i];
            if (tmp == '.') {	//小数点で終了
                break;
            }
            retStr = retStr ~ [tmp];
            i++;
        }
        return retStr;
    }

    let count = 0;
    @Initialize
    {
    }

    @MainLoop
    {count++;

     TextOut("\c[RED]今回のスコア　　　　："~IntToString(GetCommonDataDefaultEx("Spell","HighScore",0))~"点 \n前回までのハイスコア："~IntToString(GetCommonDataDefaultEx("Spell","HighScore_before",0))~"点");
    if (GetCommonDataDefaultEx("Spell","HighScore",0)>GetCommonDataDefaultEx("Spell","HighScore_before",0)) {
    TextOut("\c[RED]ハイスコア更新！ ："~IntToString(GetCommonDataDefaultEx("Spell","HighScore",0))~"点\n                ＋"~IntToString(GetScore()-GetCommonDataDefaultEx("Spell","HighScore_before",0))~"更新");
    }
    End();
    }

    @Finalize
    {

    }
}

