【scratch】athletic platformer


@Stage\n\nwhen flag clicked\nswitch backdrop to ( back v)\nforever\n    play sound [魔王魂  ファンタジー10 v] until done\nend\n\n@Hero\n\nwhen flag clicked\ngo to [front v] layer\ngo [backward v] (1) layers\nshow\nset size to (95) %\nswitch costume to (normal v)\nset drag mode [not draggable v]\ngo to x: (-190) y: (-50)\npoint in direction (90)\nset [ステージ v] to [1]\nset [xvel v] to [0]\nset [yvel v] to [0]\nforever\n    set rotation style [left-right v]\n    if <<<mouse down?> and <(x position) > (mouse x)>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n        change [xv v] by (-1)\n        switch costume to (left v)\n        if <<<<(y position) < (mouse y)> and <mouse down?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> and <<<(mouse x) < (x position)> and <mouse down?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>>> then\n            switch costume to (left up v)\n        end\n    end\n    if <<<mouse down?> and <(x position) < (mouse x)>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n        change [xv v] by (1)\n        switch costume to (right v)\n        if <<<<(y position) < (mouse y)> and <mouse down?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> and <<<(x position) < (mouse x)> and <mouse down?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>>> then\n            switch costume to (right up v)\n        end\n    end\n    if <not <key (any v) pressed?>> then\n        switch costume to (normal v)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching (stage v)?> then\n        change y by (1)\n        if <touching (stage v)?> then\n            change y by (1)\n            if <touching (stage v)?> then\n                change y by (1)\n                if <touching (stage v)?> then\n                    change y by (1)\n                    if <touching (stage v)?> then\n                        change y by (1)\n                        if <touching (stage v)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <<<mouse down?> and <(y position) < (mouse y)>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-7]\n                                else\n                                    set [xv v] to [7]\n                                end\n                                set [yv v] to [10]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (-1)\n    if <touching (stage v)?> then\n        if <<<mouse down?> and <(y position) < (mouse y)>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n            set [yv v] to [15]\n            point in direction ((Yv) * (0.5))\n        end\n    end\n    change y by (1)\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <touching (stage v)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    hide variable [xv v]\n    if <(x position) > [230]> then\n        broadcast (next level v)\n        change [level v] by (1)\n        set [yv v] to [0]\n        set [xv v] to [0]\n        go to x: (-190) y: (-50)\n    end\n    if <(y position) < [-170]> then\n        set [xv v] to [0]\n        set [yv v] to [0]\n        go to x: (-190) y: (-50)\n    end\n    if <touching (spike v)?> then\n        set [xv v] to [0]\n        set [yv v] to [0]\n        go to x: (-190) y: (-50)\n    end\nend\n\n@stage\n\nwhen flag clicked\nswitch costume to ( v)\nshow\ngo to x: (0) y: (0)\n\nwhen I receive [next level v]\nnext costume\n\n@spike\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nswitch costume to ( v)\n\nwhen I receive [next level v]\nnext costume\n\n@thumb\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\n@cm\n\nwhen flag clicked\nhide\nforever\n    wait (pick random (8) to (5)) seconds\n    show\n    start sound [pop v]\n    go to x: (150) y: (400)\n    point in direction (90)\n    set size to (100) %\n    repeat until <[135] > (y position)>\n        change y by (((2) - (y position)) / (20))\n    end\n    wait (2.9) seconds\n    repeat until <(y position) > [207]>\n        change y by ((y position) / (20))\n    end\n    hide\nend\n\n