Scratch! A platformer

Instructions: 日本語は下です!! \n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nThe first one was popular, so the second one!\nThis time too, it is set in space!\n\n▼ How to play\nYou can operate it with the arrow keys or tap.\nIt is mobile compatible.\n\n▼ Goal\n⭐ and ❤300 !!\nNumber of references 10000 !!\n\n▼ From the author\nWe have added more animations than last time!\nThe thorn gimmick is also new !!\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n第一弾が好評だったので第二弾!\n今回も宇宙を舞台としています！\n\n▼遊び方\n矢印キー、またはタップで操作できます。\nモバイル対応です。\n\n▼目標\n⭐と❤300!!⇨達成!\n参照数10000!!⇨達成!\n\n▼作者から\n前回よりもアニメーションを追加しました！\nトゲのギミックも新しいよ!!\n死んだときのモーションも変えたよ！

@Stage\n\n@Ground\n\nbroadcast (superdeeduperdeenextlvl v)\n\nwhen flag clicked\nset [level v] to [1]\nforever\n    switch costume to (level)\nend\n\n@shade\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    show\n    set [ghost v] effect to (75)\n    switch costume to (level)\n    go to [back v] layer\nend\n\n@character\n\nwhen I receive [superdeeduperdeenextlvl v]\nhide\nif <(level) = [1]> then\n    set [start x v] to [-200]\n    set [start y v] to [0]\nend\nif <(level) = [2]> then\n    set [start x v] to [-200]\n    set [start y v] to [100]\nend\nif <(level) = [3]> then\n    set [start x v] to [-200]\n    set [start y v] to [0]\nend\nif <(level) = [4]> then\n    set [start x v] to [-200]\n    set [start y v] to [0]\nend\nif <(level) = [5]> then\n    set [start x v] to [100]\n    set [start y v] to [0]\nend\nif <(level) = [6]> then\n    set [start x v] to [-200]\n    set [start y v] to [0]\nend\nif <(level) = [7]> then\n    set [start x v] to [170]\n    set [start y v] to [0]\nend\nif <(level) = [8]> then\n    set [start x v] to [-200]\n    set [start y v] to [0]\nend\nif <(level) = [9]> then\n    set [start x v] to [-200]\n    set [start y v] to [0]\nend\nif <(level) = [10]> then\n    set [start x v] to [-200]\n    set [start y v] to [180]\nend\nif <(level) = [11]> then\n    set [start x v] to [100]\n    set [start y v] to [0]\nend\nif <(level) = [12]> then\n    set [start x v] to [-240]\n    set [start y v] to [0]\nend\nif <(level) = [13]> then\nif <(level) = [14]> then\nif <(level) = [15]> then\nif <(level) = [16]> then\nstarting position\n\ndefine starting position\nhide\nshow\nset [fallspeed v] to [0]\ngo to x: (start x) y: (start y)\nset [runspeed v] to [0]\n\nwhen flag clicked\nset [level v] to [1]\ngo to x: (0) y: (0)\nhide\nset [ghost v] effect to (100)\nshow\nset [ghost v] effect to (0)\nset [takeoffspeed v] to [12]\nset [runspeed v] to [0]\nset [fallspeed v] to [0]\ngo to x: (-200) y: (0)\nforever\n    change [fallspeed v] by (-1)\n    set [runspeed v] to ((runspeed) * (0.9))\n    if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n        change [runspeed v] by (-1)\n    end\n    if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n        change [runspeed v] by (1)\n    end\n    if <touching (water v)?> then\n        change x by ((runspeed) / (3))\n    else\n        change x by (runspeed)\n    end\n    set [character x v] to (x position)\n    set [character y v] to (y position)\n    if <<touching (ground v)?> or <touching (moving ground v)?>> then\n        change y by (1)\n    end\n    if <<touching (ground v)?> or <touching (moving ground v)?>> then\n        change y by (1)\n    end\n    if <<touching (ground v)?> or <touching (moving ground v)?>> then\n        change y by (1)\n    end\n    if <<touching (ground v)?> or <touching (moving ground v)?>> then\n        change y by (1)\n    end\n    if <<touching (ground v)?> or <touching (moving ground v)?>> then\n        change y by (-4)\n        change x by ((runspeed) * (-1))\n    end\n    if <touching (water v)?> then\n        change y by ((fallspeed) / (3))\n    else\n        change y by (fallspeed)\n    end\n    set [y v] to (y position)\n    if <<touching (ground v)?> or <touching (moving ground v)?>> then\n        change y by ((fallspeed) - ((fallspeed) * (2)))\n        set [fallspeed v] to [0]\n    end\n    change y by (-1)\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <<touching (ground v)?> or <touching (moving ground v)?>>> then\n        set [fallspeed v] to [15]\n    end\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <touching (water v)?>> then\n        set [fallspeed v] to [5]\n    end\n    change y by (1)\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <touching (water v)?>> then\n        set [fallspeed v] to [5]\n    end\n    if <<<(x position) > [230]> or <key (n v) pressed?>> and <not <(level) = [16]>>> then\n        change [level v] by (1)\n        broadcast (superdeeduperdeenextlvl v)\n        wait until <not <key (n v) pressed?>>\n    end\n    if <[-180] > (y position)> then\n        starting position\n        broadcast (superdeeduperdeenextlvl v)\n    end\n    if <touching (spike v)?> then\n        starting position\n        broadcast (superdeeduperdeenextlvl v)\n    end\n    if <touching (enemies v)?> then\n        starting position\n        broadcast (superdeeduperdeenextlvl v)\n    end\n    if <touching (moving ground v)?> then\n        change y by (5)\n        if <touching (ground v)?> then\n            starting position\n            broadcast (superdeeduperdeenextlvl v)\n        end\n    end\n    if <touching (trampoline v)?> then\n        set [fallspeed v] to [18]\n        broadcast (jump v)\n    end\n    if <touching (spike2 v)?> then\n        starting position\n        broadcast (superdeeduperdeenextlvl v)\n    end\n    if <touching (smasher v)?> then\n        wait (3) seconds\n        set [level v] to [17]\n        broadcast (the end v)\n        hide\n        stop [this script v]\n    end\nend\n\nwait (0.5) seconds\n\nbroadcast (superdeeduperdeenextlvl v)\n\n\n\nsay [Uh-Oh] for (2) seconds\n\nif <(level) = [16]> then\n    say [Uh-Oh]\nend\n\n@Sprite1\n\nwhen flag clicked\nforever\n    fast\n    switch costume to (level)\nend\n\ndefine fast\ngo to (character v)\nset [ghost v] effect to (75)\ngo to [back v] layer\n\n@cloud\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\n    wait (pick random (2) to (5)) seconds\nend\n\nwhen I start as a clone\ngo to [back v] layer\ngo to x: (300) y: (pick random (190) to (120))\nswitch costume to (pick random (1) to (3))\nshow\nset [clone x v] to (pick random (-1) to (-3))\nset size to (pick random (50) to (75)) %\nset [ghost v] effect to (pick random (0) to (50))\ngo [backward v] (size) layers\nrepeat until <(x position) < [-300]>\n    change x by (clone x)\nend\ndelete this clone\n\n@spike\n\nwhen flag clicked\nset [level v] to [1]\nforever\n    switch costume to (level)\n    go to [back v] layer\n    go [forward v] (1) layers\nend\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n@Enemies\n\nwhen I start as a clone\ngo to [back v] layer\nif <(enemy type) = [1]> then\n    switch costume to (costume1 v)\n    if <(level) = [1]> then\n    if <(level) = [2]> then\n        go to x: (-77) y: (-15)\n        show\n        set [z test x v] to (x position)\n        set [z test y v] to (y position)\n        Act like a wierd spike\n    end\n    if <(level) = [3]> then\n    if <(level) = [4]> then\n    if <(level) = [5]> then\n        go to x: (-200) y: (-15)\n        show\n        set [z test x v] to (x position)\n        set [z test y v] to (y position)\n        Act like a wierd spike\n    end\n    if <(level) = [6]> then\n    if <(level) = [7]> then\n    if <(level) = [8]> then\n    if <(level) = [9]> then\n        go to x: (2) y: (150)\n        show\n        set [z test x v] to (x position)\n        set [z test y v] to (y position)\n        Act like a wierd spike\n    end\n    if <(level) = [10]> then\n        go to x: (148) y: (-10)\n        show\n        set [z test x v] to (x position)\n        set [z test y v] to (y position)\n        Act like a wierd spike\n    end\n    if <(level) = [11]> then\n        go to x: (137) y: (130)\n        show\n        set [z test x v] to (x position)\n        set [z test y v] to (y position)\n        Act like a wierd spike\n    end\n    if <(level) = [12]> then\n    if <(level) = [13]> then\n        go to x: (23) y: (0)\n        show\n        set [z test x v] to (x position)\n        set [z test y v] to (y position)\n        Act like a wierd spike\n    end\n    if <(level) = [14]> then\n    if <(level) = [15]> then\n    if <(level) = [16]> then\nend\nif <(enemy type) = [2]> then\n    switch costume to (costume14 v)\n    if <(level) = [1]> then\n    if <(level) = [2]> then\n    if <(level) = [3]> then\n        set [fish start x v] to [200]\n        set [fish start y v] to [-130]\n        swim like a fish\n        show\n    end\n    if <(level) = [4]> then\n        if <(enemy clone number) = [1]> then\n            set [fish start x v] to [50]\n            set [fish start y v] to [-130]\n            swim like a fish\n            show\n        end\n        if <(enemy clone number) = [2]> then\n            set [fish start x v] to [220]\n            set [fish start y v] to [-130]\n            swim like a fish\n            show\n        end\n    end\n    if <(level) = [5]> then\n    if <(level) = [6]> then\n        set [fish start x v] to [220]\n        set [fish start y v] to [-130]\n        swim like a fish\n        show\n    end\n    if <(level) = [7]> then\n    if <(level) = [8]> then\n        set [fish start x v] to [220]\n        set [fish start y v] to [-130]\n        swim like a fish\n        show\n    end\n    if <(level) = [9]> then\n    if <(level) = [10]> then\n    if <(level) = [11]> then\n        if <(enemy clone number) = [1]> then\n            set [fish start x v] to [75]\n            set [fish start y v] to [-150]\n            swim like a fish\n            show\n        end\n    end\n    if <(level) = [12]> then\n    if <(level) = [13]> then\n    if <(level) = [14]> then\n        if <(enemy clone number) = [2]> then\n            set [fish start x v] to [-50]\n            set [fish start y v] to [-30]\n            swim like a fish\n            show\n        end\n        if <(enemy clone number) = [3]> then\n            set [fish start x v] to [175]\n            set [fish start y v] to [-30]\n            swim like a fish\n            show\n        end\n    end\n    if <(level) = [15]> then\n    if <(level) = [16]> then\nend\n\nif <(enemy clone number) = [2]> then\n    set [fish start x v] to [125]\n    set [fish start y v] to [-150]\n    swim like a fish\n    show\nend\n\nwhen flag clicked\npoint in direction (90)\nforever\n    set rotation style [left-right v]\n    point towards (character v)\nend\n\ndelete this clone\n\ndelete this clone\n\nwhen I receive [die v]\nstop [other scripts in sprite v]\nbroadcast (okie dokie v)\n\nchange x by (25)\n\nwhen flag clicked\n\ndefine Act like a wierd spike\nset [blob runspeed v] to [0]\nforever\n    if <<((y position) + (10)) > (character y)> and <((y position) + (-10)) < (character y)>> then\n        switch costume to (costume1 v)\n        repeat (14)\n            change y by (1)\n        end\n        forever\n            change [blob fallspeed v] by (-1)\n            change x by (blob runspeed)\n            change y by (blob fallspeed)\n            if <<touching (ground v)?> or <touching (moving ground v)?>> then\n                change y by (1)\n            end\n            if <<touching (ground v)?> or <touching (moving ground v)?>> then\n                change y by (1)\n            end\n            if <<touching (ground v)?> or <touching (moving ground v)?>> then\n                change y by (1)\n            end\n            if <<touching (ground v)?> or <touching (moving ground v)?>> then\n                change y by (1)\n            end\n            if <<touching (ground v)?> or <touching (moving ground v)?>> then\n                change y by (-4)\n                change x by ((blob runspeed) * (-1))\n            end\n            if <<touching (ground v)?> or <touching (moving ground v)?>> then\n                change y by ((blob fallspeed) - ((blob fallspeed) * (2)))\n                set [blob fallspeed v] to [0]\n            end\n            change y by (-1)\n            if <(character x) > (x position)> then\n                point in direction (-90)\n                change [blob runspeed v] by (0.2)\n                if <(blob runspeed) > [5]> then\n                    set [blob runspeed v] to [5]\n                end\n            else\n                point in direction (90)\n                change [blob runspeed v] by (-0.2)\n                if <(blob runspeed) < [-5]> then\n                    set [blob runspeed v] to [-5]\n                end\n            end\n            change y by (1)\n            if <(y position) < [-160]> then\n                delete this clone\n            end\n            next costume\n            if <(costume [number v]) = [14]> then\n                switch costume to (costume1 v)\n            end\n            if <touching (moving ground v)?> then\n                change y by (4)\n            end\n        end\n    end\nend\n\nwhen I receive [superdeeduperdeenextlvl v]\ndelete this clone\n\nswitch costume to (costume1 v)\n\ndefine swim like a fish\nshow\nset rotation style [all around v]\nforever\n    show\n    go to x: (fish start x) y: (fish start y)\n    set [fishfallspeed v] to [18]\n    set [fishrunspeed v] to [-15]\n    repeat until <touching (_edge_ v)?>\n        change x by (fishrunspeed)\n        change y by (fishfallspeed)\n        point in direction ((fishrunspeed) * (-5))\n        change [fishfallspeed v] by (-1)\n        set [fishrunspeed v] to ((fishrunspeed) * (0.9))\n    end\n    hide\n    wait (0.4) seconds\nend\n\nwhen I receive [superdeeduperdeenextlvl v]\nforever\n    go to [front v] layer\n    hide\n    if <(level) = [1]> then\n    if <(level) = [2]> then\n        set [enemy type v] to [1]\n        set [badguy lvl v] to (level)\n        create clone of (_myself_ v)\n        wait until <not <(badguy lvl) = (level)>>\n    end\n    if <(level) = [3]> then\n        set [enemy type v] to [2]\n        set [badguy lvl v] to (level)\n        create clone of (_myself_ v)\n        wait until <not <(badguy lvl) = (level)>>\n    end\n    if <(level) = [4]> then\n        set [enemy clone number v] to [1]\n        set [enemy type v] to [2]\n        set [badguy lvl v] to (level)\n        create clone of (_myself_ v)\n        set [enemy clone number v] to [2]\n        set [enemy type v] to [2]\n        set [badguy lvl v] to (level)\n        create clone of (_myself_ v)\n        wait until <not <(badguy lvl) = (level)>>\n    end\n    if <(level) = [5]> then\n        set [enemy type v] to [1]\n        set [badguy lvl v] to (level)\n        create clone of (_myself_ v)\n        wait until <not <(badguy lvl) = (level)>>\n    end\n    if <(level) = [6]> then\n        set [enemy type v] to [2]\n        set [badguy lvl v] to (level)\n        create clone of (_myself_ v)\n        wait until <not <(badguy lvl) = (level)>>\n    end\n    if <(level) = [7]> then\n    if <(level) = [8]> then\n        set [enemy type v] to [2]\n        set [badguy lvl v] to (level)\n        create clone of (_myself_ v)\n        wait until <not <(badguy lvl) = (level)>>\n    end\n    if <(level) = [9]> then\n        set [enemy type v] to [1]\n        set [badguy lvl v] to (level)\n        create clone of (_myself_ v)\n        wait until <not <(badguy lvl) = (level)>>\n    end\n    if <(level) = [10]> then\n        set [enemy type v] to [1]\n        set [badguy lvl v] to (level)\n        create clone of (_myself_ v)\n        wait until <not <(badguy lvl) = (level)>>\n    end\n    if <(level) = [11]> then\n        set [enemy type v] to [1]\n        set [badguy lvl v] to (level)\n        create clone of (_myself_ v)\n        wait (0.1) seconds\n        set [enemy clone number v] to [1]\n        set [enemy type v] to [2]\n        set [badguy lvl v] to (level)\n        create clone of (_myself_ v)\n        wait until <not <(badguy lvl) = (level)>>\n    end\n    if <(level) = [12]> then\n    if <(level) = [13]> then\n        set [enemy type v] to [1]\n        set [badguy lvl v] to (level)\n        create clone of (_myself_ v)\n        wait until <not <(badguy lvl) = (level)>>\n    end\n    if <(level) = [14]> then\n        set [enemy clone number v] to [2]\n        set [enemy type v] to [2]\n        set [badguy lvl v] to (level)\n        create clone of (_myself_ v)\n        set [enemy clone number v] to [3]\n        set [enemy type v] to [2]\n        set [badguy lvl v] to (level)\n        create clone of (_myself_ v)\n        wait until <not <(badguy lvl) = (level)>>\n    end\n    if <(level) = [15]> then\n    if <(level) = [16]> then\nend\n\ngo to x: (-100) y: (-37)\nshow\nset [z test x v] to (x position)\nset [z test y v] to (y position)\nAct like a wierd spike\n\nbroadcast (superdeeduperdeenextlvl v)\n\nbroadcast (superdeeduperdeenextlvl v)\n\nset [enemy type v] to [2]\nset [badguy lvl v] to (level)\ncreate clone of (_myself_ v)\n\nset [enemy clone number v] to [1]\nset [enemy type v] to [2]\nset [badguy lvl v] to (level)\ncreate clone of (_myself_ v)\n\nif <(enemy clone number) = [2]> then\n    set [fish start x v] to [50]\n    set [fish start y v] to [-30]\n    swim like a fish\n    show\nend\n\n@water\n\nwhen flag clicked\nforever\n    switch costume to (level)\n    go to [back v] layer\n    set y to ((0) + ((10) * ([cos v] of (((timer) - (50)) * (300)) )))\n    set [ghost v] effect to (50)\nend\n\n@Sprite2\n\nwhen flag clicked\nforever\n    play sound [Poggersimdone v] until done\nend\n\n@Moving Ground\n\nwhen flag clicked\nhide\nset [level v] to [1]\n\nwhen flag clicked\ndelete all of [how much to move up v]\nsynthesize list\n\ndefine synthesize list\nadd [0] to [how much to move up v]\nadd [0] to [how much to move up v]\nadd [0] to [how much to move up v]\nadd [0] to [how much to move up v]\nadd [0] to [how much to move up v]\nadd [100] to [how much to move up v]\nadd [0] to [how much to move up v]\nadd [0] to [how much to move up v]\nadd [100] to [how much to move up v]\nadd [0] to [how much to move up v]\nadd [0] to [how much to move up v]\nadd [150] to [how much to move up v]\nadd [100] to [how much to move up v]\nadd [0] to [how much to move up v]\nadd [100] to [how much to move up v]\nadd [0] to [how much to move up v]\n\nwhen I receive [superdeeduperdeenextlvl v]\nif <(level) = [6]> then\n    go to x: (-24) y: (-97)\nend\nif <(level) = [9]> then\n    go to x: (-181) y: (-66)\nend\nif <(level) = [12]> then\n    go to x: (-79) y: (-105)\nend\nif <(level) = [13]> then\n    go to x: (0) y: (0)\nend\nif <(level) = [15]> then\n    go to x: (0) y: (0)\nend\nstop [other scripts in sprite v]\nbroadcast (moving wall v)\n\nbroadcast (superdeeduperdeenextlvl v)\n\nwhen I receive [moving wall v]\nhide\nforever\n    show\n    switch costume to (level)\n    change y by (2)\n    if <touching (character v)?> then\n        repeat ((item (level) of [how much to move up v]) / (4))\n            change y by (4)\n        end\n        wait until <not <touching (character v)?>>\n        repeat ((item (level) of [how much to move up v]) / (4))\n            change y by (-4)\n        end\n    end\n    change y by (-2)\nend\n\n@Trampoline\n\nwhen I receive [jump v]\nset [jump movement v] to [-5]\nrepeat until <(jump movement) = [2]>\n    change y by (jump movement)\n    change [jump movement v] by (1)\nend\n\nwhen flag clicked\nforever\n    if <(level) = [1]> then\n        hide\n    end\n    if <(level) = [2]> then\n        hide\n    end\n    if <(level) = [3]> then\n        hide\n    end\n    if <(level) = [4]> then\n        hide\n    end\n    if <(level) = [5]> then\n        hide\n    end\n    if <(level) = [6]> then\n        hide\n    end\n    if <(level) = [7]> then\n        show\n        go to x: (-196) y: (-49)\n        go to [back v] layer\n    end\n    if <(level) = [8]> then\n        hide\n    end\n    if <(level) = [9]> then\n        show\n        go to [back v] layer\n        go to x: (117) y: (-28)\n    end\n    if <(level) = [10]> then\n        hide\n    end\n    if <(level) = [11]> then\n        show\n        go to x: (-209) y: (-39)\n        go to [back v] layer\n    end\n    if <(level) = [12]> then\n        hide\n    end\n    if <(level) = [13]> then\n        show\n        go to x: (-145) y: (-67)\n        go to [back v] layer\n    end\n    if <(level) = [14]> then\n        hide\n    end\n    if <(level) = [15]> then\n    if <(level) = [16]> then\nend\n\n@spike2\n\nwhen flag clicked\nforever\n    turn right (4) degrees\n    if <(level) = [1]> then\n        hide\n    end\n    if <(level) = [2]> then\n        hide\n    end\n    if <(level) = [3]> then\n        hide\n    end\n    if <(level) = [4]> then\n        hide\n    end\n    if <(level) = [5]> then\n        hide\n    end\n    if <(level) = [6]> then\n        hide\n    end\n    if <(level) = [7]> then\n        show\n        go to x: (0) y: (93)\n        go to [back v] layer\n    end\n    if <(level) = [8]> then\n        show\n        go to x: (20) y: (-70)\n        go to [back v] layer\n    end\n    if <(level) = [9]> then\n        show\n        go to x: (-27) y: (-50)\n        go to [back v] layer\n    end\n    if <(level) = [10]> then\n        show\n        go to x: (-27) y: (-50)\n        go to [back v] layer\n    end\n    if <(level) = [11]> then\n        show\n        go to x: (228) y: (91)\n        go to [back v] layer\n    end\n    if <(level) = [12]> then\n        show\n        go to x: (101) y: (-87)\n        go to [back v] layer\n    end\n    if <(level) = [13]> then\n    if <(level) = [14]> then\n    if <(level) = [15]> then\n        show\n        go to x: (62) y: (-16)\n        go to [back v] layer\n    end\n    if <(level) = [16]> then\n        hide\n    end\nend\n\n@smasher\n\nwhen flag clicked\nset [level v] to [1]\nhide\nwait until <(level) = [16]>\ngo to x: (-2) y: (0)\nwait (1) seconds\ngo to [front v] layer\nshow\nrepeat until <touching (ground v)?>\n    change y by (-1)\nend\n\n\n\n@Sprite3\n\nwhen flag clicked\nhide\n\nwhen I receive [the end v]\ngo to [front v] layer\nshow\nwait (8) seconds\nstop [all v]\n\n