undertale Platformer (demo)

Instructions: undertale platformer\n\narrow key:move\n\n作ってみたかったプラットフォーマーです\nまだ途中までしかできてません\n\n2019/6/14 demo公開

@Stage\n\n@platformer soul\n\ndefine platformer soul\nset rotation style [all around v]\npoint in direction (90)\nswitch costume to (blue_soul v)\nset size to (5) %\nshow\nforever\n    if <touching color (#ffff00)?> then\n        broadcast (platformer clear v)\n    end\n    if <touching color (#ff0000)?> then\n        broadcast (platformer miss v)\n    end\n    if <key (right arrow v) pressed?> then\n        change x by (4)\n        if <touching color (#ffffff)?> then\n            change x by (-4)\n        end\n    end\n    if <key (left arrow v) pressed?> then\n        change x by (-4)\n        if <touching color (#ffffff)?> then\n            change x by (4)\n        end\n    end\n    if <touching color (#ffffff)?> then\n        change y by (1)\n        if <touching color (#ffffff)?> then\n            change y by (1)\n            if <touching color (#ffffff)?> then\n                change y by (1)\n                if <touching color (#ffffff)?> then\n                    change y by (1)\n                    if <touching color (#ffffff)?> then\n                        change y by (1)\n                        if <touching color (#ffffff)?> then\n                            change y by (-5)\n                            if <key (up arrow v) pressed?> then\n                                set [yv v] to [11]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (yv)\n    if <touching color (#ffffff)?> then\n        change y by ((yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#ffffff)?> then\n        if <key (up arrow v) pressed?> then\n            set [yv v] to [13]\n        end\n    end\n    change y by (1)\n    if <(y position) < [-170]> then\n        broadcast (platformer miss v)\n    end\nend\n\nwhen I receive [platformer miss v]\ngo to x: (-200) y: (-134)\n\nwhen I receive [platformer clear v]\ngo to x: (-200) y: (-134)\n\nwhen flag clicked\ngo to x: (-200) y: (-134)\nset size to (5) %\nplatformer soul\n\n@Platformer\n\nwhen I receive [platformer clear v]\nchange [stage v] by (1)\nnext costume\nbroadcast (device v)\nrepeat (20)\n    change volume by (-5)\nend\nset volume to (0) %\nwait (0.5) seconds\nstop [other scripts in sprite v]\nbroadcast (song v)\nrepeat (20)\n    change volume by (5)\nend\nset volume to (100) %\n\nwhen flag clicked\ngo to [back v] layer\nset volume to (100) %\nset [stage v] to [1]\nbroadcast (song v)\nswitch costume to (1 v)\n\nwhen I receive [song v]\nforever\n    play sound (stage) until done\nend\n\n@device\n\nwhen I receive [device v]\nif <(stage) = [2]> then\n    switch costume to (red1 v)\n    red platform x: [177] y: [-180] speed: [3] sprite: [1] direction: [0]\nend\nif <(stage) = [4]> then\n    forever\n        snow\n        wait (0.05) seconds\n    end\nend\nif <(stage) = [6]> then\n    waterfall x: [-100]\n    waterfall x: [100]\n    forever\n        red spear x: (pick random (-239) to (239)) y: [179] speed: [4] dir. [180]\n        wait (1.5) seconds\n    end\nend\nif <(stage) = [7]> then\n    forever\n        red spear x: [-239] y: [-73] speed: [5] dir. [90]\n        wait (1) seconds\n    end\nend\n\nwhen I receive [platformer clear v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\ndefine red platform x: (x) y: (y) speed: (s) sprite: (sp) direction: (d)\nset rotation style [don't rotate v]\npoint in direction (d)\nswitch costume to (join [red] (sp))\nset [redplatform speed v] to (s)\nset [redplatform x v] to (x)\nset [redplatform y v] to (y)\nset [type v] to [1]\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset size to (100) %\nhide\n\ndefine snow\nset [type v] to [2]\nswitch costume to (snow v)\ngo to x: (pick random (240) to (-240)) y: (180)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nif <(type) = [1]> then\n    go to x: (redplatform x) y: (redplatform y)\n    forever\n        repeat until <<<(x position) > [239]> or <(x position) < [-239]>> or <<(y position) > [179]> or <(y position) < [-179]>>>\n            move (redplatform speed) steps\n        end\n        go to x: (redplatform x) y: (redplatform y)\n    end\nelse\n    if <(type) = [2]> then\n        set [ghost v] effect to (50)\n        repeat until <(y position) < [-179]>\n            change y by (-2)\n        end\n        delete this clone\n    else\n        if <(type) = [3]> then\n            set size to (150) %\n            forever\n                repeat (20)\n                    change y by (-2.5)\n                end\n                change y by (50)\n            end\n        else\n            if <(type) = [4]> then\n                set [ghost v] effect to (50)\n                wait (1) seconds\n                clear graphic effects\n                repeat until <<<(x position) > [239]> or <(x position) < [-239]>> or <<(y position) > [179]> or <(y position) < [-179]>>>\n                    move (redspear speed) steps\n                end\n                delete this clone\n            end\n        end\n    end\nend\n\ndefine waterfall x: (x)\nset rotation style [don't rotate v]\nset [type v] to [3]\ngo to x: (x) y: (0)\nswitch costume to (waterfall v)\ncreate clone of (_myself_ v)\n\ndefine red spear x: (x) y: (y) speed: (s) dir. (d)\nset [type v] to [4]\nset rotation style [all around v]\npoint in direction (d)\ngo to x: (x) y: (y)\nset [redspear speed v] to (s)\nswitch costume to (spear v)\ncreate clone of (_myself_ v)\n\n