【大冒険】プラットフォーマー　#Platformer

Instructions: 　　　　　　【大冒険】プラットフォーマー\n　　　　　　　　　　～使い方～\n　　　　　　矢印キー　WASDキー　で操作\n　　　　　　クリアするまでのタイムも\n　　　　　　　あるので頑張ってください\n　　　　　　　　　　　【宣伝】\n　　　　　　　　　　　↓【night】↓\n　　　https://scratch.mit.edu/projects/709330942/

@Stage\n\nwhen flag clicked\nswitch backdrop to (イントロ v)\n\nwhen I receive [【偽り】next v]\nif <(れべる) = [7]> then\n    switch backdrop to (がお2ver v)\nend\n\nwhen I receive [next v]\nif <(れべる) = [10]> then\n    switch backdrop to (がお1ver v)\nend\n\nwhen I receive [終わり v]\nswitch backdrop to (がお3ver v)\n\nwhen I receive [スタート v]\nswitch backdrop to (がお1ver v)\nforever\n    play sound [【◆BGM】WORLD 00 v] until done\nend\n\n@イントロ\n\nwhen flag clicked\npoint in direction (90)\nhide\nset [ghost v] effect to (0)\nset [動き v] to [0]\ngo to x: (0) y: (200)\nイントロ [1]\nwait (5.5) seconds\nイントロ [2]\n\ndefine イントロ (gao)\nset [動き2 v] to (gao)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nif <(動き2) = [1]> then\n    switch costume to (コスチューム1 v)\n    repeat (30)\n        change y by (((0) - (y position)) / (5))\n    end\n    wait (0.2) seconds\n    repeat (60)\n        change [動き v] by (-15)\n        change y by ([cos v] of (動き) )\n    end\n    wait () seconds\n    repeat (30)\n        turn right (((200) - (direction)) / (10)) degrees\n    end\n    wait (0.2) seconds\n    repeat (30)\n        change x by (((-330) - (x position)) / (7))\n    end\n    hide\nend\n\nwhen I start as a clone\nshow\nif <(動き2) = [2]> then\n    switch costume to (コスチューム2 v)\n    go to x: (0) y: (200)\n    repeat (30)\n        change y by (((0) - (y position)) / (5))\n    end\n    wait (0.7) seconds\n    broadcast (スタート v)\n    repeat (30)\n        change y by (((500) - (y position)) / (8))\n    end\n    hide\nend\n\n@自分\n\nwhen I receive [next v]\n初期化\n\nwhen I receive [スタート v]\nshow\n初期化\nforever\n    if <key (down arrow v) pressed?> then\n        switch costume to (cube6 v)\n    end\n    if  then\n        change [このスプライトのx v] by (0.7)\n        if <key (down arrow v) pressed?> then\n            switch costume to (cube3 v)\n        else\n            switch costume to (cube1 v)\n        end\n    end\n    if  then\n        change [このスプライトのx v] by (-0.7)\n        if <key (down arrow v) pressed?> then\n            switch costume to (cube4 v)\n        else\n            switch costume to (cube2 v)\n        end\n    end\n    change x by (このスプライトのx)\n    if <touching (地面 v)?> then\n        change y by (1)\n        if <touching (地面 v)?> then\n            change y by (1)\n            if <touching (地面 v)?> then\n                change y by (1)\n                if <touching (地面 v)?> then\n                    change y by (1)\n                    if <touching (地面 v)?> then\n                        change y by (1)\n                        if <touching (地面 v)?> then\n                            change y by (1)\n                            if <touching (地面 v)?> then\n                                change x by ((0) - (このスプライトのx))\n                                change y by (-5)\n                                if  then\n                                    if <(このスプライトのx) > [0]> then\n                                        set [このスプライトのx v] to [-6]\n                                    else\n                                        set [このスプライトのx v] to [6]\n                                    end\n                                    set [このスプライトのy v] to [12]\n                                else\n                                    set [このスプライトのx v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    set [このスプライトのx v] to ((このスプライトのx) * (0.93))\n    change [このスプライトのy v] by (-1)\n    change y by (このスプライトのy)\n    if <touching (地面 v)?> then\n        change y by ((0) - (このスプライトのy))\n        set [このスプライトのy v] to [0]\n    end\n    change y by (-2)\n    if  then\n        if <touching (地面 v)?> then\n            set [このスプライトのy v] to [15]\n        end\n    end\n    change y by (1)\n    if <<not <<(れべる) = [6]> or <<(れべる) = [7]> or <(れべる) = [8]>>>> and <(y position) < [-170]>> then\n        初期化\n    end\n    if <[220] < (x position)> then\n        broadcast (next v)\n        hide\n    end\n    if <<<(れべる) = [6]> or <<(れべる) = [7]> or <(れべる) = [8]>>> and <(y position) < [-170]>> then\n        broadcast (【偽り】next v)\n        hide\n    end\n    if <<not <<<(れべる) = [7]> or <(れべる) = [8]>> or <(れべる) = [9]>>> and <<touching (トゲ v)?> or <touching (トラップ v)?>>> then\n        broadcast (もう一度 v)\n    end\n    if <<<(れべる) = [7]> or <<(れべる) = [8]> or <(れべる) = [9]>>> and <<touching (トゲ v)?> or <touching (トラップ v)?>>> then\n        broadcast (【偽り】もう一度 v)\n    end\n    if <touching (まち針w v)?> then\n        broadcast (もう一度 v)\n    end\nend\n\ndefine 初期化\nsay []\nshow\ngo to x: (-203) y: (-30)\nswitch costume to (cube1 v)\nset size to (100) %\npoint in direction (90)\ngo to [back v] layer\ngo [backward v] <key (down arrow v) pressed?> layers\nset [このスプライトのx v] to [0]\nset [このスプライトのy v] to [0]\n\nwhen flag clicked\nhide\nset [レベル v] to [0]\n\nwhen flag clicked\nforever\n    change [ターボ v] by (1)\nend\n\nwhen flag clicked\nforever\n    set [ターボ v] to [0]\n    wait (0.001) seconds\n    if <[3] < (ターボ)> then\n        stop [all v]\n    end\nend\n\ndefine 【偽り】初期化\nsay []\nshow\ngo to x: (0) y: (200)\nswitch costume to (cube1 v)\nset size to (100) %\npoint in direction (90)\ngo to [back v] layer\ngo [backward v] <key (down arrow v) pressed?> layers\nset [このスプライトのx v] to [0]\nset [このスプライトのy v] to [0]\n\nwhen I receive [もう一度 v]\n初期化\n\nwhen I receive [【偽り】next v]\n【偽り】初期化\n\nwhen I receive [【偽り】もう一度 v]\n【偽り】初期化\n\nwhen flag clicked\nforever\n    if <touching (水 v)?> then\n        go to [back v] layer\n        set [このスプライトのy v] to [-0.5]\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [このスプライトのy v] to [5.3]\n        end\n        if  then\n            set [このスプライトのx v] to [2]\n            if <key (down arrow v) pressed?> then\n                switch costume to (cube3 v)\n            else\n                switch costume to (cube1 v)\n            end\n        end\n        if  then\n            set [このスプライトのx v] to [-2]\n            if <key (down arrow v) pressed?> then\n                switch costume to (cube4 v)\n            else\n                switch costume to (cube2 v)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <touching (水 v)?>> then\n        wait until <touching (水 v)?>\n        play sound [落ちた音 v] until done\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        wait until <<key (up arrow v) pressed?> or <key (w v) pressed?>>\n        play sound [jump v] until done\n    end\nend\n\nwhen I receive [【偽り】もう一度 v]\nstart sound [Pew v]\n\nwhen I receive [もう一度 v]\nstart sound [Pew v]\n\n@地面\n\nwhen flag clicked\nset [れべる v] to [1]\nset size to (100) %\ngo to x: (0) y: (0)\npoint in direction (90)\nswitch costume to (1 v)\nhide\n\nwhen I receive [スタート v]\nswitch costume to (1 v)\nshow\n\nwhen I receive [next v]\nchange [れべる v] by (1)\nnext costume\nwait (0.6) seconds\nif <(れべる) = [15]> then\n    broadcast (終わり v)\nend\n\nwhen I receive [【偽り】next v]\nchange [れべる v] by (1)\nnext costume\nwait (0.6) seconds\n\nwhen I receive [変形 v]\nnext costume\n\nwhen flag clicked\nhide variable [time v]\nset [time v] to [0]\n\nwhen I receive [スタート v]\nrepeat until <(れべる) = [15]>\n    change [time v] by (1)\n    wait (1) seconds\nend\nshow variable [time v]\n\n@トゲ\n\nwhen flag clicked\nset size to (100) %\ngo to x: (0) y: (0)\npoint in direction (90)\nswitch costume to (コスチューム2 v)\ngo to [back v] layer\nhide\n\nwhen I receive [スタート v]\nhide\n\nwhen flag clicked\nforever\n    if <(れべる) = [2]> then\n        switch costume to (1 v)\n        show\n    end\n    if <(れべる) = [3]> then\n        repeat until <(れべる) = [4]>\n            point in direction (90)\n            go to x: (17) y: (-42)\n            go to [back v] layer\n            go to x: (17) y: (-42)\n            switch costume to (2 v)\n            show\n            glide (0.65) secs to x: (200) y: (-42)\n            glide (0.8) secs to x: (17) y: (-42)\n        end\n    end\n    if <(れべる) = [4]> then\n        point in direction (90)\n        switch costume to (3 v)\n        show\n    end\n    if <(れべる) = [5]> then\n        point in direction (90)\n        switch costume to (4 v)\n        show\n    end\n    if <(れべる) = [6]> then\n        point in direction (90)\n        switch costume to (5 v)\n        show\n    end\n    if <(れべる) = [7]> then\n        point in direction (90)\n        switch costume to (6 v)\n        show\n    end\n    if <(れべる) = [8]> then\n        hide\n    end\n    if <(れべる) = [9]> then\n        repeat until <(れべる) = [10]>\n            point in direction (90)\n            set size to (60) %\n            go to [back v] layer\n            go to x: (-33) y: (4)\n            switch costume to (2 v)\n            show\n            glide (2) secs to x: (145) y: (4)\n            glide (2) secs to x: (-33) y: (4)\n        end\n        if <(れべる) = [10]> then\n            point in direction (90)\n            go to x: (0) y: (0)\n            set size to (100) %\n            switch costume to (8 v)\n            show\n        end\n    end\n    if <(れべる) = [11]> then\n        repeat until <(れべる) = [12]>\n            point in direction (90)\n            set size to (60) %\n            go to [back v] layer\n            go to x: (149) y: (74)\n            switch costume to (9 v)\n            show\n            glide (1.5) secs to x: (149) y: (-100)\n            glide (1.5) secs to x: (149) y: (74)\n        end\n    end\n    if <(れべる) = [12]> then\n        repeat until <(れべる) = [13]>\n            point in direction (90)\n            go to [back v] layer\n            go to x: (150) y: (-57)\n            switch costume to (9 v)\n            show\n            glide (2.7) secs to x: (-160) y: (-57)\n            glide (2.7) secs to x: (150) y: (-57)\n        end\n    end\n    if <(れべる) = [13]> then\n        point in direction (90)\n        go to x: (0) y: (0)\n        set size to (100) %\n        switch costume to (10 v)\n        show\n    end\n    if <(れべる) = [14]> then\n        point in direction (90)\n        go to x: (0) y: (0)\n        set size to (100) %\n        switch costume to (11 v)\n        show\n    end\nend\n\nwhen I receive [終わり v]\nhide\n\nwhen flag clicked\nforever\n    if <(れべる) = [3]> then\n        turn right (10) degrees\n    end\nend\n\nwhen flag clicked\nforever\n    if <(れべる) = [9]> then\n        repeat until <(れべる) = [10]>\n            turn right (8) degrees\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(れべる) = [11]> then\n        repeat until <(れべる) = [12]>\n            turn right (7) degrees\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(れべる) = [12]> then\n        repeat until <(れべる) = [13]>\n            turn left (13) degrees\n        end\n    end\nend\n\n@水\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nforever\n    if <(れべる) = [10]> then\n        set [ghost v] effect to (30)\n        switch costume to (1 v)\n        show\n    end\n    if <(れべる) = [11]> then\n        set [ghost v] effect to (30)\n        switch costume to (2 v)\n        show\n    end\n    if <(れべる) = [12]> then\n        set [ghost v] effect to (30)\n        switch costume to (2 v)\n        show\n    end\n    if <(れべる) = [13]> then\n        set [ghost v] effect to (30)\n        switch costume to (3 v)\n        show\n    end\n    if <(れべる) = [14]> then\n        hide\n    end\n    if <(れべる) = [15]> then\n        set [ghost v] effect to (30)\n        switch costume to (4 v)\n        go to [back v] layer\n        show\n    end\nend\n\n@トラップ\n\nwhen flag clicked\nset size to (100) %\ngo to x: (0) y: (0)\npoint in direction (90)\nswitch costume to (1 v)\ngo to [back v] layer\nhide\n\nwhen I receive [スタート v]\nhide\n\nwhen flag clicked\nforever\n    if <<(れべる) = [5]> and <[80] < ([x position v] of [自分 v])>> then\n        switch costume to (1 v)\n        show\n    end\n    if <<(れべる) = [11]> and <[-70] < ([x position v] of [自分 v])>> then\n        switch costume to (2 v)\n        show\n    end\nend\n\nwhen I receive [終了 v]\nhide\n\nwhen flag clicked\nforever\n    if <not <<(れべる) = [5]> or <(れべる) = [11]>>> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(れべる) = [5]> and <not <[80] < ([x position v] of [自分 v])>>> then\n        hide\n    end\n    if <<(れべる) = [11]> and <not <[-70] < ([x position v] of [自分 v])>>> then\n        hide\n    end\nend\n\n@鍵\n\nwhen I receive [スタート v]\nhide\n\nwhen flag clicked\n\nwhen flag clicked\nset size to (30) %\ngo to x: (0) y: (0)\npoint in direction (90)\nswitch costume to (コスチューム2 v)\nhide\n\nwhen flag clicked\nforever\n    if <touching (自分 v)?> then\n        go to [front v] layer\n        go to (自分 v)\n        if <<(れべる) = [8]> and <touching (透明 v)?>> then\n            broadcast (スペースキー v)\n        else\n            broadcast (スペースキー☒ v)\n        end\n    end\nend\n\nwhen I receive [【偽り】next v]\nwait (0.3) seconds\nif <(れべる) = [8]> then\n    go to x: (195) y: (111)\n    switch costume to (1 v)\n    point in direction (60)\n    show\nend\n\nwhen I receive [変形 v]\nhide\n\nwhen flag clicked\nforever\n    if <<(れべる) = [8]> and <touching (透明 v)?>> then\n        if <key (space v) pressed?> then\n            broadcast (変形 v)\n        end\n    end\nend\n\n@サムネイル\n\nwhen flag clicked\nforever\n    reset timer\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen [timer v] > (0)\nhide variable [time v]\nshow\n\n@スペースキー\n\nwhen I receive [スペースキー v]\ngo to x: (127) y: (-55)\nshow\n\nwhen flag clicked\nhide\n\nwhen I receive [スペースキー☒ v]\nhide\n\nwhen I receive [変形 v]\nhide\n\n@透明\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(れべる) = [8]> then\n        switch costume to (1 v)\n        set size to (100) %\n        go to x: (36) y: (-118)\n        set [ghost v] effect to (100)\n        show\n    else\n        hide\n    end\nend\n\n@まち針w\n\nwhen flag clicked\nset size to (100) %\ngo to x: (0) y: (0)\npoint in direction (90)\nswitch costume to (コスチューム2 v)\ngo to [back v] layer\nhide\n\nwhen I receive [スタート v]\nhide\n\nwhen flag clicked\nforever\n    if <(れべる) = [12]> then\n        switch costume to (1 v)\n        show\n    end\n    if <(れべる) = [13]> then\n        hide\n    end\nend\n\nwhen I receive [終了 v]\nhide\n\n@背景\n\nwhen flag clicked\nset size to (100) %\ngo to x: (0) y: (0)\npoint in direction (90)\nswitch costume to (1 v)\nhide\n\nwhen I receive [スタート v]\nswitch costume to (1 v)\nshow\n\nwhen I receive [next v]\nnext costume\nwait (0.6) seconds\nif <(costume [number v]) = [16]> then\n    broadcast (終わり v)\nend\n\nwhen I receive [【偽り】next v]\nnext costume\nwait (0.6) seconds\nif <(costume [number v]) = [16]> then\n    broadcast (終わり v)\nend\n\nwhen flag clicked\nforever\n    if <touching (自分 v)?> then\n        go to [back v] layer\n    end\nend\n\n