002 Scroll platformer‼︎ #1
@Stage\n\nwhen flag clicked\nforever\n    play sound [BGM #1 v] until done\nend\n\n@スプライト1\n\n@ルイージプラフォくん\n\nwhen flag clicked\nset size to (50) %\ngo to [back v] layer\ngo [forward v] (1) layers\npoint in direction (1)\nset [y v] to [0]\nset [x v] to [0]\nset [視点y v] to [0]\nset [視点x v] to [0]\nset [復活x v] to [0]\nset [復活y v] to [0]\ngo to x: (0) y: (0)\nset rotation style [left-right v]\nforever\n    動き\nend\n\ndefine 動き\nif <(動き) = [0]> then\n    if <<<(mouse x) > [0]> and <mouse down?>> or <<key (d v) pressed?> or <key (right arrow v) pressed?>>> then\n        point in direction (1)\n        change [x v] by (1)\n    end\n    if <<<[0] > (mouse x)> and <mouse down?>> or <<key (a v) pressed?> or <key (left arrow v) pressed?>>> then\n        point in direction (-1)\n        change [x v] by (-1)\n    end\n    set [加速速度 v] to [0.9]\n    set [x v] to ((x) * (加速速度))\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        壁\n    end\n    set [重力 v] to [-1]\n    change [y v] by (重力)\n    change y by (y)\n    if <touching (地面 v)?> then\n        床\n    end\n    change y by (重力)\n    if <touching (地面 v)?> then\n        if <<<mouse down?> and <[0] < (mouse y)>> or <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n            set [y v] to [15]\n        end\n    end\n    change y by (() - (重力))\n    if <<touching (障害物 v)?> or <(視点y) < [-300]>> then\n        broadcast (もう一回 v)\n    end\n    if <touching (バネ v)?> then\n        set [y v] to [20]\n    end\nend\n\ndefine 床\nrepeat until <not <touching (地面 v)?>>\n    change y by ((((0) - (y)) / ([abs v] of (y) )) * ([abs v] of (重力) ))\nend\nset [y v] to [0]\n\ndefine 壁\nchange y by (-15)\nrepeat until <not <touching (地面 v)?>>\n    change x by (([floor v] of (((0) - (x)) / ([abs v] of (x) )) ) * ([abs v] of (加速速度) ))\nend\nif <<<mouse down?> and <[0] < (mouse y)>> or <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n    set [y v] to [15]\n    set [x v] to ((((0) - (x)) / ([abs v] of (x) )) * (7))\nelse\n    set [x v] to [0]\nend\n\nwhen flag clicked\nforever\n    if <[0] < (x)> then\n        change [視点x v] by ([ceiling v] of ((x position) / (10)) )\n    else\n        change [視点x v] by ([floor v] of ((x position) / (10)) )\n    end\n    change [視点y v] by ([floor v] of ((y position) / (5)) )\n    set [視点y v] to ((視点y) + (5))\n    if <[0] < (x)> then\n        change x by ([floor v] of (((0) - (x position)) / (10)) )\n    else\n        change x by ([ceiling v] of (((0) - (x position)) / (10)) )\n    end\n    change y by ([ceiling v] of (((0) - (y position)) / (5)) )\n    set y to ((y position) - (5))\nend\n\nwhen I receive [もう一回 v]\npoint in direction (1)\nset size to (50) %\nclear graphic effects\nset [y v] to [0]\nset [x v] to [0]\nset [視点y v] to (復活y)\nset [視点x v] to (復活x)\ngo to x: (0) y: (0)\nset rotation style [left-right v]\n\nwhen flag clicked\nset rotation style [left-right v]\nset [死亡 v] to [10]\n\nwhen flag clicked\nshow\nclear graphic effects\n\n@地面\n\ndefine 動き (x) (y) (コスチューム)\nswitch costume to (消さないでね！ v)\ngo to x: ((x) - (視点x)) y: ((y) - (視点y))\nswitch costume to (コスチューム)\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\n\nwhen flag clicked\ndelete all of [地面x v]\ndelete all of [地面y v]\ndelete all of [コスチューム v]\nswitch costume to (コスチューム2 v)\n配置 [0] [0] [1]\n配置 [600] [0] [2]\n配置 [1200] [0] [3]\n配置 [1800] [0] [4]\n配置 [2400] [188.9] [5]\n配置 [3010] [600] [6]\n配置 [3600] [600] [7]\n配置 [4200] [0] [8]\n配置 [4800] [0] [9]\n配置 [5400] [0] [10]\nhide\n\nwhen I start as a clone\n動き (item (a) of [地面x v]) (item (a) of [地面y v]) (item (a) of [コスチューム 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 [a v] to [0]\nrepeat (length of [コスチューム v])\n    change [a v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nforever\n    ブロック名\nend\n\nwhen I receive [a v]\nwait (0) seconds\ndelete this clone\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 flag clicked\ndelete all of [障害物x v]\ndelete all of [障害物y v]\ndelete all of [コスチューム v]\nswitch costume to (コスチューム1 v)\n配置 [600] [-25] [1]\n配置 [1200] [-25] [2]\n配置 [1800] [-25] [3]\n配置 [3000] [577] [4]\n配置 [4200] [-30] [5]\nhide\n\nwhen I start as a clone\n動き (item (a) of [障害物x v]) (item (a) of [障害物y v]) (item (a) of [コスチューム v])\n\ndefine 配置 (x) (y) (コスチューム)\nswitch costume to (コスチューム)\ngo to x: ((x) - (視点x)) y: ((y) - (視点y))\nadd (x) to [障害物x v]\nadd (y) to [障害物y v]\nadd ((コスチューム) + (1)) to [コスチューム v]\n\nwhen flag clicked\nforever\n    ブロック名\nend\n\ndefine ブロック名\nset [a v] to [0]\nrepeat (length of [コスチューム v])\n    change [a v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [a v]\nwait (0) seconds\ndelete this clone\n\n@クリボー\n\ndefine 動き (x) (y) (コスチューム)\nswitch costume to (消さないでね！ v)\ngo to x: ((x) - (視点x)) y: ((y) - (視点y))\nset rotation style [left-right v]\nif <<([abs v] of ((item (a) of [モンスターy v]) - (視点y)) ) > ([abs v] of (y position) )> or <([abs v] of (((item (a) of [モンスターx v]) - ([ceiling v] of (([cos v] of ((timer) * ((100) * ((100) / (item (a) of [モンスター移動範囲 v])))) ) * (item (a) of [モンスター移動範囲 v])) )) - (視点x)) ) > ([abs v] of (x position) )>> then\n    hide\nelse\n    show\nend\nif <([ceiling v] of (([cos v] of (((timer) - (0.1)) * ((100) * ((100) / (item (a) of [モンスター移動範囲 v])))) ) * (item (a) of [モンスター移動範囲 v])) ) < ([ceiling v] of (([cos v] of ((timer) * ((100) * ((100) / (item (a) of [モンスター移動範囲 v])))) ) * (item (a) of [モンスター移動範囲 v])) )> then\n    point in direction (1)\nelse\n    point in direction (-1)\nend\nswitch costume to (コスチューム)\nif <<touching (ルイージプラフォくん v)?> and <not <(y) < [0]>>> then\n    if <(item (a) of [表示 v]) = [1]> then\n        broadcast (もう一回 v)\n    end\nend\nif <(item (a) of [表示 v]) = [0]> then\n    hide\nend\n\nwhen flag clicked\ndelete all of [モンスター移動範囲 v]\ndelete all of [モンスターx v]\ndelete all of [モンスターy v]\ndelete all of [コスチューム v]\ndelete all of [表示 v]\nswitch costume to (コスチューム1 v)\n配置 [2400] [145] [1] [200]\n配置 [4200] [-40] [1] [100]\nhide\n\nwhen I start as a clone\nhide\nif <(item (a) of [表示 v]) = [1]> then\n    動き ((item (a) of [モンスターx v]) - ([ceiling v] of (([cos v] of ((timer) * ((100) * ((100) / (item (a) of [モンスター移動範囲 v])))) ) * (item (a) of [モンスター移動範囲 v])) )) (item (a) of [モンスターy v]) (item (a) of [コスチューム v])\nend\n\ndefine 配置 (x) (y) (コスチューム) (移動範囲)\nswitch costume to (コスチューム)\ngo to x: ((x) - (視点x)) y: ((y) - (視点y))\nadd (x) to [モンスターx v]\nadd (y) to [モンスターy v]\nadd (移動範囲) to [モンスター移動範囲 v]\nadd ((コスチューム) + (1)) to [コスチューム v]\nadd [1] to [表示 v]\n\nwhen I receive [もう一回 v]\n\nモンスター復活\n\nwhen flag clicked\nforever\n    ブロック名\nend\n\ndefine ブロック名\nset [a v] to [0]\nrepeat (length of [コスチューム v])\n    change [a v] by (1)\n    create clone of (_myself_ v)\n    動き ((item (a) of [モンスターx v]) - ([ceiling v] of (([cos v] of ((timer) * ((100) * ((100) / (item (a) of [モンスター移動範囲 v])))) ) * (item (a) of [モンスター移動範囲 v])) )) (item (a) of [モンスターy v]) (item (a) of [コスチューム v])\n    if <<touching (ルイージプラフォくん v)?> and <[0] > (y)>> then\n        replace item (a) of [表示 v] with [0]\n        set [y v] to [15]\n        set [踏んだよコインよろしく！ v] to ((視点x) + (x position))\n        set [踏んだよコインよろしく！2 v] to ((視点y) + (y position))\n        broadcast (コインへ v)\n    end\n    hide\nend\n\nwhen I receive [a v]\nwait (0) seconds\ndelete this clone\n\ndefine モンスター復活\ndelete all of [表示 v]\nrepeat (length of [コスチューム v])\n    add [1] to [表示 v]\nend\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\nif <(item (a) of [到達 v]) = [1]> then\n    switch costume to (コスチューム)\nelse\n    switch costume to ((コスチューム) + (-1))\nend\n\nwhen flag clicked\ngo to [back v] layer\ndelete all of [チェックポイントx v]\ndelete all of [チェックポイントy v]\ndelete all of [コスチューム v]\ndelete all of [到達 v]\nswitch costume to (コスチューム1 v)\n配置 [2400] [167] [1]\nhide\n\n配置 [2400] [0] [1]\n\nwhen I start as a clone\nforever\n    動き (item (a) of [チェックポイントx v]) (item (a) of [チェックポイントy v]) (item (a) of [コスチューム v])\nend\n\ndefine 配置 (x) (y) (コスチューム)\nswitch costume to (コスチューム)\ngo to x: ((x) - (視点x)) y: ((y) - (視点y))\nrepeat (2)\n    add (x) to [チェックポイントx v]\n    add (y) to [チェックポイントy v]\n    add [0] to [到達 v]\nend\nadd ((コスチューム) + (1)) to [コスチューム v]\nadd ((コスチューム) + (2)) to [コスチューム v]\n\nwhen I start as a clone\nforever\n    if <touching (ルイージプラフォくん v)?> then\n        if <(item (a) of [到達 v]) = [0]> then\n            start sound [Collect v]\n            set [復活x v] to (item (a) of [チェックポイントx v])\n            set [復活y v] to (item (a) of [チェックポイントy v])\n            replace item (a) of [到達 v] with [1]\n        end\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    ブロック名\nend\n\nwhen I receive [a v]\nwait (0) seconds\ndelete this clone\n\ndefine ブロック名\nset [a v] to [0]\nrepeat ((length of [コスチューム v]) / (2))\n    change [a v] by (2)\n    create clone of (_myself_ v)\nend\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\n動き (item (a) of [ゴールx v]) (item (a) of [ゴールy v]) (item (a) of [コスチューム 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 [a v] to [0]\nrepeat (length of [コスチューム v])\n    change [a v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [a v]\nwait (0) seconds\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <touching (ルイージプラフォくん v)?> then\n        set [動き v] to [1]\n        next costume\n    end\nend\n\nwhen flag clicked\ndelete all of [ゴールx v]\ndelete all of [ゴールy v]\ndelete all of [コスチューム v]\nswitch costume to (コスチューム1 v)\n配置 [4700] [10] [1]\nhide\n\nwhen flag clicked\nforever\n    ブロック名\nend\n\nwhen flag clicked\nset [動き v] to [0]\nforever\n    if <(動き) = [1]> then\n        broadcast (クリア v)\n        stop [this script v]\n    end\nend\n\n@最終形態\n\nwhen flag clicked\nhide\n\nwhen I receive [クリア v]\nshow\ngo to x: (-592) y: (0)\nrepeat until <(round (x position)) = [0]>\n    change x by (((0) - (x position)) / (5))\nend\nstop [all v]\n\n@サムネイル\n\nwhen flag clicked\nhide\n\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\n\nshow\n\n