mario platformer 2
@Stage\n\nwhen flag clicked\nswitch backdrop to (背景1 v)\n\nwhen I receive [start v]\nset volume to (50) %\nstart sound [Super World v]\nswitch backdrop to (背景2 v)\n\nwhen I receive [clear v]\nstop all sounds\n\n@player\n\nwhen flag clicked\nset [x2 v] to [0]\nset [y2 v] to [0]\nset [color v] effect to (0)\nhide\n\nwhen I receive [start v]\nshow\ngo to [front v] layer\nset [fff v] to [0]\nset [scrollx v] to [0]\nset [scrolly v] to [0]\ngo to x: (0) y: (0)\nset [x v] to [0]\nset [y v] to [0]\nforever\n    player\nend\n\ndefine 初期化\nhide\nrepeat until <<([abs v] of ((scrollY) - (Y2)) ) < [3]> and <([abs v] of ((scrollX) - (X2)) ) < [3]>>\n    change [scrollx v] by (round (((X2) - (scrollX)) / (5)))\n    change [scrolly v] by (round (((Y2) - (scrollY)) / (5)))\nend\nset [x v] to [0]\nset [y v] to [0]\ngo to x: (0) y: (0)\nbroadcast (モンスター v)\nshow\n\ndefine player\nif <(fff) = [0]> then\n    if <not <(username) = []>> then\n        say (username)\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        if <not <(俊敏) = [1]>> then\n            change [x v] by (2)\n        end\n        if <(俊敏) = [1]> then\n            change [x v] by (3)\n        end\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        if <not <(俊敏) = [1]>> then\n            change [x v] by (-2)\n        end\n        if <(俊敏) = [1]> then\n            change [x v] by (-3)\n        end\n    end\n    set [x v] to ((X) * (0.77))\n    change x by (round (X))\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 y by (1)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <touching (stage v)?> then\n        壁\n    end\n    change [y v] by (-2)\n    change y by (Y)\n    if <touching (stage v)?> then\n        床\n    end\n    change y by (-1)\n    if <<touching (stage v)?> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        if <not <(ジャンプ) = [1]>> then\n            set [y v] to [22]\n        end\n        if <(ジャンプ) = [1]> then\n            set [y v] to [24]\n        end\n    end\n    change y by (1)\n    change [scrollx v] by (round ((x position) / (10)))\n    change x by ((0) - ((round ((x position) / (10))) * <not <<(scrollX) < [0]> or <[5400] < (scrollX)>>>))\n    if <(scrollX) < [0]> then\n        set [scrollx v] to [0]\n    end\n    if <[5400] < (scrollX)> then\n        set [scrollx v] to [5400]\n    end\n    change [scrolly v] by (round ((y position) / (10)))\n    change y by ((0) - ((round ((y position) / (10))) * <not <(scrollY) < [0]>>))\n    if <(scrollY) < [0]> then\n        set [scrolly v] to [0]\n    end\n    if <<(y position) < [-150]> and <not <(scrollY) = [0]>>> then\n        set y to (-150)\n        change [y v] by (2)\n    end\n    if <touching (water v)?> then\n        水\n    end\n    if <(低速落下) = [1]> then\n        if <key (space v) pressed?> then\n            低速落下\n        end\n    end\nend\n\ndefine 壁\nchange y by (-4)\nset [qq v] to [0]\nrepeat until <<[100] < (QQ)> or <not <touching (stage v)?>>>\n    change [qq v] by (1)\n    change x by ((-1) * ((X) / ([abs v] of (X) )))\nend\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    set [y v] to [20]\n    set [x v] to ((-10) * ((X) / ([abs v] of (X) )))\nelse\n    set [x v] to [0]\nend\n\ndefine 床\nset [qq v] to [0]\nrepeat until <<[100] < (QQ)> or <not <touching (stage v)?>>>\n    change [qq v] by (1)\n    change y by ((-1) * ((Y) / ([abs v] of (Y) )))\nend\nset [y v] to [0]\n\nwhen I receive [start v]\nset [fff v] to [0]\nforever\n    if <<(y position) < [-180]> or <touching (障害物 v)?>> then\n        set [fff v] to [1]\n        初期化\n        set [fff v] to [0]\n    end\nend\n\nwhen I receive [初期化 v]\nset [fff v] to [1]\n初期化\nset [fff v] to [0]\n\nwhen I receive [clear v]\nhide\n\nwhen I receive [start v]\npoint in direction (-90)\nif <(skin) = [1]> then\n    switch costume to (スティーブ v)\nelse\n    switch costume to (アレックス v)\nend\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        point in direction (-90)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        point in direction (90)\n    end\nend\n\ndefine 水\nif <not <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n    set [y v] to [-1]\nend\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    set [y v] to [7]\nend\n\nwhen I receive [clear v]\nforever\n    hide\nend\n\ndefine 低速落下\nset [y v] to [-0.5]\n\nwhen I receive [start v]\nforever\n    if <touching (water v)?> then\n        go to [back v] layer\n    end\n    if <not <touching (water v)?>> then\n        go to [front v] layer\n    end\nend\n\n@stage\n\ndefine 配置 (x) (y) (コスチューム)\nset [1 v] to (x)\nset [2 v] to (y)\nset [3 v] to (コスチューム)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    switch costume to (コスチューム1 v)\n    go to x: ((1) - (scrollX)) y: ((2) - (scrollY))\n    if <<(x position) = ((1) - (scrollX))> and <(y position) = ((2) - (scrollY))>> then\n        show\n    else\n        hide\n    end\n    switch costume to ((1) + (3))\nend\n\nwhen I receive [start v]\nhide\n配置 [0] [0] [1]\n配置 [550] [0] [2]\n配置 [1100] [0] [3]\n配置 [1680] [0] [4]\n配置 [2150] [0] [5]\n配置 [2700] [0] [6]\n配置 [3100] [0] [7]\n配置 [3560] [0] [8]\n配置 [4020] [0] [9]\n配置 [4470] [0] [10]\n配置 [4940] [0] [11]\n\n配置 [1500] [0] [4]\n配置 [2000] [0] [5]\n配置 [2500] [300] [6]\n配置 [3000] [200] [7]\n配置 [3500] [0] [8]\n配置 [4000] [0] [9]\n配置 [4500] [0] [10]\n\nwhen I receive [clear v]\nhide\n\n@障害物\n\nwhen flag clicked\nswitch costume to (コスチューム1 v)\n\nwhen I receive [start v]\nhide\n配置 [1100] [0] [1]\n配置 [2700] [0] [2]\n配置 [3100] [0] [3]\n配置 [3560] [0] [4]\n配置 [4470] [0] [5]\n\ndefine 配置 (x) (y) (コスチューム)\nset [1 v] to (x)\nset [2 v] to (y)\nset [3 v] to (コスチューム)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    switch costume to (コスチューム3 v)\n    go to x: ((1) - (scrollX)) y: ((2) - (scrollY))\n    if <<(x position) = ((1) - (scrollX))> and <(y position) = ((2) - (scrollY))>> then\n        show\n    else\n        hide\n    end\n    switch costume to ((3) + (1))\nend\n\nwhen I receive [clear v]\nhide\n\n@water\n\nwhen I receive [start v]\nhide\n配置 [1680] [0] [1]\n配置 [2150] [0] [2]\n\ndefine 配置 (x) (y) (コスチューム)\nset [1 v] to (x)\nset [2 v] to (y)\nset [3 v] to (コスチューム)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset [ghost v] effect to (35)\nforever\n    switch costume to (コスチューム2 v)\n    go to x: ((1) - (scrollX)) y: ((2) - (scrollY))\n    if <<(x position) = ((1) - (scrollX))> and <(y position) = ((2) - (scrollY))>> then\n        show\n    else\n        hide\n    end\n    switch costume to ((1) + (3))\nend\n\nwhen I receive [clear v]\nhide\n\n@monster\n\nwhen I receive [start v]\nhide\n配置 [80] [0] [1] [30]\n配置 [660] [50] [1] [25]\n配置 [2200] [-47] [1] [35]\n配置 [2800] [40] [5] [15]\n配置 [3980] [-80] [3] [20]\n\ndefine 配置 (x) (y) (コスチューム) (move distance)\nset [move v] to (move distance)\nset [1 v] to (x)\nset [2 v] to (y)\nset [3 v] to (コスチューム)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    switch costume to (コスチューム1 v)\n    go to x: (((1) + (moveX)) - (scrollX)) y: ((2) - (scrollY))\n    if <<(x position) = (((1) + (moveX)) - (scrollX))> and <<(ok?) = [0]> and <(y position) = ((2) - (scrollY))>>> then\n        show\n    else\n        hide\n    end\n    switch costume to (3)\n    if <[0] < (X monster)> then\n        switch costume to ((2) + (3))\n    else\n        switch costume to ((1) + (3))\n    end\nend\n\nwhen I receive [モンスター v]\nset [ok? v] to [0]\n\nwhen I start as a clone\nset [movex v] to [0]\nset [x monster v] to [0]\nforever\n    repeat (move)\n        change [x monster v] by (1)\n        set [x monster v] to ((X monster) * (0.85))\n        change [movex v] by (X monster)\n    end\n    repeat (move)\n        change [x monster v] by (-1)\n        set [x monster v] to ((X monster) * (0.85))\n        change [movex v] by (X monster)\n    end\nend\n\nwhen I start as a clone\nset [ok? v] to [0]\nforever\n    if <touching (player v)?> then\n        if <(Y) < [0]> then\n            set [y v] to [20]\n            set [monster coinx v] to ((1) + (moveX))\n            set [monster coiny v] to (2)\n            broadcast (モンスターCOIN v)\n            change [ok? v] by (1)\n        else\n            broadcast (初期化 v)\n        end\n    end\nend\n\nwhen flag clicked\nswitch costume to (コスチューム2 v)\n\n@Emerald\n\nwhen flag clicked\nswitch costume to (コスチューム1 v)\n\nwhen I receive [start v]\nhide\nset [monster coin v] to [0]\n配置 [-140] [-10] [1]\n配置 [-180] [30] [1]\n配置 [-220] [70] [1]\n配置 [350] [0] [1]\n配置 [430] [0] [1]\n配置 [610] [-50] [1]\n配置 [610] [10] [1]\n配置 [900] [-30] [1]\n配置 [960] [-30] [1]\n配置 [1320] [35] [1]\n配置 [1935] [110] [1]\n配置 [1935] [150] [1]\n配置 [1935] [190] [1]\n配置 [1935] [230] [1]\n配置 [2600] [-50] [1]\n配置 [2640] [-50] [1]\n配置 [2480] [-45] [1]\n配置 [2520] [-45] [1]\n配置 [2950] [-50] [1]\n配置 [2990] [-50] [1]\n配置 [3250] [-50] [1]\n配置 [3290] [-50] [1]\n配置 [3330] [-50] [1]\n\ndefine 配置 (x) (y) (コスチューム)\nset [1 v] to (x)\nset [2 v] to (y)\nset [3 v] to (コスチューム)\ncreate clone of (_myself_ v)\nswitch costume to (コスチューム3 v)\n\nwhen I start as a clone\nforever\n    switch costume to (コスチューム3 v)\n    go to x: ((1) - (scrollX)) y: ((2) - (scrollY))\n    if <<(x position) = ((1) - (scrollX))> and <<(ok?) = [0]> and <(y position) = ((2) - (scrollY))>>> then\n        show\n    else\n        hide\n    end\n    switch costume to ((3) + (1))\nend\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        set [ok? v] to [1]\n        change [コイン v] by (1)\n    end\nend\n\nwhen I start as a clone\nif <(monster coin) = [1]> then\n    wait until <<(fff) = [1]> and <(ok?) = [1]>>\n    wait until <(fff) = [0]>\n    delete this clone\nend\n\nwhen I receive [モンスターcoin v]\nif <(costume [number v]) = [1]> then\n    wait (0.5) seconds\n    set [monster coin v] to [1]\n    配置 (monster coinX) ((monster coinY) + (10)) [1]\nend\n\nwhen flag clicked\nset [コイン v] to [0]\n\n@item\n\n@Selection button\n\nwhen flag clicked\nset [ボタン v] to [1]\nhide\nswitch costume to (play v)\ngo to x: (0) y: (-20)\n\nwhen I receive [選択ボタンを表示 v]\nshow\ngo to [front v] layer\nrepeat until <(ボタン) = [0]>\n    switch costume to (play v)\n    if <touching (mouse-pointer v)?> then\n        switch costume to (play2 v)\n        if <<mouse down?> and <(ボタンoff) = [0]>> then\n            wait until <not <mouse down?>>\n            set [ボタン v] to [0]\n            broadcast (START v)\n        end\n    end\nend\n\nwhen I receive [start v]\nhide\n\n@Selection button2\n\nwhen flag clicked\nset [ボタンoff v] to [0]\nhide\nswitch costume to (？ v)\ngo to x: (0) y: (-80)\n\nwhen I receive [選択ボタンを表示 v]\nshow\ngo to [front v] layer\nrepeat until <(ボタン) = [0]>\n    switch costume to (？ v)\n    if <touching (mouse-pointer v)?> then\n        switch costume to (？2 v)\n        if <<mouse down?> and <(ボタンoff) = [0]>> then\n            wait until <not <mouse down?>>\n            create clone of (_myself_ v)\n        end\n    end\nend\n\nwhen I receive [start v]\nhide\n\nwhen I start as a clone\nset [ボタンoff v] to [1]\nhide\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nswitch costume to (コスチューム1 v)\ngo to [front v] layer\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait until <mouse down?>\nwait until <not <mouse down?>>\nhide\nset [ボタンoff v] to [0]\n\n@スキン変更ボタン\n\nwhen flag clicked\nset [skin change v] to [1]\nhide\nswitch costume to (コスチューム1 v)\ngo to x: (190) y: (-120)\n\nwhen I receive [選択ボタンを表示 v]\nshow\ngo to [front v] layer\nrepeat until <(ボタン) = [0]>\n    switch costume to (コスチューム1 v)\n    if <touching (mouse-pointer v)?> then\n        switch costume to (コスチューム2 v)\n        if <<mouse down?> and <(ボタンoff) = [0]>> then\n            wait until <not <mouse down?>>\n            if <(skin change) = [1]> then\n                set [skin change v] to [2]\n            else\n                set [skin change v] to [1]\n            end\n        end\n    end\nend\n\nwhen I receive [start v]\nhide\n\n@タイトル画面\n\nwhen flag clicked\nset [ロード rand v] to [0]\nhide\ngo to x: (0) y: (0)\ngo to [front v] layer\nset [ghost v] effect to (100)\nswitch costume to (タイトル画面1 v)\nset [タイトル画面 rand v] to (pick random (1) to (3))\nif <(タイトル画面 rand) = [1]> then\n    switch costume to (タイトル画面1 v)\nend\nif <(タイトル画面 rand) = [2]> then\n    switch costume to (タイトル画面2 v)\nend\nif <(タイトル画面 rand) = [3]> then\n    switch costume to (タイトル画面3 v)\nend\n\nwhen I receive [タイトル画面 v]\ncreate clone of (_myself_ v)\nshow\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nbroadcast (選択ボタンを表示 v)\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nshow\nswitch costume to (ロゴ v)\ngo to [front v] layer\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\n\nwhen I receive [start v]\nhide\ndelete this clone\n\n@スプライト1\n\ngo to x: (140) y: (-74)\n\nwhen flag clicked\nerase all\ngo to x: (-134) y: (-58)\nhide\nswitch costume to (ロード v)\nwait (1) seconds\ngo to [front v] layer\nstamp\nrepeat until <(x position) > [139]>\n    set [ロード rand v] to (pick random (20) to (50))\n    repeat (ロード rand)\n        if <not <(x position) > [139]>> then\n            change x by (1)\n            stamp\n        end\n    end\n    wait (0.3) seconds\nend\nwait (0.5) seconds\nbroadcast (タイトル画面 v)\n\nwhen I receive [選択ボタンを表示 v]\nhide\nerase all\n\n@skin Selection \n\nwhen flag clicked\nhide\nswitch costume to (スティーブ v)\ngo to x: (185) y: (-50)\n\nwhen I receive [選択ボタンを表示 v]\nshow\ngo to [front v] layer\nrepeat until <(ボタン) = [0]>\n    if <(skin change) = [1]> then\n        switch costume to (スティーブ v)\n        set [skin v] to [1]\n    end\n    if <(skin change) = [2]> then\n        switch costume to (アレックス v)\n        set [skin v] to [2]\n    end\nend\n\nwhen I receive [start v]\nhide\n\n@GOAL\n\nwhen flag clicked\nset [goal v] to [0]\nswitch costume to (コスチューム1 v)\n\nwhen I receive [start v]\nhide\n配置 [5145] [10] [1]\n\ndefine 配置 (x) (y) (コスチューム)\nset [1 v] to (x)\nset [2 v] to (y)\nset [3 v] to (コスチューム)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    switch costume to (コスチューム3 v)\n    go to x: ((1) - (scrollX)) y: ((2) - (scrollY))\n    if <<(x position) = ((1) - (scrollX))> and <(y position) = ((2) - (scrollY))>> then\n        show\n    else\n        hide\n    end\n    switch costume to ((3) + (1))\nend\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        set [fff v] to [1]\n        set [goal v] to [1]\n        broadcast (clear v)\n        stop [this script v]\n    end\nend\n\n@TIME\n\nwhen I receive [clear v]\nset [time v] to (timer)\ngo to [front v] layer\nshow\nset [pixelate v] effect to (100)\nrepeat (20)\n    change [pixelate v] effect by (-5)\nend\nshow variable [time v]\n\nwhen flag clicked\nhide\nset [time v] to [0]\nhide variable [time v]\n\nwhen I receive [start v]\nreset timer\n\n@サムネ\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n@スプライト2\n\nwhen flag clicked\nhide variable [コイン v]\nset [shop v] to [0]\nhide\ngo to x: (160) y: (-150)\n\nwhen I receive [start v]\nshow\ngo to [front v] layer\nforever\n    if <touching (mouse-pointer v)?> then\n        repeat (8)\n            change y by (20)\n        end\n        show variable [コイン v]\n        set [shop v] to [1]\n        wait until <not <touching (mouse-pointer v)?>>\n        hide variable [コイン v]\n        set [shop v] to [0]\n        repeat (8)\n            change y by (-20)\n        end\n    end\nend\n\nwhen I receive [clear v]\nhide\n\n@スプライト3\n\nwhen flag clicked\nhide\nset [俊敏 v] to [0]\ngo to x: (200) y: (-49)\nswitch costume to (コスチューム1 v)\n\nwhen I receive [start v]\nforever\n    hide\n    if <(shop) = [1]> then\n        if <not <(俊敏) = [1]>> then\n            switch costume to (コスチューム1 v)\n        end\n        if <(俊敏) = [1]> then\n            switch costume to (コスチューム3 v)\n        end\n        go to [front v] layer\n        show\n        if <<touching (mouse-pointer v)?> and <not <(俊敏) = [1]>>> then\n            switch costume to (コスチューム2 v)\n            if <<mouse down?> and <(コイン) > [4]>> then\n                set [俊敏 v] to [1]\n                change [コイン v] by (-5)\n            end\n        end\n    end\nend\n\nwhen I receive [clear v]\nhide\n\n@スプライト4\n\nwhen flag clicked\nhide\nset [ジャンプ v] to [0]\ngo to x: (200) y: (-95)\nswitch costume to (コスチューム1 v)\n\nwhen I receive [start v]\nforever\n    hide\n    if <(shop) = [1]> then\n        if <not <(ジャンプ) = [1]>> then\n            switch costume to (コスチューム1 v)\n        end\n        if <(ジャンプ) = [1]> then\n            switch costume to (コスチューム3 v)\n        end\n        go to [front v] layer\n        show\n        if <<touching (mouse-pointer v)?> and <not <(ジャンプ) = [1]>>> then\n            switch costume to (コスチューム2 v)\n            if <<mouse down?> and <(コイン) > [9]>> then\n                set [ジャンプ v] to [1]\n                change [コイン v] by (-10)\n            end\n        end\n    end\nend\n\nwhen I receive [clear v]\nhide\n\n@スプライト5\n\nwhen flag clicked\nhide\nset [低速落下 v] to [0]\nswitch costume to (コスチューム1 v)\ngo to x: (200) y: (-140)\n\nwhen I receive [start v]\nforever\n    hide\n    if <(shop) = [1]> then\n        if <not <(低速落下) = [1]>> then\n            switch costume to (コスチューム1 v)\n        end\n        if <(低速落下) = [1]> then\n            switch costume to (コスチューム3 v)\n        end\n        go to [front v] layer\n        show\n        if <<touching (mouse-pointer v)?> and <not <(低速落下) = [1]>>> then\n            switch costume to (コスチューム2 v)\n            if <<mouse down?> and <(コイン) > [9]>> then\n                set [低速落下 v] to [1]\n                change [コイン v] by (-10)\n            end\n        end\n    end\nend\n\nwhen I receive [clear v]\nhide\n\n
CONTROLS:\n⫸ Player 1 (Blue): WAD keys\n⫸ Player 2 (Orange): Arrow keys\n⫸ R to reset level, M to toggle music, P to show variables, K to toggle effects, and N to skip levels with timed buttons. This project is not mobile-friendly.\n\nGOAL:\nThis is a 2-player cooperative platformer game. (You can play it with 1 person, but it doesn't work as well.) Can you beat all 30 levels by working together to overcome each challenge?\n\nIf you liked this, try out my other projects! Try this: https://scratch.mit.edu/projects/187096627/