World Platformer

Instructions: 旗を二回押す\nPress the flag twice\n\nLeft / right key movement\nUp key jump\nDown key Crouch\n\n左右キー移動\n上キージャンプ\n下キーしゃがむ

@Stage\n\nwhen I receive [start v]\nswitch backdrop to (1 v)\nforever\n    if <(Stage) = [6]> then\n        switch backdrop to (2 v)\n    end\n    if <(Stage) = [10]> then\n        switch backdrop to (3 v)\n    end\n    if <(Stage) = [16]> then\n        switch backdrop to (4 v)\n    end\nend\n\nwhen I receive [start v]\nforever\n    play sound [Tobu - Hope.mp3 v] until done\nend\n\n@Player\n\nhide\n\nnext backdrop\n\nif <(Stage) = [19]> then\n    set [☁ your time v] to (timer)\n    broadcast (記録表示 v)\n    show variable [☁ world record v]\n    show variable [☁ your time v]\n    if <(☁ World Record) > [50]> then\n        set [☁ world record v] to (☁ Your Time)\n    end\n    stop [this script v]\nend\n\nwhen I start as a clone\nclear graphic effects\nset size to (100) %\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-10)\nend\ndelete this clone\n\nstart sound [BGM v]\n\nchange y by ((0) - (y))\nset [y v] to [0]\n\nwhen I receive [start v]\ngo to x: (-188) y: (-75)\nset rotation style [left-right v]\npoint in direction (90)\nset size to (100) %\nset [x v] to [0]\nset [y v] to [0]\nshow\n\nwhen I receive [start v]\nhide variable [☁ world record v]\nhide variable [☁ your time v]\nreset timer\nswitch costume to (1 v)\nswitch backdrop to (2 v)\nshow\nforever\n    change y by (1)\n    change [y v] by (-1)\n    if <<key (right arrow v) pressed?> or <<(mouse x) > [1]> and <mouse down?>>> then\n        change [x v] by (1)\n        point in direction (90)\n        create clone of (_myself_ v)\n    end\n    if <<key (left arrow v) pressed?> or <<(mouse x) < [-1]> and <mouse down?>>> then\n        change [x v] by (-1)\n        point in direction (-90)\n        create clone of (_myself_ v)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (-4)\n        change x by ((x) * (-1))\n        set [y v] to [0]\n        if <<key (up arrow v) pressed?> or <<(mouse y) > [50]> and <mouse down?>>> then\n            set [y v] to [15]\n            if <(x) > [0]> then\n                set [x v] to [-10]\n            else\n                set [x v] to [10]\n            end\n        else\n            set [y v] to [0]\n        end\n    end\n    change y by (y)\n    if <touching (ground v)?> then\n        change y by ((0) - (y))\n        set [y v] to [0]\n    end\n    if <touching (saw v)?> then\n        set [x v] to [0]\n        set [y v] to [0]\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n        set [ghost v] effect to (0)\n        go to x: (-188) y: (-75)\n    end\n    if <touching (red bar v)?> then\n        set [x v] to [0]\n        set [y v] to [0]\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n        set [ghost v] effect to (0)\n        go to x: (-188) y: (-75)\n    end\n    change y by (-1)\n    if <<<key (up arrow v) pressed?> and <touching (ground v)?>> or <<mouse down?> and <<touching (ground v)?> and <(mouse y) > [50]>>>> then\n        set [y v] to [15]\n        create clone of (_myself_ v)\n    end\n    if <touching (don't touch v)?> then\n        set [x v] to [0]\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n        set [ghost v] effect to (0)\n        go to x: (-188) y: (-75)\n    end\n    if <touching color (#000aff)?> then\n        set [y v] to [23]\n        create clone of (_myself_ v)\n        broadcast (アニメーション v)\n    end\n    if <<key (down arrow v) pressed?> or <<[-50] > (mouse y)> and <mouse down?>>> then\n        switch costume to (2 v)\n        if <[-166] > (y position)> then\n            go to x: (-189) y: (-75)\n        end\n    else\n        switch costume to (1 v)\n        if <[-166] > (y position)> then\n            go to x: (-188) y: (-75)\n        end\n    end\n    if <(x position) > [215]> then\n        broadcast (Goal v)\n        go to x: (-188) y: (-75)\n    end\nend\n\nwhen flag clicked\nhide\n\nset [☁ world record v] to [200]\n\n@Ground\n\nwhen I receive [goal v]\nnext costume\n\nwhen I receive [start v]\nshow\ngo to [back v] layer\nswitch costume to (コスチューム1 v)\nforever\n    set [stage v] to (costume [number v])\nend\n\nwhen flag clicked\nswitch costume to (コスチューム1 v)\nhide variable [☁ world record v]\nhide variable [☁ your time v]\nhide\n\n@スプライト3\n\nwhen flag clicked\nhide\n\nwhen I receive [表示 v]\nset [ghost v] effect to (15)\ngo to x: (0) y: (0)\nswitch costume to (2 v)\nshow\n\nwhen I receive [記録表示 v]\nhide\n\nwhen I receive [start v]\nshow\n\n@数字2\n\nwhen I receive [タイマー止める v]\nstop [other scripts in sprite v]\n\nwhen I receive [記録表示 v]\nstop [other scripts in sprite v]\nbroadcast (消せ! v)\nwait (0.5) seconds\n書く (CLEARまでにかかった時間) X [-190] Y [80] 大きさ [180] 明るさ [-100] 透明度 [50] 色 [0]\nif <(☁ ハイスコア) > (CLEARまでにかかった時間)> then\n    set [☁ ハイスコア v] to (CLEARまでにかかった時間)\nend\n書く (☁ ハイスコア) X [-190] Y [5] 大きさ [180] 明るさ [0] 透明度 [50] 色 [0]\n\nwhen I receive [表示 v]\nbroadcast (消せ! v)\n\ndefine 書く (数字) X (x) Y (y) 大きさ (大きさ) 明るさ (明るさ) 透明度 (透明度) 色 (色)\nset [color v] effect to (色)\nset [書けた? v] to [0]\nhide\ngo to [front v] layer\ngo to x: (x) y: (y)\nset size to (大きさ) %\nset [brightness v] effect to (明るさ)\nset [ghost v] effect to (透明度)\nset [数字の変数 v] to [0]\nrepeat (length of (数字))\n    change [数字の変数 v] by (1)\n    switch costume to (letter (数字の変数) of (数字))\n    create clone of (_myself_ v)\n    change x by ((大きさ) / (9.5))\nend\nset [書けた? v] to [1]\n\nwhen I start as a clone\ngo to [front v] layer\nwait until <(書けた?) = [1]>\nshow\n\nwhen I receive [消せ! v]\ndelete this clone\n\nwhen flag clicked\n\nwhen I receive [start v]\nset [clearまでにかかった時間 v] to [0]\nforever\n    書く (CLEARまでにかかった時間) X [160] Y [148] 大きさ [100] 明るさ [-100] 透明度 [50] 色 [0]\n    wait (0.9) seconds\n    broadcast (消せ! v)\n    change [clearまでにかかった時間 v] by (1)\nend\n\nwhen I receive [start v]\nshow\n\n@Bouncer \n\nwhen I receive [let's go v]\nhide\n\nwait (1.5) seconds\n\ngo to x: (-92) y: (-132)\n\nwhen flag clicked\nhide\nforever\n    if <(Stage) = [4]> then\n        show\n        go to x: (-70) y: (-132)\n    else\n        if <(Stage) = [11]> then\n            go to x: (-111) y: (-126)\n            show\n        else\n            hide\n        end\n    end\nend\n\ngo to x: (-109) y: (-90)\n\nwhen I receive [アニメーション v]\nswitch costume to (コスチューム1 v)\nwait (0.05) seconds\nswitch costume to (コスチューム2 v)\nwait (0.05) seconds\nswitch costume to (コスチューム3 v)\nwait (0.05) seconds\nswitch costume to (コスチューム4 v)\nwait (0.05) seconds\nswitch costume to (コスチューム1 v)\n\nshow\ngo to x: (-50) y: (-109)\n\ngo to x: (-109) y: (-90)\n\n@Don't touch\n\nwhen flag clicked\nswitch costume to (コスチューム1 v)\ngo to x: (0) y: (0)\nshow\n\nwhen I receive [goal v]\nnext costume\n\n@スプライト1\n\nwhen flag clicked\nshow\ngo to [front v] layer\nset [ghost v] effect to (100)\n\n@スプライト4\n\nwhen flag clicked\nset [ターボ対策 v] to [0]\nwait (1) seconds\n\nwhen flag clicked\nforever\n    set [ターボ対策 v] to [0]\n    wait (1) seconds\nend\n\nwhen flag clicked\nhide\nset [ターボ対策 v] to [0]\nforever\n    repeat (50)\n        change [ターボ対策 v] by (1)\n    end\n    say ((pick random (1) to (10)) + ((pick random (1) to (10)) / (pick random (1) to (10))))\n    say []\nend\n\nwhen flag clicked\nforever\n    if <[39] < (ターボ対策)> then\n        set [ターボ対策 v] to [0]\n        broadcast (最後 v)\n        stop [all v]\n    end\nend\n\n@Saw\n\nwhen flag clicked\nhide\nforever\n    turn right (15) degrees\nend\n\nwhen flag clicked\nforever\n    if <(Stage) = [8]> then\n        go to x: (-11) y: (-146)\n        set size to (70) %\n        show\n    else\n        hide\n    end\nend\n\ngo [forward v] (1) layers\n\ngo to x: (11) y: (-132)\n\nif <(Stage) = [9]> then\n    go to x: (18) y: (135)\n    set size to (70) %\n    show\nelse\nend\n\ngo to x: (5) y: (-95)\n\ngo to x: (11) y: (-132)\n\nshow\n\n@red bar\n\nwhen flag clicked\nforever\n    if <(Stage) = [12]> then\n        show\n        go to x: (9) y: (-37)\n        repeat until <(Stage) = [13]>\n            glide (2) secs to x: (9) y: (32)\n            glide (2) secs to x: (9) y: (-37)\n        end\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Stage) = [13]> then\n        hide\n    end\nend\n\n@Sprite3\n\nwhen I receive [fade v]\ndelete this clone\n\nwhen I start as a clone\nif <(id) = [0]> then\n    go to x: (0) y: (0)\n    point in direction (90)\n    show\n    switch costume to (background v)\n    go to [back v] layer\n    forever\n        if <(uservanish) = [0]> then\n            set [ghost v] effect to (0)\n            switch costume to (background v)\n            go to [back v] layer\n            go [backward v] (1) layers\n            show\n            go to x: (0) y: (0)\n        else\n            wait (0.4) seconds\n            repeat (20)\n                change [ghost v] effect by (5)\n            end\n            delete this clone\n        end\n    end\nend\nif <(id) = [1]> then\n    go to x: (700) y: (0)\n    show\n    point in direction (90)\n    go to [front v] layer\n    Smooth Glide to x [0] y [0] Speed [4]\n    hide\n    delete this clone\nend\nif <(id) = [2]> then\n    set size to (0) %\n    show\n    switch costume to (my icon v)\n    go to [front v] layer\n    go to x: (0) y: (35)\n    repeat (16)\n        turn right (22.5) degrees\n        change size by (6.25)\n    end\n    point in direction (90)\n    set size to (100) %\n    forever\n        if <(end?) = [0]> then\n            point in direction ((([cos v] of ((sine) * (18)) ) * (10)) + (90))\n            change [sine v] by (1)\n        else\n            repeat (24)\n                turn right (-16.875) degrees\n                change size by (-4.6875)\n            end\n            broadcast (fade v)\n            delete this clone\n        end\n    end\nend\nif <(id) = [3]> then\n    point in direction (90)\n    wait (0.5) seconds\n    set [ghost v] effect to (0)\n    switch costume to (username v)\n    go to [front v] layer\n    go [backward v] (1) layers\n    show\n    go to x: (700) y: (0)\n    Smooth Glide to x [0] y [0] Speed [4]\n    forever\n        if <(uservanish) = [0]> then\n            set [ghost v] effect to (0)\n            switch costume to (username v)\n            go to [front v] layer\n            go [backward v] (1) layers\n            show\n            go to x: (0) y: (0)\n        else\n            Smooth Glide to x [0] y [25] Speed [3]\n            Smooth Glide to x [0] y [-99] Speed [3]\n            delete this clone\n        end\n    end\nend\n\nwhen flag clicked\nset [end? v] to [0]\nstart sound [Inferno4 v]\nhide\nset [uservanish v] to [0]\nset [sine v] to [0]\nset [id v] to [0]\ncreate clone of (_myself_ v)\nwait (0.1) seconds\nchange [id v] by (1)\nrepeat (3)\n    switch costume to (slide v)\n    create clone of (_myself_ v)\n    wait (0.1) seconds\n    switch costume to (slide2 v)\n    create clone of (_myself_ v)\n    wait (0.1) seconds\nend\nswitch costume to (background v)\ncreate clone of (_myself_ v)\nwait (0.8) seconds\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nwait (0.1) seconds\nchange [id v] by (1)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset volume to (100) %\nwait (7) seconds\nset [end? v] to [1]\nset [uservanish v] to [1]\nbroadcast (Start v)\n\nwhen I receive [fade v]\nrepeat (10)\n    change volume by (-10)\nend\nstop all sounds\nbroadcast (end intro v)\n\ndefine Smooth Glide to x (x) y (y) Speed (s)\nrepeat until <<(round (x position)) = (x)> and <(round (y position)) = (y)>>\n    change x by (((x) - (x position)) / (s))\n    change y by (((y) - (y position)) / (s))\nend\ngo to x: (x) y: (y)\n\ngo to [front v] layer\n\n@Rain\n\nwhen flag clicked\nhide\nforever\n    repeat (10)\n        create clone of (_myself_ v)\n        create clone of (_myself_ v)\n    end\n    go to [front v] layer\nend\n\nwhen I start as a clone\nswitch costume to (pick random (1) to (3))\ngo to x: (pick random (-240) to (240)) y: (184)\nglide (pick random (0.005) to (2)) secs to x: (x position) y: (-184)\ndelete this clone\n\nwhen I receive [start v]\nforever\n    if <(Stage) = [6]> then\n        show\n    end\n    if <(Stage) = [9]> then\n        hide\n    end\nend\n\n