LEGEND (Platformer)
@Stage\n\nwhen flag clicked\nforever\n    play sound [Sunshine v] until done\nend\n\n@キャラ\n\nwhen flag clicked\ngo to x: (0) y: (-20)\nset [x v] to [0]\nset [y v] to [0]\nset [視点x v] to [-200]\nset [視点y v] to [-20]\nset [x v] to [-200]\nset [y v] to [-20]\nset [復活x v] to [-200]\nset [復活y v] to [-20]\n\ndefine 動作\nbroadcast (プログラム v)\nif <(動いていい?) = [1]> then\n    if <touching (水 v)?> then\n        change [y v] by (-0.1)\n    else\n        change [y v] by (-1)\n    end\n    change [i v] by (1)\n    if <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<(mouse x) > [0]> and <mouse down?>>>> then\n        set rotation style [left-right v]\n        point in direction (1)\n        change [x v] by (1)\n    end\n    if <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<[0] > (mouse x)> and <mouse down?>>>> then\n        set rotation style [left-right v]\n        point in direction (-1)\n        change [x v] by (-1)\n    end\n    set [x v] to ((x) * (0.88))\n    change x by (x)\n    repeat (15)\n        if <touching (地面 v)?> then\n            change y by (1)\n        end\n    end\n    if <touching (地面 v)?> then\n        change y by (-15)\n        位置補正x (() - ((x) / ([abs v] of (x) ))) ([ceiling v] of ([abs v] of (x) ) )\n        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > [0]> and <mouse down?>>>> then\n            start sound [Jump v]\n            set [y v] to [12]\n            set [x v] to ((7) - (<(x) > [0]> * (14)))\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (y)\n    if <touching (地面 v)?> then\n        位置補正y (() - ((y) / ([abs v] of (y) ))) ([ceiling v] of ([abs v] of (y) ) )\n    end\n    change y by (-1.1)\n    if <<touching (地面 v)?> and <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > [0]> and <mouse down?>>>>> then\n        if <touching (背景 v)?> then\n    end\n    if <<touching (水 v)?> and <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > [0]> and <mouse down?>>>>> then\n        set [y v] to [5]\n    end\n    change y by (1.1)\n    if <<(Y) < [-400]> or <touching (障害物 v)?>> then\n        初期位置\n    end\n    処理\n    broadcast (プログラム2 v)\n    if <(x position) > [70]> then\n        set x to (70)\n    end\n    if <(x position) < [-60]> then\n        set x to (-60)\n    end\nend\n\nwhen I receive [プログラム v]\n動作\n\ndefine 処理\nchange [x v] by ((x position) - ((X) - (視点x)))\nchange [y v] by ((y position) - (((Y) - (視点y)) - (20)))\nchange [視点x v] by ([floor v] of (((X) - (視点x)) * (0.1)) )\nchange [視点y v] by ([floor v] of (((Y) - (視点y)) * (0.2)) )\nset x to ((X) - (視点x))\nset y to (((Y) - (視点y)) - (20))\n\ndefine 位置補正x (向き) (回数)\nif <(x) = [0]> then\n    stop [this script v]\nend\nset [i v] to [0]\nrepeat until <<not <touching (地面 v)?>> or <(i) = ((回数) + (1))>>\n    change [i v] by (1)\n    change x by (向き)\nend\nchange x by (() - ((向き) * (((回数) + (1)) * <<(i) = ((回数) + (1))> and <touching (地面 v)?>>)))\n\ndefine 位置補正y (向き) (回数)\nif <(y) = [0]> then\n    stop [this script v]\nend\nset [i v] to [0]\nrepeat until <<not <touching (地面 v)?>> or <(i) = ((回数) + (1))>>\n    change [i v] by (1)\n    change y by (向き)\nend\nchange y by (() - ((向き) * (((回数) + (1)) * <<(i) = ((回数) + (1))> and <touching (地面 v)?>>)))\nset [y v] to [0]\n\ndefine 初期位置\npoint in direction (1)\ngo to x: (0) y: (-20)\nset [x v] to [0]\nset [y v] to [0]\nset [視点x v] to (復活x)\nset [視点y v] to (復活y)\nset [x v] to (復活x)\nset [y v] to (復活y)\nset [しゃべる言葉 v] to [0]\n\nwhen flag clicked\nshow\nset size to (50) %\npoint in direction (1)\n\nwhen I receive [オンライン！ v]\nset [しゃべる言葉 v] to [0]\nforever\n    hide variable [コイン v]\n    if <not <(username) = []>> then\n        if <(しゃべる言葉) = [0]> then\n            say (username)\n        else\n            say (join (join (username) [:]) (item (しゃべる言葉) of [しゃべる言葉 v]))\n        end\n    end\nend\n\nwhen I receive [当たったー v]\n初期位置\n\nwhen I start as a clone\ndelete this clone\n\nwhen flag clicked\nbroadcast (プログラム v)\n\n@オンライン\n\nwhen I receive [オンライン v]\nset [オンライン v] to [1]\nset [☁ p1 v] to [0]\nset [☁ p2 v] to [0]\nset [☁ p3 v] to [0]\nset [☁ p4 v] to [0]\nset [☁ p5 v] to [0]\nset [☁ p6 v] to [0]\nset [☁ p7 v] to [0]\nset [☁ p8 v] to [0]\nset [☁ p9 v] to [0]\nset [☁ p10 v] to [0]\nset [1p？ v] to [0]\nwait (1) seconds\nbroadcast (オンライン！ v)\nforever\n    if <(☁ p1) = [0]> then\n        ユーザー名数値化\n        forever\n            set [1p？ v] to [1]\n            set [☁ p1 v] to (join (ユーザー名数値化) (join (join (([floor v] of (X) ) + (1500)) (([floor v] of (Y) ) + (1500))) (join (([direction v] of [キャラ v]) + (1)) (join ((しゃべる言葉) + (10)) (letter (length of ([floor v] of (timer) )) of ([floor v] of (timer) ))))))\n        end\n    else\n        if <(☁ p2) = [0]> then\n            ユーザー名数値化\n            forever\n                set [1p？ v] to [2]\n                set [☁ p2 v] to (join (ユーザー名数値化) (join (join (([floor v] of (X) ) + (1500)) (([floor v] of (Y) ) + (1500))) (join (([direction v] of [キャラ v]) + (1)) (join ((しゃべる言葉) + (10)) (letter (length of ([floor v] of (timer) )) of ([floor v] of (timer) ))))))\n            end\n        else\n            if <(☁ p3) = [0]> then\n                ユーザー名数値化\n                forever\n                    set [1p？ v] to [3]\n                    set [☁ p3 v] to (join (ユーザー名数値化) (join (join (([floor v] of (X) ) + (1500)) (([floor v] of (Y) ) + (1500))) (join (([direction v] of [キャラ v]) + (1)) (join ((しゃべる言葉) + (10)) (letter (length of ([floor v] of (timer) )) of ([floor v] of (timer) ))))))\n                end\n            else\n                if <(☁ p4) = [0]> then\n                    ユーザー名数値化\n                    forever\n                        set [1p？ v] to [4]\n                        set [☁ p4 v] to (join (ユーザー名数値化) (join (join (([floor v] of (X) ) + (1500)) (([floor v] of (Y) ) + (1500))) (join (([direction v] of [キャラ v]) + (1)) (join ((しゃべる言葉) + (10)) (letter (length of ([floor v] of (timer) )) of ([floor v] of (timer) ))))))\n                    end\n                else\n                    if <(☁ p5) = [0]> then\n                        ユーザー名数値化\n                        forever\n                            set [1p？ v] to [5]\n                            set [☁ p5 v] to (join (ユーザー名数値化) (join (join (([floor v] of (X) ) + (1500)) (([floor v] of (Y) ) + (1500))) (join (([direction v] of [キャラ v]) + (1)) (join ((しゃべる言葉) + (10)) (letter (length of ([floor v] of (timer) )) of ([floor v] of (timer) ))))))\n                        end\n                    else\n                        if <(☁ p6) = [0]> then\n                            ユーザー名数値化\n                            forever\n                                set [1p？ v] to [6]\n                                set [☁ p6 v] to (join (ユーザー名数値化) (join (join (([floor v] of (X) ) + (1500)) (([floor v] of (Y) ) + (1500))) (join (([direction v] of [キャラ v]) + (1)) (join ((しゃべる言葉) + (10)) (letter (length of ([floor v] of (timer) )) of ([floor v] of (timer) ))))))\n                            end\n                        else\n                            if <(☁ p7) = [0]> then\n                                ユーザー名数値化\n                                forever\n                                    set [1p？ v] to [7]\n                                    set [☁ p7 v] to (join (ユーザー名数値化) (join (join (([floor v] of (X) ) + (1500)) (([floor v] of (Y) ) + (1500))) (join (([direction v] of [キャラ v]) + (1)) (join ((しゃべる言葉) + (10)) (letter (length of ([floor v] of (timer) )) of ([floor v] of (timer) ))))))\n                                end\n                            else\n                                if <(☁ p8) = [0]> then\n                                    ユーザー名数値化\n                                    forever\n                                        set [1p？ v] to [8]\n                                        set [☁ p8 v] to (join (ユーザー名数値化) (join (join (([floor v] of (X) ) + (1500)) (([floor v] of (Y) ) + (1500))) (join (([direction v] of [キャラ v]) + (1)) (join ((しゃべる言葉) + (10)) (letter (length of ([floor v] of (timer) )) of ([floor v] of (timer) ))))))\n                                    end\n                                else\n                                    if <(☁ p9) = [0]> then\n                                        ユーザー名数値化\n                                        forever\n                                            set [1p？ v] to [9]\n                                            set [☁ p9 v] to (join (ユーザー名数値化) (join (join (([floor v] of (X) ) + (1500)) (([floor v] of (Y) ) + (1500))) (join (([direction v] of [キャラ v]) + (1)) (join ((しゃべる言葉) + (10)) (letter (length of ([floor v] of (timer) )) of ([floor v] of (timer) ))))))\n                                        end\n                                    else\n                                        if <(☁ p10) = [0]> then\n                                            ユーザー名数値化\n                                            forever\n                                                set [1p？ v] to [10]\n                                                set [☁ p10 v] to (join (ユーザー名数値化) (join (join (([floor v] of (X) ) + (1500)) (([floor v] of (Y) ) + (1500))) (join (([direction v] of [キャラ v]) + (1)) (join ((しゃべる言葉) + (10)) (letter (length of ([floor v] of (timer) )) of ([floor v] of (timer) ))))))\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nbroadcast (オンライン v)\n\ndefine ユーザー名数値化\nset [ユーザー v] to [0]\nset [ユーザー名数値化 v] to []\nrepeat (length of (username))\n    change [ユーザー v] by (1)\n    switch costume to (letter (ユーザー) of (username))\n    set [ユーザー名数値化 v] to (join (ユーザー名数値化) (costume [number v]))\nend\nrepeat ((40) - (length of (ユーザー名数値化)))\n    set [ユーザー名数値化 v] to (join (ユーザー名数値化) [0])\nend\n\nwhen I receive [オンライン v]\nbroadcast (言う v)\nforever\n    復元1\nend\n\ndefine 復元1\ndelete all of [ユーザー v]\nset [回数 v] to [0]\nrepeat (10)\n    switch costume to ( v)\n    change [回数 v] by (1)\n    set [読み込み v] to [0]\n    set [1 v] to []\n    repeat (20)\n        if <not <(join (letter ((読み込み) + (1)) of (item (回数) of [p1〜10 v])) (letter ((読み込み) + (2)) of (item (回数) of [p1〜10 v]))) = [00]>> then\n            change [読み込み v] by (2)\n            switch costume to (join (letter ((読み込み) - (1)) of (item (回数) of [p1〜10 v])) (letter (読み込み) of (item (回数) of [p1〜10 v])))\n            set [1 v] to (join (1) (costume [name v]))\n        end\n    end\n    add (1) to [ユーザー v]\nend\n\n@チェックポイント\n\nwhen flag clicked\nset [チェックポイント到達 v] to [0]\nswitch costume to (赤旗 v)\nhide\n\nwhen I receive [プログラム2 v]\n移動 ((1400) - (視点x)) ((120) - (視点y))\n\ndefine 移動 (x) (y)\nswitch costume to (なし v)\ngo to x: (x) y: (y)\nswitch costume to ((チェックポイント到達) + (2))\nif <<([abs v] of (x) ) > ([abs v] of (x position) )> or <([abs v] of (y) ) > ([abs v] of (y position) )>> then\n    hide\nelse\n    show\n    if <<touching (キャラ v)?> and <(チェックポイント到達) = [0]>> then\n        set [チェックポイント到達 v] to [1]\n        set [復活x v] to [1400]\n        set [復活y v] to [180]\n    end\nend\nswitch costume to ((チェックポイント到達) + (2))\n\n@チャット\n\ndefine 配置\ngo to [front v] layer\nswitch costume to (コスチューム1 v)\ngo to x: (-175) y: (140)\nrepeat (12)\n    set size to (110) %\n    create clone of (_myself_ v)\n    change y by (-25)\n    next costume\nend\n\nwhen flag clicked\nset [しゃべる言葉 v] to [0]\nset [チャット？ v] to [0]\nhide\n配置\n\nwhen I start as a clone\nshow\nforever\n    go to [front v] layer\n    if <(costume [number v]) = [1]> then\n        show\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            if <(チャット？) = [1]> then\n                set [チャット？ v] to [0]\n                wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n            else\n                wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n                set [チャット？ v] to [1]\n            end\n        end\n    else\n        if <<(チャット？) = [1]> and <not <(costume [number v]) = [1]>>> then\n            show\n            if <<mouse down?> and <touching (mouse-pointer v)?>> then\n                set [しゃべる言葉 v] to ((costume [number v]) - (1))\n                broadcast (喋る v)\n            end\n        else\n            hide\n        end\n    end\nend\n\nwhen I receive [喋る v]\nwait (5) seconds\nset [しゃべる言葉 v] to [0]\nbroadcast (オンライン v)\n\nwhen I start as a clone\nforever\n    set [チャットか？ v] to (mouse y)\n    if <<(チャット？) = [1]> and <<(mouse x) < [-140]> and <[-130] < (mouse y)>>> then\n        set [チャットか？ v] to [1]\n        broadcast (プログラム v)\n    else\n        if <<(チャット？) = [0]> and <<(mouse x) < [-140]> and <[150] < (mouse y)>>> then\n            set [チャットか？ v] to [1]\n        else\n            set [チャットか？ v] to [0]\n        end\n    end\nend\n\n@地面\n\nwhen flag clicked\nwait (0.1) seconds\nset [量 v] to [15]\nhide\nset [ステージのxy v] to [0]\nset [量 v] to [1]\ngo to [front v] layer\nset [ステージの番号 v] to [1]\nステージ配置 [0] [0] [2]\nステージ配置 [250] [-50] [3]\nステージ配置 [800] [80] [4]\nステージ配置 [1200] [-11] [5]\nステージ配置 [1300] [-11] [6]\nステージ配置 [1700] [100] [7]\nステージ配置 [2300] [100] [8]\nステージ配置 [2800] [100] [9]\nステージ配置 [3450] [280] [10]\nステージ配置 [4100] [400] [11]\nステージ配置 [4400] [250] [12]\n\ndefine ステージ配置 (x座標) (y座標) (ステージ番号)\nset [my_x v] to (x座標)\nset [my_y v] to (y座標)\nset [ステージの番号 v] to (ステージ番号)\nswitch costume to (ステージ番号)\nset [ステージのxy v] to (x座標)\nset [my_n v] to (ステージ番号)\ncreate clone of (_myself_ v)\n\ndefine 移動 (x) (y)\nswitch costume to (なし v)\ngo to x: (x) y: (y)\nif <<([abs v] of (x) ) > ([abs v] of (x position) )> or <([abs v] of (y) ) > ([abs v] of (y position) )>> then\n    hide\nelse\n    show\nend\nswitch costume to (My_n)\n\nwhen I receive [プログラム2 v]\nif <(costume [number v]) = [1]> then\n    broadcast (プログラム v)\nelse\n    移動 ((My_x) - (視点x)) ((My_y) - (視点y))\nend\n\nwhen I start as a clone\nshow\n\nwhen flag clicked\nhide\n\n@相手\n\ndefine コピー\nswitch costume to (コスチューム1 v)\nrepeat (10)\n    create clone of (_myself_ v)\n    next costume\nend\n\nwhen I receive [オンライン！ v]\ngo to [front v] layer\nhide\nコピー\n\nwhen I receive [プログラム2 v]\n移動 (((join (join (letter (41) of (item (costume [number v]) of [p1〜10 v])) (letter (42) of (item (costume [number v]) of [p1〜10 v]))) (join (letter (43) of (item (costume [number v]) of [p1〜10 v])) (letter (44) of (item (costume [number v]) of [p1〜10 v])))) - (1500)) - (視点x)) (((join (join (letter (45) of (item (costume [number v]) of [p1〜10 v])) (letter (46) of (item (costume [number v]) of [p1〜10 v]))) (join (letter (47) of (item (costume [number v]) of [p1〜10 v])) (letter (48) of (item (costume [number v]) of [p1〜10 v])))) - (1500)) - ((視点y) - (-20)))\n\nwhen flag clicked\nforever\n    delete all of [p1〜10 v]\n    add (☁ p1) to [p1〜10 v]\n    add (☁ p2) to [p1〜10 v]\n    add (☁ p3) to [p1〜10 v]\n    add (☁ p4) to [p1〜10 v]\n    add (☁ p5) to [p1〜10 v]\n    add (☁ p6) to [p1〜10 v]\n    add (☁ p7) to [p1〜10 v]\n    add (☁ p8) to [p1〜10 v]\n    add (☁ p9) to [p1〜10 v]\n    add (☁ p10) to [p1〜10 v]\nend\n\ndefine 移動 (x) (y)\nset rotation style [left-right v]\ngo to x: (x) y: (y)\nif <<(1p？) = (costume [number v])> or <(item (costume [number v]) of [p1〜10 v]) = [0]>> then\n    hide\nend\nif <<([abs v] of (x) ) > ([abs v] of (x position) )> or <([abs v] of (y) ) > ([abs v] of (y position) )>> then\n    if <<not <(1p？) = (costume [number v])>> and <not <(item (costume [number v]) of [p1〜10 v]) = [0]>>> then\n        if <[0] = ((join (letter (50) of (item (costume [number v]) of [p1〜10 v])) (letter (51) of (item (costume [number v]) of [p1〜10 v]))) - (10))> then\n            say (item (costume [number v]) of [ユーザー v])\n        else\n            say (join (item (costume [number v]) of [ユーザー v]) (join [:] (item ((join (letter (50) of (item (costume [number v]) of [p1〜10 v])) (letter (51) of (item (costume [number v]) of [p1〜10 v]))) - (10)) of [しゃべる言葉 v])))\n        end\n        point in direction ((-1) + (letter (49) of (item (costume [number v]) of [p1〜10 v])))\n        show\n        set [ghost v] effect to (100)\n    end\nelse\n    if <<not <(1p？) = (costume [number v])>> and <not <(item (costume [number v]) of [p1〜10 v]) = [0]>>> then\n        if <[0] = ((join (letter (50) of (item (costume [number v]) of [p1〜10 v])) (letter (51) of (item (costume [number v]) of [p1〜10 v]))) - (10))> then\n            say (item (costume [number v]) of [ユーザー v])\n        else\n            say (join (item (costume [number v]) of [ユーザー v]) (join [:] (item ((join (letter (50) of (item (costume [number v]) of [p1〜10 v])) (letter (51) of (item (costume [number v]) of [p1〜10 v]))) - (10)) of [しゃべる言葉 v])))\n        end\n        point in direction ((-1) + (letter (49) of (item (costume [number v]) of [p1〜10 v])))\n        show\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen I start as a clone\nforever\n    delete all of [確認 v]\n    add (☁ p1) to [確認 v]\n    add (☁ p2) to [確認 v]\n    add (☁ p3) to [確認 v]\n    add (☁ p4) to [確認 v]\n    add (☁ p5) to [確認 v]\n    add (☁ p6) to [確認 v]\n    add (☁ p7) to [確認 v]\n    add (☁ p8) to [確認 v]\n    add (☁ p9) to [確認 v]\n    add (☁ p10) to [確認 v]\n    wait (1) seconds\n    if <(letter (length of (item (costume [number v]) of [確認 v])) of (item (costume [number v]) of [確認 v])) = (letter (length of (item (costume [number v]) of [p1〜10 v])) of (item (costume [number v]) of [p1〜10 v]))> then\n        if <(costume [number v]) = [1]> then\n            hide\n            set [☁ p1 v] to [0]\n        end\n        if <(costume [number v]) = [2]> then\n            hide\n            set [☁ p2 v] to [0]\n        end\n        if <(costume [number v]) = [3]> then\n            hide\n            set [☁ p3 v] to [0]\n        end\n        if <(costume [number v]) = [4]> then\n            hide\n            set [☁ p4 v] to [0]\n        end\n        if <(costume [number v]) = [5]> then\n            hide\n            set [☁ p5 v] to [0]\n        end\n        if <(costume [number v]) = [6]> then\n            hide\n            set [☁ p6 v] to [0]\n        end\n        if <(costume [number v]) = [7]> then\n            hide\n            set [☁ p7 v] to [0]\n        end\n        if <(costume [number v]) = [8]> then\n            hide\n            set [☁ p8 v] to [0]\n        end\n        if <(costume [number v]) = [9]> then\n            hide\n            set [☁ p9 v] to [0]\n        end\n        if <(costume [number v]) = [10]> then\n            hide\n            set [☁ p10 v] to [0]\n        end\n    end\nend\n\nwhen [timer v] > (time2)\nhide\n\n@障害物\n\nwhen flag clicked\npoint in direction (90)\nhide\nwait (0) seconds\ngo to [back v] layer\npoint in direction (90)\nステージ配置 [0] [0] [2]\nステージ配置 [480] [120] [3]\nステージ配置 [1500] [30] [4]\nステージ配置 [2200] [200] [5]\nステージ配置 [2800] [100] [6]\nステージ配置 [3400] [270] [7]\nステージ配置 [3700] [450] [8]\nステージ配置 [4300] [250] [9]\n\ndefine ステージ配置 (x座標) (y座標) (ステージ番号)\npoint in direction (90)\nswitch costume to (なし v)\nset [my_x v] to (x座標)\nset [my_y v] to (y座標)\nswitch costume to (ステージ番号)\nset [my_n v] to (ステージ番号)\ncreate clone of (_myself_ v)\n\ndefine 移動 (x) (y)\nswitch costume to (なし v)\ngo to x: (x) y: (y)\nif <<([abs v] of (x) ) > ([abs v] of (x position) )> or <([abs v] of (y) ) > ([abs v] of (y position) )>> then\n    hide\nelse\n    show\nend\nswitch costume to (My_n)\n\nwhen I receive [プログラム2 v]\nif <not <(costume [number v]) = [1]>> then\n    移動 ((My_x) - (視点x)) ((My_y) - (視点y))\nend\n\nwhen I start as a clone\nshow\n\n@ゴール\n\nwhen flag clicked\nset [クリア v] to [0]\nset [チェックポイント到達 v] to [0]\nswitch costume to (赤旗 v)\nhide\n\nwhen I receive [プログラム2 v]\n移動 ((4750) - (視点x)) ((345) - (視点y))\n\ndefine 移動 (x) (y)\nswitch costume to (なし v)\ngo to x: (x) y: (y)\nswitch costume to ((チェックポイント到達) + (2))\nif <<([abs v] of (x) ) > ([abs v] of (x position) )> or <([abs v] of (y) ) > ([abs v] of (y position) )>> then\n    hide\nelse\n    show\n    if <<touching (キャラ v)?> and <(チェックポイント到達) = [0]>> then\n        set [チェックポイント到達 v] to [1]\n        broadcast (クリア v)\n        stop [this script v]\n    end\nend\nswitch costume to ((チェックポイント到達) + (2))\n\nwhen [timer v] > (time2)\nhide\n\nwhen I receive [クリア v]\nset [クリア v] to [1]\n\n@バネ\n\nwhen flag clicked\nset [チェックポイント到達 v] to [0]\nswitch costume to (赤旗 v)\nhide\n\nwhen I receive [プログラム2 v]\n移動 ((2100) - (視点x)) ((280) - (視点y))\n\ndefine 移動 (x) (y)\nswitch costume to (なし v)\ngo to x: (x) y: (y)\nswitch costume to ((チェックポイント到達) + (2))\nif <<([abs v] of (x) ) > ([abs v] of (x position) )> or <([abs v] of (y) ) > ([abs v] of (y position) )>> then\n    hide\nelse\n    show\n    if <touching (キャラ v)?> then\n        set [y v] to [20]\n    end\nend\nswitch costume to ((チェックポイント到達) + (2))\n\nwhen [timer v] > (time)\nhide\n\nwhen [timer v] > (time2)\nhide\n\n@太陽\n\nwhen flag clicked\nset size to (100) %\ngo to x: (224) y: (166)\nforever\n    go to [back v] layer\n    change size by ([sin v] of ((timer) * (90)) )\nend\n\n@ユーザー確認\n\nwhen flag clicked\nset [動いていい? v] to [1]\ngo to x: (-7) y: (176)\ngo to [back v] layer\nshow list [ユーザー v]\nforever\n    if <<<mouse down?> and <touching (mouse-pointer v)?>> or <key (space v) pressed?>> then\n        hide list [ユーザー v]\n        wait (3) seconds\n        show list [ユーザー v]\n        broadcast (プログラム v)\n    end\n    go to [front v] layer\nend\n\n@チェックポイント2\n\nwhen flag clicked\nset [チェックポイント到達 v] to [0]\nswitch costume to (赤旗 v)\nhide\n\nwhen I receive [プログラム2 v]\n移動 ((2700) - (視点x)) ((90) - (視点y))\n\ndefine 移動 (x) (y)\nswitch costume to (なし v)\ngo to x: (x) y: (y)\nswitch costume to ((チェックポイント到達) + (2))\nif <<([abs v] of (x) ) > ([abs v] of (x position) )> or <([abs v] of (y) ) > ([abs v] of (y position) )>> then\n    hide\nelse\n    show\n    if <<touching (キャラ v)?> and <(チェックポイント到達) = [0]>> then\n        set [チェックポイント到達 v] to [1]\n        set [復活x v] to [2700]\n        set [復活y v] to [130]\n    end\nend\nswitch costume to ((チェックポイント到達) + (2))\n\n@コイン\n\ndefine 動き (x) (y) (コスチューム)\nswitch costume to (消去しないで下さい。 v)\ngo to x: ((x) - (視点x)) y: ((y) - (視点y))\nif <<([abs v] of ((y) - (視点y)) ) > ([abs v] of (y position) )> or <([abs v] of ((x) - (視点x)) ) > ([abs v] of (x position) )>> then\n    hide\nelse\n    show\nend\nswitch costume to (コスチューム)\n\nwhen I start as a clone\nset [ghost v] effect to (0)\n動き (item (a) of [地面x v]) (item (a) of [地面y v]) (コスチューム)\nbroadcast (a v)\n\ndefine 配置 (x) (y) (コスチューム)\nswitch costume to ((コスチューム) + (1))\ngo to x: ((x) - (視点x)) y: ((y) - (視点y))\nadd (x) to [地面x v]\nadd (y) to [地面y v]\nadd ((コスチューム) + (1)) to [コスチューム v]\n\ndefine ブロック名\nset [ghost v] effect to (100)\nshow\nset [a v] to [0]\nrepeat (length of [地面x v])\n    change [a v] by (1)\n    go to x: ((item (a) of [地面x v]) - (視点x)) y: ((item (a) of [地面y v]) - (視点y))\n    if <touching (キャラ v)?> then\n        delete (a) of [地面x v]\n        delete (a) of [地面y v]\n        change [コイン v] by (1)\n        start sound [Coin v]\n    else\n        if <not <(item (a) of [地面x v]) = []>> then\n            create clone of (_myself_ v)\n        end\n    end\nend\n\nwhen I receive [a v]\nwait (0) seconds\ndelete this clone\n\nwhen I receive [コインへ v]\nwait until <(y) = [0]>\n配置 (踏んだよコインよろしく！) ((踏んだよコインよろしく！2) + (25)) [1]\n\nwhen I receive [始め v]\nset [ghost v] effect to (100)\nshow\n\nwhen I receive [元2 v]\nset [ghost v] effect to (100)\nshow\n\nwhen I receive [もう一回 v]\nbroadcast (コイン配置 v)\n\nwhen flag clicked\nset [コイン v] to [0]\n\nwhen flag clicked\nswitch costume to (コスチューム1 v)\nset [コスチューム v] to [0]\nbroadcast (コイン配置 v)\nforever\n    set [コスチューム v] to [1]\n    repeat until <(コスチューム) = [9]>\n        change [コスチューム v] by (1)\n        wait (0.025) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    ブロック名\nend\n\nwhen I receive [クリア v]\nhide\n\nwhen I receive [コイン配置 v]\ndelete all of [地面x v]\ndelete all of [地面y v]\ndelete all of [コスチューム v]\nswitch costume to (コスチューム1 v)\n配置 [-70] [-50] [1]\n配置 [125] [-50] [1]\n配置 [200] [-50] [1]\n配置 [410] [115] [1]\n配置 ((410) + (58)) [115] [1]\n配置 ((410) + ((58) + (58))) [115] [1]\n配置 [1180] [-10] [1]\n配置 [1180] ((-10) + (58)) [1]\n配置 [1620] [38] [1]\n配置 ((1620) + (58)) [38] [1]\n配置 ((1620) + ((58) + (58))) [38] [1]\n配置 [2010] [207] [1]\n配置 [2448] [117] [1]\n配置 ((2448) + (58)) [117] [1]\n配置 [2975] [260] [1]\n配置 [3087] [260] [1]\n配置 [3582] [444] [1]\n配置 ((3582) + (58)) [444] [1]\n配置 ((3582) + ((58) + (58))) [444] [1]\n配置 [3781] [444] [1]\n配置 [3888] [444] [1]\n配置 [4179] [265] [1]\n配置 [4662] [347] [1]\n\n@サムネイル\n\nwhen flag clicked\nhide\nhide variable [コイン v]\nforever\n    set [タイム v] to (timer)\nend\n\nwhen I receive [クリア v]\nstop [all v]\n\nwhen [timer v] > (タイム)\nshow\ngo to x: (0) y: (999)\nforever\n    go to [front v] layer\n    change y by ((() - (y position)) / (7))\nend\n\n