Factory - Platformer

Instructions: It's time to show off your Ninja Skills. Help Scratch Cat fight rats, solve puzzles, and find fish to eat!\n\nControls for keyboard:\n- WASD / arrow keys: move, jump, climb, push.\n- SPACE: interact, attack.\n- R: reset\n- M: return to main menu\n\nControls for mobile:\n- Press your finger in the direction you want to move, jump, climb, or push.\n- Tap near Scratch Cat to interact or attack.

@Stage\n\nwhen flag clicked\nswitch backdrop to (背景1 v)\n\nwhen flag clicked\nforever\n    play sound [Undertale - Megalovania.mp3 v] until done\nend\n\nwhen [timer v] > (0)\nstart sound [click v]\nwait (1.5) seconds\nstart sound [click v]\nswitch backdrop to (背景2 v)\n\n@Player\n\ndefine 初期化\nset [ok v] to [1]\nshow\nswitch costume to (ソウル v)\nset size to (50) %\npoint in direction (90)\nset rotation style [left-right v]\ngo to x: (-200) y: ((0) + (<(L) = [4]> * (100)))\nset [x v] to [0]\nset [y v] to [0]\n\ndefine Program\nif <(OK) = [1]> then\n    show\n    if <<<mouse down?> and <(mouse x) > [0]>> or <<key (d v) pressed?> or <key (right arrow v) pressed?>>> then\n        change [x v] by (1.1)\n        point in direction ([abs v] of (direction) )\n    end\n    if <<<mouse down?> and <[0] > (mouse x)>> or <<key (a v) pressed?> or <key (left arrow v) pressed?>>> then\n        change [x v] by (-1.1)\n        point in direction (() - ([abs v] of (direction) ))\n    end\n    set [x v] to ((X) * (0.888))\n    change x by (X)\n    repeat (8)\n        if <touching (platformer v)?> then\n            change y by (1)\n        end\n    end\n    if <touching (platformer v)?> then\n        change x by (() - (X))\n        change y by (-8)\n        if <<<(mouse y) > [0]> and <mouse down?>> or <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n            set [y v] to [10]\n            if <(X) = ([abs v] of (X) )> then\n                set [x v] to [-6]\n            else\n                set [x v] to [6]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (-1)\n    if <touching (platformer v)?> then\n        if <<<(mouse y) > [0]> and <mouse down?>> 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 (1)\n    change [y v] by (-1)\n    change y by (Y)\n    if <touching (platformer v)?> then\n        change y by (() - (Y))\n        set [y v] to [0]\n    end\nend\n\nProgram\n\nwhen flag clicked\n初期化\nset [ok v] to [1]\nforever\n    if <(OK) = [1]> then\n        Program\n    end\nend\n\nwhen flag clicked\nforever\n    if <[235] < (x position)> then\n        set [ok v] to [1]\n        change [l v] by (1)\n        初期化\n        set [ok v] to [1]\n    end\n    if <(y position) < [-180]> then\n        change [☁ みんなが死んだ回数 v] by (1)\n        初期化\n    end\n    if <touching (スプライト18 v)?> then\n        change [☁ みんなが死んだ回数 v] by (1)\n        broadcast (GAMEOVER v)\n        broadcast (tya v)\n    end\nend\n\nwhen I receive [gameover v]\nset [ok v] to [0]\nswitch costume to (ソウル v)\nshow\nrepeat (10)\n    change x by (2)\n    wait (0.01) seconds\n    change x by (-2)\n    wait (0.01) seconds\nend\nchange [死亡回数 v] by (1)\nswitch costume to (ソウル ﾀﾋ v)\nwait (0) seconds\npoint in direction (0)\nswitch costume to (「パキッ…」赤 v)\nstart sound [heartbeatbreaker v]\nset [ソウル落ちろ v] to [5]\nwait (1) seconds\nstart sound [ソウル　壊れる v]\nhide\nset [dame v] to [1]\nrepeat (4)\n    next costume\n    create clone of (_myself_ v)\nend\nset [ソウル落ちろ v] to [5]\nrepeat (25)\n    change [ソウル落ちろ v] by (-1)\nend\nwait (1) seconds\nset [ok v] to [1]\n初期化\nbroadcast (hone v)\n\nif <not <(dame) = [1]>> then\n\nwhen I start as a clone\nshow\npoint in direction (pick random (-90) to (90))\nrepeat until <(y position) < [-170]>\n    change y by (ソウル落ちろ)\n    move (4) steps\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    reset timer\nend\n\nwhen [timer v] > (0)\nhide\n\nif <not <(L) = [10]>> then\n\n@Platformer\n\nwhen flag clicked\nset [l v] to [1]\ngo to [back v] layer\ngo to x: (0) y: (0)\nshow\ngo [forward v] (7) layers\nforever\n    switch costume to (L)\nend\n\nwhen [timer v] > (0)\nhide\n\nif <not <(L) = [10]>> then\n\n@スプライト18\n\nwhen flag clicked\ngo to x: (-150) y: (-96)\nshow\nforever\n    switch costume to ([costume # v] of [platformer v])\nend\n\nwhen I receive [hone v]\nshow\n\nwhen I receive [tya v]\nhide\n\nwhen [timer v] > (0)\nhide\n\n