slime platformer
@Stage\n\nwhen flag clicked\nswitch backdrop to (背景2 v)\nforever\n    reset timer\nend\n\nwhen I receive [start v]\nswitch backdrop to (blue sky 2  v)\n\nwhen I receive [next2 v]\nnext backdrop\n\n@スライム (hero)\n\nwhen flag clicked\nhide\ngo to [front v] layer\ngo [backward v] (2) layers\nset size to (100) %\nset drag mode [not draggable v]\ngo to x: (-201) y: (-112)\npoint in direction (90)\nhide variable [息 v]\nset [xvel v] to [0]\nset [yvel v] to [0]\n\nwhen flag clicked\nforever\n    if <<touching (海 v)?> and <(next time) = [0]>> then\n        show variable [息 v]\n        play sound [海に入ったとき v] until done\n        wait until <not <touching (海 v)?>>\n        hide variable [息 v]\n    end\nend\n\nwhen flag clicked\nset volume to (100) %\nset [息 v] to [0]\nforever\n    if <<touching (海 v)?> and <(next time) = [0]>> then\n        set [息 v] to [0]\n        repeat until <not <touching (海 v)?>>\n            wait (1) seconds\n            change [息 v] by (1)\n            if <(息) = [7]> then\n                start sound [息がッ!できないッ! v]\n            end\n            if <(息) = [10]> then\n                clear graphic effects\n                switch costume to (コスチューム2 v)\n                start sound [デス時 v]\n                repeat (20)\n                    change [ghost v] effect by (5)\n                    change size by (-5)\n                end\n                go to (音楽/リスポーン用 v)\n                repeat (20)\n                    change [ghost v] effect by (-5)\n                    change size by (5)\n                end\n                set size to (100) %\n                clear graphic effects\n                switch costume to (コスチューム1 v)\n            end\n        end\n        set [息 v] to [0]\n    end\nend\n\nwhen I receive [start v]\nshow\nwait (0.1) seconds\nswitch costume to (コスチューム1 v)\nset [x v] to [0]\nset [y v] to [0]\nforever\n    if <<(next time) = [0]> and <<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>>> then\n        change [x v] by (0.75)\n        point in direction (90)\n    end\n    if <<(next time) = [0]> and <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>>> then\n        change [x v] by (-0.75)\n        point in direction (-90)\n    end\n    if <touching (海 v)?> then\n        set [x v] to ((X) - (((X) / (10)) * (2)))\n        set [y v] to ((Y) - (((Y) / (10)) * (5)))\n    end\n    if <(stage\(japan\)) = [氷原]> then\n        set [x v] to ((X) * (0.9375))\n    else\n        set [x v] to ((X) * (0.9))\n    end\n    change x by (X)\n    if <touching (地形 v)?> then\n        change y by (1)\n    end\n    if <touching (地形 v)?> then\n        change y by (1)\n    end\n    if <touching (地形 v)?> then\n        change y by (1)\n    end\n    if <touching (地形 v)?> then\n        change y by (1)\n    end\n    if <touching (地形 v)?> then\n        change y by (1)\n    end\n    if <touching (地形 v)?> then\n        change x by ((X) * (-1))\n        change y by (-5)\n        if <<(next time) = [0]> and <<key (up arrow v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>>> then\n            set [y v] to [10]\n            if <(X) > [0]> then\n                set [x v] to [-5]\n            else\n                set [x v] to [5]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (-1)\n    if <<touching (地形 v)?> and <<(next time) = [0]> and <<key (up arrow v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>>>> then\n        set [y v] to [13.75]\n        start sound [ジャンプ v]\n    end\n    if <<touching (海 v)?> and <<(next time) = [0]> and <<key (up arrow v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>>>> then\n        change [y v] by (2)\n    end\n    if <(stage\(japan\)) = [宇宙]> then\n        change y by (1)\n        change [y v] by (-0.5)\n        change y by (Y)\n    else\n        change y by (1)\n        change [y v] by (-1)\n        change y by (Y)\n    end\n    if <touching (地形 v)?> then\n        change y by ((Y) * (-1))\n        set [y v] to [0]\n    end\n    if <(stage\(japan\)) = [空]> then\n        if <(y position) > [179]> then\n            broadcast (next level v)\n            glide (1) secs to (音楽/リスポーン用 v)\n            change [stage v] by (1)\n            set [x v] to [0]\n            set [y v] to [0]\n        end\n    else\n        if <(stage) = [20]> then\n            if <[-179] > (y position)> then\n                broadcast (next level v)\n                glide (1) secs to (音楽/リスポーン用 v)\n                change [stage v] by (1)\n                set [x v] to [0]\n                set [y v] to [0]\n            end\n        else\n            if <(x position) > [234]> then\n                broadcast (next level v)\n                glide (1) secs to (音楽/リスポーン用 v)\n                change [stage v] by (1)\n                set [x v] to [0]\n                set [y v] to [0]\n            end\n        end\n    end\n    if <<touching (障害物 v)?> or <<<touching (敵スライム v)?> and <<(Y) > [-5]> and <([costume # v] of [敵スライム v]) = [1]>>> or <<[-179] > (y position)> and <not <(stage) = [20]>>>>> then\n        clear graphic effects\n        switch costume to (コスチューム2 v)\n        start sound [デス時 v]\n        repeat (20)\n            change [ghost v] effect by (5)\n            change size by (-5)\n        end\n        go to (音楽/リスポーン用 v)\n        repeat (20)\n            change [ghost v] effect by (-5)\n            change size by (5)\n        end\n        set size to (100) %\n        switch costume to (コスチューム1 v)\n        set [x v] to [0]\n        set [y v] to [0]\n        clear graphic effects\n    end\n    if <touching (ばね v)?> then\n        set [y v] to [20]\n        start sound [ハイジャンプ v]\n    end\nend\n\nwhen I receive [敵削除 v]\nset [y v] to [25]\nswitch costume to (コスチューム3 v)\nwait (0.75) seconds\nswitch costume to (コスチューム1 v)\n\nwhen I receive [start v]\nforever\n    if <touching (ばね v)?> then\n        switch costume to (コスチューム3 v)\n        wait (0.75) seconds\n        switch costume to (コスチューム1 v)\n    end\n    wait until <not <touching (ばね v)?>>\nend\n\nwhen I receive [start v]\nforever\n    if <<key (down arrow v) pressed?> or <<mouse down?> and <(mouse y) < (y position)>>> then\n        repeat until <not <<key (down arrow v) pressed?> or <<mouse down?> and <(mouse y) < (y position)>>>>\n            switch costume to (コスチューム4 v)\n        end\n    end\n    switch costume to (コスチューム1 v)\n    wait until <<key (down arrow v) pressed?> or <<mouse down?> and <(mouse y) < (y position)>>>\nend\n\nwhen I receive [music v]\nif <([costume # v] of [音楽on/off v]) = [2]> then\n    set volume to (0) %\nelse\n    set volume to (100) %\nend\n\nwhen I receive [respawn v]\ngo to (音楽/リスポーン用 v)\nset [x v] to [0]\nset [y v] to [0]\nwait (0.1) seconds\n\n@敵スライム\n\nwhen flag clicked\nset volume to (100) %\nset [stage v] to [1]\nswitch costume to (コスチューム1 v)\nhide\n\nwhen I receive [next2 v]\nswitch costume to (コスチューム1 v)\nclear graphic effects\nhide\nif <(stage) = [4]> then\n    go to x: (-10) y: (-112)\n    create clone of (_myself_ v)\nelse\n    if <(stage) = [5]> then\n        go to x: (195) y: (-112)\n        create clone of (_myself_ v)\n    else\n        if <(stage) = [14]> then\n            go to x: (-100) y: (-50)\n            create clone of (_myself_ v)\n        end\n    end\nend\n\nwhen I start as a clone\nshow\nset rotation style [left-right v]\nif <(stage) = [4]> then\n    repeat until <not <(stage) = [4]>>\n        repeat (75)\n            change x by (2)\n            point in direction (90)\n        end\n        repeat (75)\n            change x by (-2)\n            point in direction (-90)\n        end\n    end\nelse\n    if <(stage) = [5]> then\n        repeat until <not <(stage) = [5]>>\n            repeat (30)\n                change x by (1)\n                point in direction (90)\n            end\n            repeat (30)\n                change x by (-1)\n                point in direction (-90)\n            end\n        end\n    else\n        if <(stage) = [14]> then\n            repeat until <not <(stage) = [14]>>\n                repeat (30)\n                    change x by (1)\n                    point in direction (90)\n                end\n                repeat (30)\n                    change x by (-1)\n                    point in direction (-90)\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <<touching (スライム \(hero\) v)?> and <<(Y) < [-5]> and <(next time) = [0]>>> then\n        start sound [ぷよん v]\n        broadcast (敵削除 v)\n        switch costume to (コスチューム5 v)\n        repeat (5)\n            change [ghost v] effect by (20)\n        end\n        delete this clone\n    end\nend\n\nwhen I receive [敵削除 v]\nswitch costume to (コスチューム5 v)\n\nwhen I receive [music v]\nif <([costume # v] of [音楽on/off v]) = [2]> then\n    set volume to (0) %\nelse\n    set volume to (100) %\nend\n\n@地形\n\nwhen flag clicked\nhide\nswitch costume to (コスチューム1 v)\n\nwhen I receive [next level v]\nnext costume\nshow\n\nwhen I receive [start v]\ngo to [back v] layer\ngo [forward v] (1) layers\ngo to x: (0) y: (0)\nshow\n\n@海\n\nwhen flag clicked\ngo to [front v] layer\ngo [backward v] (1) layers\nhide\nswitch costume to (コスチューム1 v)\n\nwhen I receive [next level v]\nshow\nnext costume\nclear graphic effects\nset [ghost v] effect to (50)\nset [海速さ v] to [0]\nset size to (100) %\nforever\n    set [海速さ v] to ((海速さ) * (0.9))\n    repeat until <(y position) > [40]>\n        change y by (海速さ)\n        change [海速さ v] by (0.01)\n    end\n    set [海速さ v] to [0]\n    repeat until <[0] > (y position)>\n        change y by ((0) - (海速さ))\n        change [海速さ v] by (0.01)\n    end\n    set [海速さ v] to [0]\nend\n\n@障害物\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (コスチューム1 v)\nhide\nrepeat (10)\n    go to [back v] layer\nend\n\nwhen I receive [next level v]\nnext costume\nshow\n\n@ばね\n\nwhen I receive [next level v]\nshow\nnext costume\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\ngo to [back v] layer\ngo [forward v] (3) layers\nswitch costume to (1 v)\n\n@太陽\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\ngo to [back v] layer\nshow\nclear graphic effects\nset [ghost v] effect to (50)\ngo to x: (-200) y: (140)\nset [大きさ速さ v] to [0]\nset size to (100) %\nforever\n    set [大きさ速さ v] to ((大きさ速さ) * (0.9))\n    repeat until <(size) > [200]>\n        change size by (大きさ速さ)\n        change [大きさ速さ v] by (0.2)\n    end\n    repeat until <[100] > (size)>\n        change size by ((0) - (大きさ速さ))\n        change [大きさ速さ v] by (-0.2)\n    end\n    set [大きさ速さ v] to [0]\nend\n\nwhen I receive [next2 v]\nif <(stage) = [15]> then\n    hide\nend\n\n@next\n\nwhen I receive [next level v]\nset [next time v] to [1]\nshow\nclear graphic effects\ngo to x: (480) y: (0)\nstart sound [コロコロ v]\nrepeat until <[-479] > (x position)>\n    change x by (-25)\n    turn left (15) degrees\nend\nhide\nset [next time v] to [0]\nbroadcast (next2 v)\n\nwhen flag clicked\nset [next time v] to [0]\ngo to [front v] layer\nhide\n\nwhen I receive [music v]\nif <([costume # v] of [音楽on/off v]) = [2]> then\n    set volume to (0) %\nelse\n    set volume to (100) %\nend\n\n@タイトル\n\nwhen I receive [substart v]\nerase all\nswitch costume to (コスチューム4 v)\ngo to [back v] layer\ngo to x: (0) y: (0)\nshow\n\nwhen flag clicked\nerase all\nhide\n\nwhen I receive [start v]\nhide\n\nwhen I receive [クラウド v]\nhide\n\nwhen I receive [クラウドx v]\nshow\n\nwhen [timer v] > (0)\ngo to [front v] layer\ngo [backward v] (2) layers\nshow\nswitch costume to (コスチューム3 v)\nforever\n    play sound [Inferno v] until done\nend\n\n@音楽/リスポーン用\n\nwhen flag clicked\nset volume to (100) %\nset [stage\(japan\) v] to [草原]\ngo to x: (-201) y: (-112)\n\nwhen I receive [next2 v]\nif <(stage) = [6]> then\n    set [stage\(japan\) v] to [海]\n    stop [other scripts in sprite v]\n    forever\n        forever\n            play sound [海 v] until done\n        end\n    end\nend\n\nwhen I receive [substart v]\nstop [other scripts in sprite v]\nforever\n    play sound [title v] until done\nend\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nforever\n    forever\n        play sound [草原 v] until done\n    end\nend\n\nwhen I receive [next2 v]\nif <(stage) = [11]> then\n    go to x: (0) y: (-112)\n    set [stage\(japan\) v] to [空]\n    stop [other scripts in sprite v]\n    forever\n        forever\n            play sound [空 v] until done\n        end\n    end\nend\n\nwhen I receive [next2 v]\nif <(stage) = [15]> then\n    go to x: (-201) y: (-112)\nend\n\nwhen I receive [next2 v]\nif <(stage) = [12]> then\n    go to x: (0) y: (-112)\nend\n\nwhen I receive [next2 v]\nif <(stage) = [16]> then\n    go to x: (-201) y: (-112)\n    set [stage\(japan\) v] to [宇宙]\n    stop [other scripts in sprite v]\n    forever\n        forever\n            play sound [宇宙 v] until done\n        end\n    end\nend\n\nwhen I receive [next2 v]\nif <(stage) = [21]> then\n    go to x: (-201) y: (-112)\n    set [stage\(japan\) v] to [氷原]\n    stop [other scripts in sprite v]\n    forever\n        forever\n            play sound [氷原 v] until done\n        end\n    end\nend\n\nwhen I receive [music v]\nif <([costume # v] of [音楽on/off v]) = [2]> then\n    set volume to (0) %\nelse\n    set volume to (100) %\nend\n\nwhen I receive [next2 v]\nif <(stage) = [26]> then\n    go to x: (-201) y: (-112)\n    set [stage\(japan\) v] to [マグマの城]\n    stop [other scripts in sprite v]\n    forever\n        forever\n            play sound [マグマの城 v] until done\n        end\n    end\nend\n\nwhen I receive [next2 v]\nif <(stage) = [31]> then\n    go to x: (-201) y: (-112)\n    set [stage\(japan\) v] to [海]\n    broadcast (endend v)\n    stop [other scripts in sprite v]\n    forever\n        forever\n            play sound [クリア v] until done\n        end\n    end\nend\n\n@スタート\n\nwhen flag clicked\nset [start v] to [0]\nhide\n\nwhen I receive [substart v]\ngo to x: (60) y: (-65)\nshow\n\nwhen this sprite clicked\nif <(start) = [1]> then\n\nwhen I receive [クラウド v]\nhide\n\nwhen I receive [クラウドx v]\nshow\n\nwhen I receive [substart v]\nrepeat until <(start) = [1]>\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (50)\n        wait until <not <touching (mouse-pointer v)?>>\n        clear graphic effects\n    end\nend\n\nwhen flag clicked\nbroadcast (substart v)\n\n@クラウド\n\nwhen flag clicked\nhide\n\nwhen I receive [substart v]\nset [クラウド用 v] to [0]\nswitch costume to (start v)\nset [start v] to [0]\ngo to x: (175) y: (-65)\nshow\nrepeat until <(start) = [1]>\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (50)\n        wait until <not <touching (mouse-pointer v)?>>\n        clear graphic effects\n    end\nend\n\nwhen I receive [start v]\nhide\n\nwhen this sprite clicked\nif <(start) = [1]> then\n\n@クラウド用\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [クラウド v]\ngo to [back v] layer\nshow\n\nwhen I receive [クラウドx v]\nhide\n\n@クラウド数字\n\nwhen flag clicked\nhide\n\nwhen I receive [クラウド v]\nクラウド用\n\nwhen I start as a clone\nshow\nwait until <(クラウド用) = [0]>\ndelete this clone\n\ndefine クラウド用\ngo to x: ((0) - ((5) * (length of (☁ world record)))) y: (0)\nset [クラウド文字用 v] to [1]\nrepeat (length of (☁ world record))\n    switch costume to (letter (クラウド文字用) of (☁ world record))\n    create clone of (_myself_ v)\n    change x by (10)\n    change [クラウド文字用 v] by (1)\nend\n\n@Follow\n\nwhen flag clicked\nset size to (50) %\nhide\n\nwhen I receive [intro start v]\nshow\n\nwhen I receive [intro end v]\nclear graphic effects\nrepeat (25)\n    change [ghost v] effect by (4)\nend\nhide\nwait (0.5) seconds\nbroadcast (text v)\n\nwhen [timer v] > (0)\nhide\n\n@time text\n\ndefine 数字表示\nset size to (50) %\ngo to x: (-120) y: (150)\nset [i v] to (length of [time])\nrepeat (length of [time])\n    switch costume to (join (stage\(japan\)) (letter (i) of [time]))\n    create clone of (_myself_ v)\n    change x by (-30)\n    change [i v] by (-1)\nend\nchange x by (30)\nset [i v] to (length of (time))\ngo to x: ((-40) + ((8) * (length of (time)))) y: (150)\nrepeat (length of (time))\n    switch costume to (join (stage\(japan\)) (letter (i) of (time)))\n    create clone of (_myself_ v)\n    change x by (-30)\n    change [i v] by (-1)\nend\n\nwhen I start as a clone\nshow\n\nwhen I receive [start v]\nset [time v] to [0]\nhide\n数字表示\nrepeat until <([costume # v] of [地形 v]) = [31]>\n    wait (1) seconds\n    change [time v] by (1)\n    broadcast (text X v)\n    数字表示\nend\n\nwhen I receive [text x v]\ngo [backward v] (1) layers\ndelete this clone\n\ndefine 数字表示(world)\nset size to (50) %\ngo to x: (-90) y: (100)\nset [i v] to (length of [world])\nrepeat (length of [world])\n    switch costume to (join (stage\(japan\)) (letter (i) of [world]))\n    create clone of (_myself_ v)\n    change x by (-30)\n    change [i v] by (-1)\nend\nchange x by (30)\nset [i v] to (length of (☁ world record))\ngo to x: ((0) + ((8) * (length of (time)))) y: (100)\nrepeat (length of (☁ world record))\n    switch costume to (join (stage\(japan\)) (letter (i) of (☁ world record)))\n    create clone of (_myself_ v)\n    change x by (-30)\n    change [i v] by (-1)\nend\n\nwhen I receive [endend v]\nbroadcast (text X v)\n数字表示\nif <<(time) < [50]> or <(☁ world record) = [0]>> then\n    set [☁ world record v] to (time)\n    数字表示(world)\nelse\n    数字表示(world)\nend\n\n@音楽on/off\n\nwhen flag clicked\nswitch costume to (コスチューム1 v)\nhide\n\nwhen I receive [start v]\nset size to (40) %\ngo to x: (-215) y: (-155)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (25)\n        wait until <not <touching (mouse-pointer v)?>>\n        clear graphic effects\n    end\nend\n\nwhen this sprite clicked\nif <(costume [number v]) = [1]> then\n    switch costume to (コスチューム2 v)\n    broadcast (music v)\nelse\n    switch costume to (コスチューム1 v)\n    broadcast (music v)\nend\n\nwhen [m v] key pressed\nif <(costume [number v]) = [1]> then\n    switch costume to (コスチューム2 v)\n    broadcast (music v)\nelse\n    switch costume to (コスチューム1 v)\n    broadcast (music v)\nend\n\n@音楽on/off3\n\nwhen flag clicked\nswitch costume to (コスチューム1 v)\nhide\n\nwhen I receive [start v]\nset size to (40) %\ngo to x: (-170) y: (-155)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (25)\n        wait until <not <touching (mouse-pointer v)?>>\n        clear graphic effects\n    end\nend\n\nwhen this sprite clicked\nbroadcast (respawn v)\n\nwhen [r v] key pressed\nbroadcast (respawn v)\n\n@cooltext361727880070229\n\nwhen flag clicked\ngo to x: (0) y: (125)\nhide\n\nwhen [timer v] > (0)\ngo to [front v] layer\nshow\nswitch costume to (cool text - thank you for playng 362095844823259 v)\n\n@スプライト1\n\nwhen flag clicked\nshow list [リンク v]\nhide\n\nwhen [timer v] > (0)\ngo to [front v] layer\nshow\ngo to x: (110) y: (-25)\ndelete all of [リンク v]\nadd [https://scratch.mit.edu/projects/412393133/] to [リンク v]\nforever\n    if <touching (mouse-pointer v)?> then\n        repeat until <not <touching (mouse-pointer v)?>>\n            hide list [リンク v]\n        end\n        show list [リンク v]\n    end\nend\n\n
矢印キーで操作します。\nOperate with the arrow keys.\n敵スライムの仕掛けと、タイムの仕掛けをすごく頑張りました!\nI did my best to tackle the enemy slime and the time!\n　　　　　　・・\nプログラムは全て自作です。\n...\nAll programs are self-made.