Marshmallow Ninja (Platformer)

Instructions: MARSHMALLOW NINJA | v1.0\n==============================\nINSTRUCTIONS:\nYou are a marshmallow ninja, who desires the best of marshmallows. You are on a journey to find the largest of them all.\n\nYES, THERE ARE A LOT OF BUGS BUT I DON'T CARE\n\nWASD, arrow keys, or mouse to move. Get to the marshmallow to advance to the next level. Avoid spikes, lava, or anything that looks harmful.\n\nToo easy for you? Try out this advanced platformer: https://scratch.mit.edu/projects/398172531/\n\n- Redesigned my Platformer Engine from Scratch (no pun intended)\n\nCREDITS:\nThanks to @JS_coder for marshmallow rotation\nThanks to @TheChaotic for loading sign rotation\nThanks to soundstripe.com for music\nThanks to @nl320 (me) for art, animations, platforming engine, and pretty much everything else\n\nUPDATE LOGS: (first to last update)\n——————————\n3/30/20 : Version 1.0.0 released\n3/31/20 : Level 7 added\n4/2/20 : Coins added\n4/6/20 : Level Hitbox Glitch Conquered\n4/11/20 : SEVERE Glitches Repaired, Reshared\n4/13/20 : Level 8 added, key glitch fixed\n4/14/20 : Level 8 Marshmallow Glitch Fixed\n5/5/20 : Stats fixed\n\nTAGS:\n#ninja #marshmallow #hungry #fun #platformer #mallow #marsh #whatever #scratch #game #games #interactive #coin #score #console #system #maths #GoodGrammar

@Stage\n\nwhen flag clicked\nswitch backdrop to (loading v)\n\nwhen I receive [pre.tick v]\nswitch backdrop to (game v)\n\n@console\n\nwhen flag clicked\nset [load v] to [0]\nwait (0.5) seconds\nbroadcast (loadsprites v)\n\nwhen I receive [loadsprites v]\nset [page v] to [loading]\nwait (3) seconds\nset [load v] to [1]\n\nwhen I receive [ts v]\nset [page v] to [title]\nerase all\n\nwhen I receive [playerstartup v]\nbroadcast (NextLvl v)\nset [page v] to [game]\n\nwhen I receive [selct_lvl v]\nset [page v] to [select]\n\nwhen I receive [help v]\nset [page v] to [help]\n\nwhen I receive [play v]\nset [timer v] to [0]\nforever\n    if <(page) = [stats]> then\n        stop [this script v]\n    end\n    wait (1) seconds\n    change [timer v] by (1)\n    if <(page) = [stats]> then\n        stop [this script v]\n    end\nend\n\nwhen I receive [stats/done v]\nset [page v] to [stats]\ncheck records\nbroadcast (print text — stats v)\n\ndefine reset.records\nset [☁ record time v] to [Reset]\nset [☁ record time v] to [—]\nset [☁ record time v] to [5050]\nbroadcast (rr24 v)\nstop [this script v]\n\ndefine check records\nTimeRec\n\nwhen I receive [play v]\nset [normal time? v] to [yes]\n\nwhen I receive [lvl selected v]\nset [normal time? v] to [no]\n\nwhen I receive [playback rec v]\nset [normal time? v] to [no]\n\nwhen I receive [gm v]\nset [page v] to [settings]\n\ndefine Reset.admin\ndelete.all.admin\nadd.default.admin\ncheckfor.admin\n\ndefine checkfor.admin\nif <<(username) = []> or <(username) = [0]>> then\n    set [signed.in.user v] to [no]\nelse\n    if <not <<(username) = []> or <(username) = [0]>>> then\n        set [signed.in.user v] to [yes]\n        if <[user.admin v] contains (username)?> then\n            add (username) to [user.admin? v]\n            add [true] to [user.admin? v]\n            set [user.admin.true? v] to [true]\n        else\n            set [user.admin.true? v] to [false]\n        end\n    end\nend\n\ndefine add.default.admin\nadd [nl320] to [user.admin v]\nadd [epikcoding] to [user.admin v]\nadd [nl320_test] to [user.admin v]\n\ndefine temporary.admin.set\nif <not <[user.admin v] contains (username)?>> then\n    if <(signed.in.user) = [true]> then\n        add (username) to [user.admin v]\n        stop [this script v]\n    end\nend\n\nwhen I receive [ts v]\nhide variable [☁ record time v]\nshow list [user.admin v]\nshow list [user.admin? v]\nhide variable [volume v]\n\nwhen I receive [gm v]\nshow variable [volume v]\n\nshow variable [☁ record time v]\nif <<(item ((item # of (username) in [user.admin? v]) + (1)) of [user.admin? v]) = [true]> and <[user.admin v] contains (username)?>> then\n    hide list [user.admin? v]\n    hide list [user.admin v]\nend\n\ndefine delete.all.admin\ndelete all of [user.admin? v]\ndelete all of [user.admin v]\n\nwhen I receive [loadsprites v]\nReset.admin\n\nwhen flag clicked\nshow list [user.admin v]\nshow list [user.admin? v]\nhide variable [☁ record time v]\nhide variable [volume v]\n\nwhen flag clicked\nwait (3.67) seconds\nbroadcast (Ts v)\n\nwhen I receive [playerstartup v]\nrepeat until <<(page) = [stats]> or <(page) = [title]>>\n    broadcast (pre.tick v)\n    broadcast (tick v)\nend\n\nwhen I receive [play v]\nset [level v] to [1]\n\nwhen I receive [ts v]\nrepeat (10)\n    set [level v] to [1]\nend\n\nwhen I receive [play v]\nrepeat (10)\n    set [level v] to [1]\nend\n\ndefine Calculate Score\nif <(normal time?) = [no]> then\n    set [-score- v] to (join [-] (join [-] (join [-] (join (join [-] [-]) (join [-] [-])))))\n    stop [this script v]\nelse\n    if <(normal time?) = [yes]> then\n        time score\n        DeathsScore\n        CalculateOverallScore\n    end\nend\n\ndefine time score\nif <(timer) < (☁ Record Time)> then\n    set [c.time v] to [200]\nelse\n    if <(timer) < ((☁ Record Time) + (20))> then\n        set [c.time v] to [100]\n    else\n        if <(timer) < ((☁ Record Time) + (50))> then\n            set [c.time v] to [60]\n        else\n            if <(timer) < ((☁ Record Time) + (100))> then\n                set [c.time v] to [30]\n            else\n                set [c.time v] to [-5]\n            end\n        end\n    end\nend\n\ndefine DeathsScore\nif <(Deaths) = [0]> then\n    if <<[60] = (C.time)> and <[60] < (C.time)>> then\n        set [d.s. v] to [400]\n    else\n        set [d.s. v] to [235]\n    end\nelse\n    set [d.s. v] to (round (((Deaths) * (8.59)) * (-1)))\nend\n\ndefine CalculateOverallScore\nset [-score- v] to [0]\nwait (.1) seconds\nset [-score- v] to ((D.S.) + (C.time))\nwait (.1) seconds\nset [-score- v] to ((-Score-) + (round ((coins collected) * (1.359))))\nwait (.1) seconds\nset [-score- v] to ((-Score-) + (round ((timer) * (-0.1))))\nwait (.1) seconds\nset [-score- v] to ((-Score-) * (100))\nwait (.1) seconds\nset [-score- v] to ((-Score-) * (10))\n\ndefine TimeRec\nif <<(item ((item # of (username) in [user.admin? v]) + (1)) of [user.admin? v]) = [true]> and <[user.admin v] contains (username)?>> then\n    if <(normal time?) = [yes]> then\n        if <(page) = [stats]> then\n            if <(timer) < (☁ Record Time)> then\n                ask [add record?     \(y/n\)] and wait\n                if <<(answer) = [n]> or <(answer) = [y]>> then\n                    if <(answer) = [y]> then\n                        set [☁ record time v] to (timer)\n                        stop [this script v]\n                    else\n                        if <(answer) = [n]> then\n                            stop [this script v]\n                        end\n                    end\n                else\n                    broadcast (invalid response v)\n                    stop [this script v]\n                end\n            end\n        end\n    else\n        stop [this script v]\n    end\nelse\n    if <(normal time?) = [yes]> then\n        if <(page) = [stats]> then\n            if <(timer) < (☁ Record Time)> then\n                if <(timer) < (☁ Record Time)> then\n                    set [☁ record time v] to (timer)\n                    stop [this script v]\n                end\n            else\n                stop [this script v]\n            end\n        end\n    else\n        stop [this script v]\n    end\nend\n\nwhen I receive [stats/done v]\nCalculate Score\n\n@player\n\nwhen I receive [tick v]\nshow\nif <<<touching (level hitbox v)?> or <touching (vertical platform v)?>> or <touching (door v)?>> then\n    change y by (1)\n    if <<<touching (level hitbox v)?> or <touching (vertical platform v)?>> or <touching (door v)?>> then\n        change y by (1)\n        if <<<touching (level hitbox v)?> or <touching (vertical platform v)?>> or <touching (door v)?>> then\n            change y by (1)\n            if <<<touching (level hitbox v)?> or <touching (vertical platform v)?>> or <touching (door v)?>> then\n                change y by (1)\n                if <<<touching (level hitbox v)?> or <touching (vertical platform v)?>> or <touching (door v)?>> then\n                    change y by (1)\n                    if <<<touching (level hitbox v)?> or <touching (vertical platform v)?>> or <touching (door v)?>> then\n                        change x by ((Xv) * (-1))\n                        change y by (-5)\n                        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                            if <(Xv) > [0]> then\n                                set [xv v] to [-5]\n                            else\n                                set [xv v] to [5]\n                            end\n                            set [yv v] to [10]\n                        else\n                            set [xv v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [tick v]\nset rotation style [left-right v]\nchange [yv v] by (-1)\nchange y by (Yv)\nif <<<touching (level hitbox v)?> or <touching (vertical platform v)?>> or <touching (door v)?>> then\n    change y by ((Yv) * (-1))\n    set [yv v] to [0]\nend\nchange y by (-1)\nif <<<touching (level hitbox v)?> or <touching (vertical platform v)?>> or <touching (door v)?>> then\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        set [yv v] to [12]\n    end\nend\nchange y by (1)\n\nwhen I receive [tick v]\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [xv v] by (1)\n    point in direction (90)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [xv v] by (-1)\n    point in direction (-90)\nend\nset [xv v] to ((Xv) * (0.9))\nchange x by ((Xv) * (0.9))\n\ndefine lvl.pos\nif <(Level) = [1]> then\n    point in direction (90)\n    go to x: (-199) y: (-77)\n    rv\nend\nif <(Level) = [2]> then\n    point in direction (90)\n    go to x: (-199) y: (-77)\n    rv\nend\nif <(Level) = [3]> then\n    point in direction (90)\n    go to x: (-199) y: (-77)\n    rv\nend\nif <(Level) = [4]> then\n    point in direction (90)\n    go to x: (-199) y: (-77)\n    rv\nend\nif <(Level) = [5]> then\n    point in direction (90)\n    go to x: (-199) y: (-77)\n    rv\nend\nif <(Level) = [6]> then\n    point in direction (90)\n    go to x: (-199) y: (-77)\n    rv\nend\nif <(Level) = [7]> then\n    point in direction (90)\n    go to x: (-199) y: (-77)\n    rv\nend\nif <(Level) = [8]> then\n    point in direction (90)\n    go to x: (-199) y: (-85)\n    rv\nend\n\ndefine Startup\nbroadcast (Play v)\nbroadcast (PlayerStartup v)\nbroadcast (NextLvl v)\n\nwhen I receive [nextlvl v]\nlvl.pos\n\ndefine rv\nset [yv v] to [0]\nset [xv v] to [0]\n\nwhen flag clicked\nhide\n\nwhen I receive [ts v]\nhide\n\nwhen I receive [pre.tick v]\nset [ghost v] effect to (0)\nif <<touching color (#ff0000)?> or <touching color (#910000)?>> then\n    broadcast (Death v)\nend\nif <(y position) < [-179]> then\n    broadcast (Death v)\nend\n\nwhen I receive [death v]\nlvl.pos\n\nwhen I receive [ts v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [pre.tick v]\nswitch costume to (costume)\n\nwhen I receive [stats/done v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [death v]\nchange [deaths v] by (1)\n\nwhen I receive [playerstartup v]\nset [deaths v] to [0]\n\n@Level Hitbox\n\nwhen flag clicked\nhide\n\nwhen I receive [playerstartup v]\ngo to [back v] layer\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\n    show\n    set [ghost v] effect to (0)\nend\n\nwhen I receive [play v]\nwait (0.05) seconds\nset [level v] to [1]\n\nwhen I receive [ts v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\ndefine calculate maximum.lvl\nswitch costume to (l1 v)\nset [l v] to [1]\nrepeat until <(costume [number v]) < (L)>\n    next costume\n    change [l v] by (1)\nend\nset [max.level v] to ((L) - (1))\nswitch costume to (l1 v)\nrepeat (10)\n    set [level v] to [1]\nend\n\nwhen I receive [stats/done v]\nstop [other scripts in sprite v]\nhide\n\ndefine C.L.S.\nswitch costume to (l1 v)\nset [cls v] to [1]\nrepeat until <(costume [number v]) < (L)>\n    next costume\n    change [l v] by (1)\nend\nset [cls v] to (L)\n\nwhen I receive [loadsprites v]\nif <(username) = [epikcoding]> then\n    set [max.level v] to [8]\nelse\n    set [max.level v] to [8]\nend\n\n@Level art\n\nwhen flag clicked\nhide\n\nwhen I receive [playerstartup v]\ngo to [back v] layer\nforever\n    set [ghost v] effect to (0)\n    go to x: (0) y: (0)\n    switch costume to (Level)\n    show\nend\n\nwhen I receive [ts v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [stats/done v]\nstop [other scripts in sprite v]\nhide\n\n@marshmallow\n\nwhen flag clicked\nhide\n\nwhen I receive [nextlvl v]\npos\npos\n\nwhen I receive [pre.tick v]\nif <[1] = (costume [number v])> then\n    go to [front v] layer\n    point in direction ((90) + (([sin v] of (((timer) - (0)) * (150)) ) * (10)))\nend\nif <[2] = (costume [number v])> then\n    go to [back v] layer\n    set size to ((90) + (([sin v] of (((timer) - (0)) * (300)) ) * (10))) %\nend\nif <touching (player v)?> then\n    if <(Level) = (Max.Level)> then\n        broadcast (Stats/DONE v)\n    else\n        if <not <(Level) = (Max.Level)>> then\n            broadcast (NextLvl v)\n            wait until <not <touching (player v)?>>\n        end\n    end\nend\nset [ghost v] effect to (0)\n\ndefine pos\nhide\nif <(Level) = [1]> then\n    go to x: (173) y: (-81)\n    show\n    set [x v] to (x position)\n    set [y v] to (y position)\nend\nif <(Level) = [2]> then\n    go to x: (192) y: (-110)\n    show\n    set [x v] to (x position)\n    set [y v] to (y position)\nend\nif <(Level) = [3]> then\n    go to x: (212) y: (110)\n    show\n    set [x v] to (x position)\n    set [y v] to (y position)\nend\nif <(Level) = [4]> then\n    go to x: (-212) y: (45)\n    show\n    set [x v] to (x position)\n    set [y v] to (y position)\nend\nif <(Level) = [5]> then\n    go to x: (-219) y: (83)\n    show\n    set [x v] to (x position)\n    set [y v] to (y position)\nend\nif <(Level) = [6]> then\n    go to x: (-219) y: (83)\n    show\n    set [x v] to (x position)\n    set [y v] to (y position)\nend\nif <(Level) = [7]> then\n    go to x: (-221) y: (59)\n    show\n    set [x v] to (x position)\n    set [y v] to (y position)\nend\nif <(Level) = [8]> then\n    go to x: (-198) y: (112)\n    show\n    set [x v] to (x position)\n    set [y v] to (y position)\nend\n\nwhen I receive [loadsprites v]\nswitch costume to (costume1 v)\n\nwhen I receive [nextlvl v]\nchange [level v] by (1)\nif <not <(item (2) of [user.admin? v]) = [true]>> then\n    add (Level) to [levels.completed v]\nend\n\nwhen I receive [playerstartup v]\ncreate clone of (glow v)\n\nwhen I receive [ts v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [stats/done v]\nstop [other scripts in sprite v]\nhide\n\ndefine reset lc\ndelete all of [levels.completed v]\n\nwhen I receive [nextlvl v]\nif <(Level) = [8]> then\n    go to x: (-198) y: (112)\n    show\n    set [x v] to (x position)\n    set [y v] to (y position)\nend\n\n@Loading\n\nwhen flag clicked\nhide\n\nwhen I receive [loadsprites v]\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [ts v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Loading Sign\n\nwhen I receive [loadsprites v]\nhide\nwait (.7) seconds\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [tick v]\nhide\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    turn right ((5) + (([abs v] of ([sin v] of ((direction) / (2)) ) ) * (25))) degrees\n    set [brightness v] effect to (100)\n    set size to (68) %\nend\n\nwhen I receive [ts v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ngo to [back v] layer\nstop [other scripts in sprite v]\n\n@Home Buttons\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        set size to (124.5) %\n        point in direction ((90) + (([sin v] of (((timer) - (0)) * (300)) ) * (1)))\n    else\n        point in direction ((90) + (([sin v] of (((timer) - (0)) * (300)) ) * (1)))\n        set size to (120) %\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(page) = [title]> then\n        show\n    end\n    if <not <(page) = [title]>> then\n        hide\n    end\nend\n\nwhen I receive [loadsprites v]\ngo to x: (0) y: (10)\nswitch costume to (costume1 v)\nrepeat (3)\n    create clone of (_myself_ v)\n    next costume\n    change y by (-65)\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    forever\n        if <(page) = [title]> then\n            if <<mouse down?> and <touching (mouse-pointer v)?>> then\n                if <(page) = [title]> then\n                    set [level v] to [1]\n                    broadcast (Play v)\n                    broadcast (PlayerStartup v)\n                    broadcast (NextLvl v)\n                end\n            end\n        end\n    end\nend\nif <(costume [number v]) = [2]> then\n    forever\n        if <(page) = [title]> then\n            if <<mouse down?> and <touching (mouse-pointer v)?>> then\n                broadcast (gm v)\n            end\n        end\n    end\nend\nif <(costume [number v]) = [3]> then\n    forever\n        if <(page) = [title]> then\n            if <<mouse down?> and <touching (mouse-pointer v)?>> then\n                broadcast (selct_lvl v)\n            end\n        end\n    end\nend\n\n@ts\n\nwhen I receive [ts v]\nif <(costume [number v]) = [1]> then\n    wait until <(page) = [title]>\n    set [ghost v] effect to (100)\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    repeat until <not <(page) = [title]>>\n        show\n        go to [back v] layer\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [ts v]\nif <(costume [number v]) = [1]> then\n    forever\n        set y to (([sin v] of ((timer) * (100)) ) * (3))\n    end\nend\n\nwhen I receive [loadsprites v]\nswitch costume to (select v)\ncreate clone of (_myself_ v)\nnext costume\ncreate clone of (_myself_ v)\nswitch costume to (title v)\n\nwhen I receive [selct_lvl v]\nif <(costume [number v]) = [2]> then\n    wait until <(page) = [select]>\n    set [ghost v] effect to (100)\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    repeat until <not <(page) = [select]>>\n        show\n        go to [back v] layer\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\nend\n\nwhen I receive [gm v]\nif <(costume [number v]) = [3]> then\n    wait until <(page) = [settings]>\n    set [ghost v] effect to (100)\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    repeat until <not <(page) = [settings]>>\n        show\n        go to [back v] layer\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\nend\n\n@thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [loadsprites v]\nset [ghost v] effect to (100)\nshow\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nbroadcast (Rb v)\nforever\n    set [stopped? v] to (timer)\nend\n\nwhen flag clicked\nwait until <(stopped?) < (timer)>\nbroadcast (oof v)\nbroadcast (stopped v) and wait\n\nwhen I receive [oof v]\nhide variable [☁ record time v]\nhide variable [costume v]\nhide variable [volume v]\n\nwhen I receive [rb v]\nreset timer\n\nwhen I receive [rb v]\nset [stopped? v] to [-]\nreset timer\n\n@glow\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nforever\n    show\n    switch costume to (costume2 v)\n    go to (marshmallow v)\n    set size to ((90) + (([sin v] of (((timer) - (0)) * (300)) ) * (10))) %\n    go to [back v] layer\n    if <(page) = [title]> then\n        delete this clone\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [stats/done v]\ndelete this clone\n\nwhen I receive [ts v]\ndelete this clone\n\nwhen I receive [stats/done v]\nstop [other scripts in sprite v]\nhide\n\n@Return\n\nwhen I start as a clone\nforever\n    if <<(page) = [stats]> or <<(page) = [settings]> or <(page) = [select]>>> then\n        set size to (100) %\n        go to x: (-198) y: (-160)\n        set [ghost v] effect to (100)\n        show\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        repeat until <not <<(page) = [stats]> or <<(page) = [settings]> or <(page) = [select]>>>>\n            go to [front v] layer\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (-14)\n                set size to (105) %\n                if <mouse down?> then\n                    broadcast (Ts v)\n                end\n            else\n                set size to (100) %\n                set [color v] effect to (0)\n                set [brightness v] effect to (0)\n            end\n        end\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        set size to (100) %\n        set [color v] effect to (0)\n        set [brightness v] effect to (0)\n    end\n    if <(page) = [game]> then\n        go to x: (219) y: (169)\n        set size to (50) %\n        set [ghost v] effect to (100)\n        show\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        repeat until <not <(page) = [game]>>\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (-14)\n                set size to (50) %\n                if <mouse down?> then\n                    broadcast (Ts v)\n                end\n            else\n                set size to (50) %\n                set [color v] effect to (0)\n                set [brightness v] effect to (0)\n            end\n        end\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        set size to (100) %\n        set [color v] effect to (0)\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [loadsprites v]\ncreate clone of (_myself_ v)\n\n@player.costume.select\n\nwhen I receive [loadsprites v]\nClone\n\ndefine Clone\nswitch costume to (type1 v)\ngo to x: (-198) y: (0)\nrepeat (2)\n    repeat (4)\n        create clone of (_myself_ v)\n        change x by (30)\n        next costume\n    end\n    set x to (-198)\n    change y by (-40)\nend\n\nwhen I start as a clone\nhide\nforever\n    if <(page) = [settings]> then\n        set [ghost v] effect to (100)\n        show\n        if <(costume) = (costume [number v])> then\n            set size to (107) %\n            set [color v] effect to (0)\n            set [brightness v] effect to (10)\n        else\n            set size to (95) %\n            set [color v] effect to (0)\n            set [brightness v] effect to (0)\n        end\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        repeat until <not <(page) = [settings]>>\n            if <(costume) = (costume [number v])> then\n                if <touching (mouse-pointer v)?> then\n                    set size to (110) %\n                    set [color v] effect to (0)\n                    set [brightness v] effect to (15)\n                    if <mouse down?> then\n                        set [costume v] to (costume [number v])\n                        wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n                    end\n                else\n                    set size to (107) %\n                    set [color v] effect to (0)\n                    set [brightness v] effect to (10)\n                end\n            else\n                if <touching (mouse-pointer v)?> then\n                    set size to (100) %\n                    set [color v] effect to (0)\n                    set [brightness v] effect to (0)\n                    if <mouse down?> then\n                        set [costume v] to (costume [number v])\n                        wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n                    end\n                else\n                    set size to (95) %\n                    set [color v] effect to (0)\n                    set [brightness v] effect to (0)\n                end\n            end\n        end\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n    end\nend\n\n@music\n\nwhen I receive [loadsprites v]\nwait (3) seconds\nforever\n    play sound [Fresh Air v] until done\n    wait (1) seconds\nend\n\nwhen flag clicked\nforever\n    set volume to (volume) %\nend\n\n@player.costume.select2\n\nwhen I receive [loadsprites v]\nClone\n\ndefine Clone\nswitch costume to (costume)\ngo to x: (-115) y: (-91)\n\ndefine reset\nset [costume v] to [1]\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    switch costume to (costume)\nend\n\nwhen flag clicked\nforever\n    if <(page) = [settings]> then\n        set [ghost v] effect to (100)\n        show\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        wait until <not <(page) = [settings]>>\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n    end\nend\n\n@end screen\n\nwhen flag clicked\nhide\n\nwhen I receive [stats/done v]\nwait until <(page) = [stats]>\ngo to x: (0) y: (0)\ngo to [back v] layer\nshow\nset [ghost v] effect to (0)\nset size to (100) %\nrepeat until <not <(page) = [stats]>>\n    show\n    go to [back v] layer\nend\nrepeat (10)\n    show\n    change [ghost v] effect by (10)\nend\nhide\n\n@Clouds\n\nwhen I receive [loadsprites v]\nforever\n    wait (pick random (0.5) to (1.1)) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nset [ghost v] effect to (pick random (pick random (44) to (pick random (45) to (50))) to (pick random (70) to (pick random (80) to (85))))\nswitch costume to (pick random (1) to (5))\ngo to x: (500) y: (pick random (100) to (180))\nrepeat until <[-239] > (x position)>\n    change x by (-2)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\n    change x by (-2)\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <(page) = [game]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [pre.tick v]\ngo to [back v] layer\n\ncreate clone of (clouds2 v)\n\n@LevelSelect\n\nwhen I start as a clone\nhide\nset size to (77) %\nforever\n    if <(page) = [select]> then\n        set [brightness v] effect to (0)\n        set [color v] effect to (0)\n        set size to (77) %\n        set [ghost v] effect to (100)\n        show\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        wait until <not <(page) = [select]>>\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n    end\nend\n\nwhen flag clicked\nerase all\nhide\n\nwhen I receive [loadsprites v]\nif <(item (2) of [user.admin? v]) = [true]> then\n    adminclone\nelse\n    clone\nend\n\ndefine clone\nswitch costume to (level-1 v)\nhide\ngo to x: (-185) y: (55)\nrepeat (7)\n    create clone of (_myself_ v)\n    change x by (60)\n    next costume\nend\nset x to (-185)\nchange y by (-40)\nrepeat (2)\n    create clone of (_myself_ v)\n    change x by (60)\n    next costume\nend\nset x to (-185)\nchange y by (-40)\n\ndefine select (costume#)\nif <(costume#) = [1]> then\n    set [level v] to [1]\n    broadcast (Play v)\n    broadcast (PlayerStartup v)\n    broadcast (NextLvl v)\nelse\n    set [level v] to ((costume#) - (1))\n    broadcast (lvl selected v)\n    broadcast (PlayerStartup v)\n    broadcast (NextLvl v)\nend\n\nwhen I start as a clone\nforever\n    if <<(item (2) of [user.admin? v]) = [true]> and <(user.admin?) = (join (username) (join [ ] [true]))>> then\n        if <(costume [number v]) = [1]> then\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (5)\n                set size to (80) %\n                if <mouse down?> then\n                    if <(page) = [select]> then\n                        set size to (85) %\n                        set [brightness v] effect to (10)\n                        select (costume [number v])\n                        wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n                    end\n                end\n            else\n                set size to (77) %\n                set [brightness v] effect to (0)\n            end\n        else\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (5)\n                set size to (80) %\n                if <mouse down?> then\n                    if <(page) = [select]> then\n                        set size to (85) %\n                        set [brightness v] effect to (10)\n                        select (costume [number v])\n                        wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n                    end\n                end\n            else\n                set size to (77) %\n                set [brightness v] effect to (0)\n            end\n        end\n    else\n        if <(costume [number v]) = [1]> then\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (5)\n                set size to (80) %\n                if <mouse down?> then\n                    if <(page) = [select]> then\n                        set size to (85) %\n                        set [brightness v] effect to (10)\n                        select (costume [number v])\n                        wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n                    end\n                end\n            else\n                set size to (77) %\n                set [brightness v] effect to (0)\n            end\n        else\n            if <[levels.completed v] contains (costume [number v])?> then\n                if <touching (mouse-pointer v)?> then\n                    set [brightness v] effect to (5)\n                    set size to (80) %\n                    if <mouse down?> then\n                        set size to (85) %\n                        if <(page) = [select]> then\n                            set [brightness v] effect to (10)\n                            select (costume [number v])\n                            wait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n                        end\n                    end\n                else\n                    set size to (77) %\n                    set [brightness v] effect to (0)\n                end\n            else\n                set size to (77) %\n                set [brightness v] effect to (-14.3)\n            end\n        end\n    end\nend\n\ndefine adminclone\nswitch costume to (level-1 v)\nhide\ngo to x: (-123) y: (55)\nrepeat (2)\n    repeat (4)\n        create clone of (_myself_ v)\n        change x by (80)\n        next costume\n    end\n    set x to (-123)\n    change y by (-40)\nend\n\n@text\n\ndefine (print) x: (x) y: (y) size: (size) color: (color)\nhide\nset [color v] effect to (color)\nset size to (size) %\ngo to x: (x) y: (y)\nset [txt v] to [1]\nrepeat (length of (print))\n    switch costume to (letter (txt) of (print))\n    create clone of (_myself_ v)\n    change x by ((size) / (9))\n    change [txt v] by (1)\nend\n\nwhen flag clicked\nerase all\n\nwhen I receive [print text — stats v]\nif <(normal time?) = [yes]> then\n    (round (timer)) x: (-105) y: (-9) size: (134) color: (70)\nelse\n    [n/a] x: (-105) y: (-9) size: (134) color: (35)\n    [n/a] x: (100) y: (-9) size: (134) color: (35)\nend\n(Deaths) x: (-88) y: (-60) size: (134) color: (70)\n(☁ Record Time) x: (-86) y: (-112) size: (134) color: (70)\n\nwhen I start as a clone\nshow\nwait until <(page) = [title]>\ndelete this clone\n\nwhen I start as a clone\nshow\n\n@Clouds2\n\nwhen I start as a clone\nset [brightness v] effect to (-13)\nset [ghost v] effect to (pick random (pick random (44) to (pick random (45) to (50))) to (pick random (70) to (pick random (80) to (85))))\nswitch costume to (pick random (1) to (5))\ngo to x: (500) y: (pick random (100) to (180))\nrepeat until <[-239] > (x position)>\n    change x by (-3)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\n    change x by (-3)\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <(page) = [game]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [pre.tick v]\ngo to [back v] layer\n\nwhen I receive [loadsprites v]\nforever\n    wait (pick random (0.5) to (1.1)) seconds\n    create clone of (_myself_ v)\nend\n\n@Vertical Platform\n\nwhen flag clicked\nhide\n\nwhen I receive [nextlvl v]\nhide\nif <(Level) = [7]> then\n    go to x: (144) y: (-130)\n    show\n    repeat until <not <(Level) = [7]>>\n        repeat (80)\n            change y by (2)\n            go to [back v] layer\n            if <<not <(Level) = [7]>> or <not <(page) = [game]>>> then\n                hide\n                stop [this script v]\n            end\n        end\n        repeat (20)\n            change y by (-8)\n            if <<not <(Level) = [7]>> or <not <(page) = [game]>>> then\n                hide\n                stop [this script v]\n            end\n        end\n    end\nend\n\n@Coins\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nforever\n    show\n    next costume\n    wait (.1) seconds\nend\n\nwhen I receive [nextlvl v]\nDelete cl\nSet.coin.value\nwait (.02) seconds\nClone for (Level)\n\nwhen I receive [playerstartup v]\nset [coins collected v] to [0]\n\ndefine Clone for (level)\nif <(level) = [1]> then\n    Clone at  x: [-59] y: [-113]\n    Clone at  x: [0] y: [-113]\n    Clone at  x: [59] y: [-113]\nend\nif <(level) = [2]> then\n    Clone at  x: [-100] y: [-100]\n    Clone at  x: [0] y: [-50]\n    Clone at  x: [100] y: [-100]\nend\nif <(level) = [3]> then\n    Clone at  x: [-100] y: [-100]\n    Clone at  x: [0] y: [-100]\n    Clone at  x: [120] y: [-60]\nend\nif <(level) = [4]> then\n    Clone at  x: [-5] y: [-25]\n    Clone at  x: [-5] y: [76]\nend\nif <(level) = [5]> then\n    Clone at  x: [-26] y: [-115]\n    Clone at  x: [55] y: [90]\nend\nif <(level) = [6]> then\n    Clone at  x: [221] y: [130]\n    Clone at  x: [0] y: [-63]\nend\nif <(level) = [7]> then\n    Clone at  x: [207] y: [-117]\n    Clone at  x: [-29] y: [160]\nend\n\ndefine Clone at  x: (x) y: (y)\nhide\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [ts v]\nDelete cl\n\nwhen I receive [stats/done v]\nDelete cl\n\nwhen I start as a clone\nswitch costume to (costume8 v)\nforever\n    if <touching (player v)?> then\n        change [coins collected v] by (1)\n        start sound [Coin v]\n        repeat (10)\n            change y by (2)\n            change [ghost v] effect by (10)\n        end\n        delete this clone\n    end\nend\n\ndefine Delete cl\ndelete this clone\n\nwhen I receive [death v]\nDelete cl\nRes.coin.value\nClone for (Level)\n\ndefine Res.coin.value\nset [coins collected v] to (Prev.coin.value)\n\ndefine Set.coin.value\nset [prev.coin.value v] to (coins collected)\n\n@score\n\nwhen I start as a clone\nshow\nset size to (85) %\nswitch costume to (0 v)\nwait (.2) seconds\nif <(normal time?) = [no]> then\n    switch costume to ( v)\n    delete this clone\nelse\n    if <(normal time?) = [yes]> then\n        forever\n            set [brightness v] effect to ((B) * (-0.6))\n            switch costume to ((letter ((length of (-Score-)) - (myPlace)) of (-Score-)) * <(length of (-Score-)) > (myPlace)>)\n        end\n    end\nend\n\nwhen I receive [stats/done v]\ngo to x: (100) y: (-9)\nset [myplace v] to [6]\nrepeat (7)\n    create clone of (_myself_ v)\n    change x by (15)\n    change [myplace v] by (-1)\nend\n\nwhen I receive [playerstartup v]\nhide\ndelete this clone\n\nwhen I receive [ts v]\nhide\ndelete this clone\n\n@rec.score\n\nwhen I start as a clone\nshow\nset size to (85) %\nif <(normal time?) = [no]> then\n    switch costume to ( v)\nelse\n    if <(normal time?) = [yes]> then\n        forever\n            set [brightness v] effect to ((B) * (-0.6))\n            switch costume to ((letter ((length of (☁ Record-Score)) - (myPlace)) of (☁ Record-Score)) * <(length of (☁ Record Time)) > (myPlace)>)\n        end\n    end\nend\n\nwhen I receive [print text — stats v]\n\ngo to x: (100) y: (-9)\nset [myplace v] to [6]\nrepeat (7)\n    create clone of (_myself_ v)\n    change x by (15)\n    change [myplace v] by (-1)\nend\n\nwhen I receive [playerstartup v]\nhide\ndelete this clone\n\nwhen I receive [ts v]\nhide\ndelete this clone\n\n@door\n\nwhen I receive [nextlvl v]\npos\n\nwhen flag clicked\nhide\n\ndefine pos\nhide\nif <(Level) = [8]> then\n    go to x: (92) y: (9)\n    show\n    switch costume to (costume1 v)\n    go to [back v] layer\nend\n\nwhen I receive [stats/done v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [ts v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [open v]\nshow\nswitch costume to (costume1 v)\nwait (.1) seconds\nrepeat (4)\n    next costume\n    wait (.04) seconds\nend\nhide\n\nwhen I receive [death v]\nstop [other scripts in sprite v]\nswitch costume to (costume1 v)\npos\n\n@key\n\nwhen flag clicked\nhide\nforever\n\nwhen I receive [stats/done v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [ts v]\nstop [other scripts in sprite v]\nhide\n\ndefine pos\nhide\nif <(Level) = [8]> then\n    go to x: (-208) y: (-14)\n    show\n    (Level) [8]\nend\n\ndefine (lvl) (num)\nrepeat until <not <(lvl) = (num)>>\n    repeat until <touching (player v)?>\n        set rotation style [left-right v]\n        switch costume to (hover v)\n        set size to (100) %\n        point in direction (90)\n        go to [back v] layer\n        set y to ((-10) + (([sin v] of (((timer) - (0)) * (400)) ) * (2)))\n        create clone of (_myself_ v)\n    end\n    switch costume to (player v)\n    set size to (50) %\n    go to [front v] layer\n    repeat until <touching (door v)?>\n        go to (player v)\n        point in direction ([direction v] of [player v])\n    end\n    broadcast (open v)\n    stop [this script v]\nend\n\nwhen I receive [nextlvl v]\npos\n\nwhen I start as a clone\nchange [brightness v] effect by (-5)\nrepeat (10)\n    change [ghost v] effect by (10)\n    go to [back v] layer\n    change [brightness v] effect by (-2)\nend\ndelete this clone\n\nwhen I receive [open v]\nhide\n\nwhen I receive [death v]\nstop [other scripts in sprite v]\npos\n\n@O.S.P.E.\n\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [xv v] by (1)\n    point in direction (90)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [xv v] by (-1)\n    point in direction (-90)\nend\nset [xv v] to ((Xv) * (0.9))\nchange x by ((Xv) * (0.9))\nif <<<touching (level hitbox v)?> or <touching (vertical platform v)?>> or <touching (door v)?>> then\n    change y by (1)\n    if <<<touching (level hitbox v)?> or <touching (vertical platform v)?>> or <touching (door v)?>> then\n        change y by (1)\n        if <<<touching (level hitbox v)?> or <touching (vertical platform v)?>> or <touching (door v)?>> then\n            change y by (1)\n            if <<<touching (level hitbox v)?> or <touching (vertical platform v)?>> or <touching (door v)?>> then\n                change y by (1)\n                if <<<touching (level hitbox v)?> or <touching (vertical platform v)?>> or <touching (door v)?>> then\n                    change y by (1)\n                    if <<<touching (level hitbox v)?> or <touching (vertical platform v)?>> or <touching (door v)?>> then\n                        change x by ((Xv) * (-1))\n                        change y by (-5)\n                        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                            if <(Xv) > [0]> then\n                                set [xv v] to [-5]\n                            else\n                                set [xv v] to [5]\n                            end\n                            set [yv v] to [10]\n                        else\n                            set [xv v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\n