The Journey (Platformer)

Instructions: The Journey v1.3\n–––––––––\nUse WASD or arrow keys to move.\nGet to the button to unlock the door, then go to the door to advance to the next level. Avoid red. (Spikes, lava, etc.)\n\nCREDITS:\n@nl320 for programming\n@nl320 for art, animations, levels\n@theChAOTiC for loading sign\n@JS_coder for menu button movement\nsoundstripe.com for the music\nScratch for words/fonts\n\nToo easy for you? Try out this advanced platformer: https://scratch.mit.edu/projects/398172531/\n\nUPDATE LOGS:\n3/18/20 : version 0.5 released, lvl 6 added\n3/18/20 : MAJOR glitches removed\n3/19/20 : Added level 7\n3/20/20 : Changed costume, added clone tail\n3/20/20 : Added level 8, Menu fade fixed\n3/21/20 : Added menu button movement\n3/21/20 : added "admin" script for EX features\n3/22/10 : NOW MOBILE FRIENDLY!\n3/23/20 : Level 9 added\n10/10/21 : UI changed, prepped for dimension launch\n=====================================\n\nTAGS:\n#The #Journey #platformer #nl320?

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 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 [25000]\nbroadcast (rr24 v)\nstop [this script v]\n\ndefine check records\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                set [☁ record time v] to (timer)\n                stop [this script v]\n            end\n        end\n    else\n        stop [this script v]\n    end\nend\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 [scratchattack3] to [user.admin v]\nadd [epikcoding] 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 [☁ record time v]\nshow variable [volume 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]\nend\nhide list [user.admin v]\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]\n\n@PLAYER\n\nwhen I receive [playerstartup v]\nforever\n    if <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<mouse down?> and <[0] < (mouse x)>>> then\n        change [xv v] by (1)\n    end\n    if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<mouse down?> and <(mouse x) < [0]>>> then\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    if <touching color (#3fd9ff)?> then\n        change x by ((Xv) * (0.3))\n    else\n        change x by ((Xv) * (0.65))\n    end\nend\n\nwhen I receive [nextlvl v]\nclear graphic effects\nset size to (100) %\nhide\nLvlPos\nFadeIn\n\nwhen I receive [playerstartup v]\nforever\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change y by (1)\n                            if <touching color (#000000)?> then\n                                change x by ((Xv) * (-1))\n                                change y by (-6)\n                                if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<mouse down?> and <[15] < (mouse y)>>> 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 [9]\n                                else\n                                    set [xv v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [playerstartup v]\nforever\n    if <touching color (#3fd9ff)?> then\n        change [yv v] by (-0.2678)\n        change y by ((Yv) / (2))\n        if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<mouse down?> and <[15] < (mouse y)>>> then\n            set [yv v] to [3.8963]\n        end\n        change y by (-0.3)\n        if <touching color (#000000)?> then\n            change y by ((Yv) * (-1))\n            set [yv v] to [0]\n        end\n        change y by (0.3)\n    else\n        change [yv v] by (-0.85)\n        change y by (Yv)\n        if <touching color (#000000)?> then\n            change y by ((Yv) * (-1))\n            set [yv v] to [0]\n        end\n        change y by (-1)\n        if <touching color (#000000)?> then\n            if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<mouse down?> and <[15] < (mouse y)>>> then\n                set [yv v] to [10]\n            end\n        end\n        change y by (1)\n    end\nend\n\ndefine FadeIn\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\ndefine ResetV\nset [xv v] to [0]\nset [yv v] to [1]\n\nwhen flag clicked\nshow list [levels completed v]\nhide\n\nwhen I receive [playerstartup v]\nclear graphic effects\nset [deaths v] to [0]\nshow\ngo to [front v] layer\n\nwhen I receive [play v]\nset [color v] effect to (0)\nset [level v] to [1]\nbroadcast (NextLvl v)\n\nwhen I receive [death v]\nchange [deaths v] by (1)\n\ndefine LvlPos\nhide\nif <(Level) = [1]> then\n    show\n    go to x: (-228) y: (-100)\nend\nif <(Level) = [2]> then\n    show\n    go to x: (-228) y: (-100)\nend\nif <(Level) = [3]> then\n    show\n    go to x: (-228) y: (-100)\nend\nif <(Level) = [4]> then\n    show\n    go to x: (-219) y: (-100)\nend\nif <(Level) = [5]> then\n    show\n    go to x: (-160) y: (-120)\nend\nif <(Level) = [6]> then\n    show\n    go to x: (128) y: (-35)\nend\nif <(Level) = [7]> then\n    show\n    go to x: (-205) y: (-100)\nend\nif <(Level) = [8]> then\n    show\n    go to x: (-208) y: (-100)\nend\nif <(Level) = [9]> then\n    show\n    go to x: (-27) y: (-145)\nend\n\nwhen flag clicked\nset [level v] to [1]\n\nwhen I receive [death v]\nLvlPos\nResetV\nFadeIn\n\nwhen I receive [nextlvl v]\nLvlPos\nResetV\nFadeIn\n\nwhen I receive [play v]\nset [level v] to [1]\n\nwhen flag clicked\nrepeat (10)\n    hide\nend\n\nwhen I receive [playerstartup v]\nforever\n    if <touching color (#ff0000)?> then\n        broadcast (Death v)\n    end\n    if <<touching (door v)?> and <(Lock) = [1]>> then\n        if <(Max_levels) = (Level)> then\n            broadcast (Stats/DONE v)\n        else\n            set [level v] to ((Level) + (1))\n            if <not <(username) = [nl320]>> then\n                add (Level) to [levels completed v]\n            end\n            broadcast (NextLvl v)\n        end\n    end\nend\n\nwhen I receive [ts v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [stats/done v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [nextlvl v]\nrepeat (10)\n    go to [front v] layer\nend\n\nwhen I receive [hold v]\nrepeat (10)\n    set [xv v] to [0]\n    set [yv v] to [1]\nend\n\nwhen I receive [selct_lvl 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 [record v]\ndelete all of [recx v]\ndelete all of [recy v]\nrepeat until <key (space v) pressed?>\n    add (x position) to [recx v]\n    add (y position) to [recy v]\nend\n\nwhen I receive [playback rec v]\nset [- v] to [1]\nforever\n    go to x: (item (-) of [recx v]) y: (item (-) of [recy v])\n    change [- v] by (1)\nend\n\nwhen [r v] key pressed\nif <(username) = [nl320]> then\n    broadcast (record v)\nend\n\nwhen I receive [tp v]\nResetV\ngo to x: (transport X) y: (transport Y)\nwait until <not <touching (portals v)?>>\nset [touching player v] to [false]\n\nwhen I start as a clone\nswitch costume to (costume)\nclear graphic effects\nset size to (80) %\nshow\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-2.5)\nend\ndelete this clone\n\nwhen I receive [death v]\nset [lock v] to [2]\n\nwhen I receive [playerstartup v]\nset size to (125) %\nforever\n    switch costume to (costume)\n    create clone of (tail v)\nend\n\nwhen flag clicked\nhide\n\n@levels\n\nwhen flag clicked\nhide\n\nwhen I receive [playerstartup v]\nset [max_levels v] to [9]\nshow\nforever\n    clear graphic effects\n    go to x: (0) y: (0)\n    switch costume to (Level)\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 [selct_lvl v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [nextlvl v]\ngo to [back v] layer\n\n@Titlescreen\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [loadsprites v]\ngo to x: (0) y: (0)\nif <[1] = (costume [number v])> then\n    forever\n        if <<(page) = [title]> or <(page) = [help]>> then\n            show\n            go to x: (0) y: (0)\n            switch costume to (main title v)\n            set [ghost v] effect to (100)\n            show\n            repeat (10)\n                go to [back v] layer\n                change [ghost v] effect by (-10)\n            end\n            wait until <not <<(page) = [title]> or <(page) = [help]>>>\n        else\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            hide\n            wait until <(page) = [title]>\n        end\n    end\nend\n\nwhen I receive [playerstartup v]\nrepeat (10)\n    go to [back v] layer\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [loadsprites v]\nswitch costume to (level select v)\ncreate clone of (_myself_ v)\nnext costume\ncreate clone of (_myself_ v)\nswitch costume to (main title v)\n\nwhen I start as a clone\ngo to x: (0) y: (0)\nif <[2] = (costume [number v])> then\n    forever\n        if <not <(page) = [select]>> then\n            hide\n        else\n            if <(page) = [select]> then\n                go to [back v] layer\n                switch costume to (level select v)\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            end\n        end\n    end\nend\nif <[3] = (costume [number v])> then\n    forever\n        if <not <(page) = [settings]>> then\n            hide\n        else\n            if <(page) = [settings]> then\n                go to [back v] layer\n                switch costume to (game settings v)\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            end\n        end\n    end\nend\n\nwhen I receive [selct_lvl v]\nif <[1] = (costume [number v])> then\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\nend\n\nwhen I receive [selct_lvl v]\nif <[1] = (costume [number v])> then\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)\nforever\n    if <[1] = (costume [number v])> then\n        go to [back v] layer\n        set y to (([sin v] of (((timer) - (0)) * (150)) ) * (3))\n    end\nend\n\nrepeat (6)\n    change y by (1)\n    wait (.05) seconds\nend\nrepeat (6)\n    change y by (-1)\n    wait (.05) seconds\nend\n\n@Loader\n\nwhen flag clicked\nhide\n\nwhen I receive [loadsprites v]\ngo to x: (0) y: (-52)\ncreate clone of (_myself_ v)\nwait (0.05) seconds\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    turn right ((5) + (([abs v] of ([sin v] of ((direction) / (2)) ) ) * (25))) degrees\n    set [brightness v] effect to (-500)\nend\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nrepeat (pick random (5) to (7))\n    show\n    change [ghost v] effect by (-10)\nend\nwait until <(load) = [1]>\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\n@loadscreen\n\nwhen flag clicked\nhide\n\nwhen I receive [loadsprites v]\nclear graphic effects\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait until <(load) = [1]>\nbroadcast (Ts v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@menu_buttons\n\nwhen flag clicked\nhide\n\nwhen I receive [loadsprites v]\nswitch costume to (play v)\ngo to x: (0) y: (20)\nrepeat (3)\n    create clone of (_myself_ v)\n    change y by (-60)\n    next costume\nend\n\nwhen I start as a clone\nforever\n    if <(page) = [title]> 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) = [title]>>\n    end\nend\n\nwhen I start as a clone\nforever\n    if <<<<(page) = [game]> or <<(page) = [select]> or <(page) = [loading]>>> or <(page) = [help]>> or <(page) = [settings]>> then\n        hide\n        wait until <not <<<<(page) = [game]> or <<(page) = [select]> or <(page) = [loading]>>> or <(page) = [help]>> or <(page) = [settings]>>>\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    forever\n        if <(page) = [title]> then\n            if <touching (mouse-pointer v)?> then\n                set size to (110) %\n                if <mouse down?> then\n                    broadcast (Play v)\n                    broadcast (PlayerStartup v)\n                end\n            else\n                set size to (100) %\n            end\n        end\n    end\nelse\n    if <(costume [number v]) = [2]> then\n        forever\n            if <(page) = [title]> then\n                if <touching (mouse-pointer v)?> then\n                    set size to (110) %\n                    if <mouse down?> then\n                        broadcast (selct_lvl v)\n                    end\n                else\n                    set size to (100) %\n                end\n            end\n        end\n    else\n        if <(costume [number v]) = [3]> then\n            forever\n                if <(page) = [title]> then\n                    if <touching (mouse-pointer v)?> then\n                        set size to (110) %\n                        if <mouse down?> then\n                            broadcast (gm v)\n                        end\n                    else\n                        set size to (100) %\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <touching (mouse-pointer v)?> then\n        point in direction ((90) + (([sin v] of (((timer) - (0)) * (300)) ) * (1.3)))\n    else\n        point in direction ((90) + (([sin v] of (((timer) - (0)) * (150)) ) * (3)))\n    end\nend\n\nwhen I start as a clone\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (15)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\n@Door\n\nwhen I receive [nextlvl v]\nlvl_pos\n\ndefine lvl_pos\nhide\nif <(Level) = [1]> then\n    go to [back v] layer\n    set [lock v] to [2]\n    go to x: (220) y: (-135)\n    show\nend\nif <(Level) = [2]> then\n    go to [back v] layer\n    set [lock v] to [2]\n    go to x: (220) y: (-135)\n    show\nend\nif <(Level) = [3]> then\n    go to [back v] layer\n    set [lock v] to [2]\n    go to x: (216) y: (7)\n    show\nend\nif <(Level) = [4]> then\n    go to [back v] layer\n    set [lock v] to [2]\n    go to x: (157) y: (-60)\n    show\nend\nif <(Level) = [5]> then\n    go to [back v] layer\n    set [lock v] to [2]\n    go to x: (-217) y: (-136)\n    show\nend\nif <(Level) = [6]> then\n    go to [back v] layer\n    set [lock v] to [2]\n    go to x: (128) y: (-20)\n    show\nend\nif <(Level) = [7]> then\n    go to [back v] layer\n    set [lock v] to [2]\n    go to x: (222) y: (-107)\n    show\nend\nif <(Level) = [8]> then\n    go to [back v] layer\n    set [lock v] to [2]\n    go to x: (-208) y: (-137)\n    show\nend\nif <(Level) = [9]> then\n    go to [back v] layer\n    set [lock v] to [2]\n    go to x: (-206) y: (-111)\n    show\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [ts v]\nhide\n\nwhen I receive [playerstartup v]\nforever\n    change [color v] effect by (1)\n    switch costume to (Lock)\nend\n\nwhen I receive [playerstartup v]\nlvl_pos\n\nwhen I receive [selct_lvl v]\nstop [other scripts in sprite v]\nhide\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\n@Help\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nforever\n    if <(page) = [title]> 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) = [title]>>\n    end\nend\n\nwhen I start as a clone\nforever\n    if <<(page) = [settings]> or <<(page) = [game]> or <<(page) = [select]> or <(page) = [loading]>>>> then\n        hide\n        wait until <not <<(page) = [settings]> or <<(page) = [game]> or <<(page) = [select]> or <(page) = [loading]>>>>>\n    end\nend\n\nwhen I receive [loadsprites v]\ngo to x: (210) y: (-150)\ncreate clone of (_myself_ v)\ncreate clone of (help tab v)\n\nwhen I start as a clone\nforever\n    if <touching (mouse-pointer v)?> then\n        set [color v] effect to (100)\n        set size to (108) %\n        if <mouse down?> then\n            if <(page) = [title]> then\n                broadcast (Help v)\n                set [page v] to [help]\n            else\n                if <(page) = [help]> then\n                    set [page v] to [title]\n                end\n            end\n            wait until <not <mouse down?>>\n        end\n    else\n        set size to (100) %\n        set [color v] effect to (0)\n    end\nend\n\nif <(page) = [help]> then\n    if <mouse down?> then\n        if <<(mouse x) < [-50]> or <[50] < (mouse x)>> then\n            if <<(mouse y) < [-100]> or <[100] < (mouse y)>> then\n                set [page v] to [title]\n            end\n        end\n    end\nend\n\n@help tab\n\nwhen I start as a clone\ngo to x: (0) y: (-50)\nhide\nforever\n    if <(page) = [help]> 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) = [help]>>\n    end\nend\n\nwhen I start as a clone\nforever\n    if <<(page) = [game]> or <<(page) = [title]> or <(page) = [loading]>>> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        wait until <not <<(page) = [game]> or <<(page) = [title]> or <(page) = [loading]>>>>\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nforever\n    if <(page) = [help]> then\n        wait until <not <mouse down?>>\n        repeat until <not <(page) = [help]>>\n            if <mouse down?> then\n                if <not <touching (mouse-pointer v)?>> then\n                    set [page v] to [title]\n                end\n            end\n        end\n    end\nend\n\n@Button\n\nwhen I receive [nextlvl v]\nlvl_pos\n\ndefine lvl_pos\nhide\nif <(Level) = [1]> then\n    go to x: (0) y: (-145)\n    show\n    go to [back v] layer\n    repeat until <not <(Level) = [1]>>\n        if <touching (player v)?> then\n            set [lock v] to [1]\n        end\n    end\nend\nif <(Level) = [2]> then\n    go to x: (125) y: (-145)\n    show\n    go to [back v] layer\n    repeat until <not <(Level) = [2]>>\n        if <touching (player v)?> then\n            set [lock v] to [1]\n        end\n    end\nend\nif <(Level) = [3]> then\n    go to x: (-220) y: (95)\n    show\n    go to [back v] layer\n    repeat until <not <(Level) = [3]>>\n        if <touching (player v)?> then\n            set [lock v] to [1]\n        end\n    end\nend\nif <(Level) = [4]> then\n    go to x: (-216) y: (-54)\n    show\n    go to [back v] layer\n    repeat until <not <(Level) = [4]>>\n        if <touching (player v)?> then\n            set [lock v] to [1]\n        end\n    end\nend\nif <(Level) = [5]> then\n    go to x: (-221) y: (23)\n    show\n    go to [back v] layer\n    repeat until <not <(Level) = [5]>>\n        if <touching (player v)?> then\n            set [lock v] to [1]\n        end\n    end\nend\nif <(Level) = [6]> then\n    go to x: (-111) y: (-46)\n    show\n    go to [back v] layer\n    repeat until <not <(Level) = [6]>>\n        if <touching (player v)?> then\n            set [lock v] to [1]\n        end\n    end\nend\nif <(Level) = [7]> then\n    go to x: (-218) y: (-51)\n    show\n    go to [back v] layer\n    repeat until <not <(Level) = [7]>>\n        if <touching (player v)?> then\n            set [lock v] to [1]\n        end\n    end\nend\nif <(Level) = [8]> then\n    go to x: (141) y: (138)\n    show\n    go to [back v] layer\n    repeat until <not <(Level) = [8]>>\n        if <touching (player v)?> then\n            set [lock v] to [1]\n        end\n    end\nend\nif <(Level) = [9]> then\n    go to x: (-114) y: (159)\n    show\n    go to [back v] layer\n    repeat until <not <(Level) = [9]>>\n        if <touching (player v)?> then\n            set [lock v] to [1]\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [ts v]\nhide\n\nwhen I receive [playerstartup v]\nforever\n    switch costume to (Lock)\nend\n\nwhen I receive [death v]\nset [lock v] to [2]\n\nwhen I receive [selct_lvl v]\nstop [other scripts in sprite v]\nhide\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\n@Return\n\nwhen flag clicked\nhide\n\nwhen I receive [loadsprites v]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset drag mode [not draggable v]\nforever\n    if <(page) = [game]> then\n        set size to (70) %\n        go to x: (223) y: (171)\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) = [game]>>\n    end\n    if <<(page) = [stats]> or <(page) = [settings]>> then\n        go to [front v] layer\n        go to x: (-213) y: (-167)\n        set size to (100) %\n        show\n        wait until <not <<(page) = [stats]> or <(page) = [settings]>>>\n    end\n    if <(page) = [title]> then\n        hide\n        wait until <not <(page) = [title]>>\n    end\n    if <(page) = [select]> then\n        show\n        go to x: (-213) y: (-167)\n        set size to (100) %\n        wait until <not <(page) = [select]>>\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(page) = [stats]> then\n        if <touching (mouse-pointer v)?> then\n            set [color v] effect to (100)\n            set size to (106) %\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        end\n    end\n    if <(page) = [select]> then\n        if <touching (mouse-pointer v)?> then\n            set [color v] effect to (100)\n            set size to (106) %\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        end\n    end\n    if <(page) = [game]> then\n        if <touching (mouse-pointer v)?> then\n            set [color v] effect to (100)\n            set size to (72) %\n            if <mouse down?> then\n                broadcast (Ts v)\n            end\n        else\n            set size to (70) %\n            set [color v] effect to (0)\n        end\n    end\n    if <(page) = [settings]> then\n        if <touching (mouse-pointer v)?> then\n            set [color v] effect to (100)\n            set size to (106) %\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        end\n    end\nend\n\n@Stats\n\nwhen I receive [stats/done v]\ngo to [back v] layer\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\nwhen I receive [ts v]\nhide\n\nwhen I start as a clone\nshow\ngo to [back v] layer\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: (-87) y: (28) size: (134) color: (0)\nelse\n    [n/a] x: (-87) y: (28) size: (134) color: (0)\nend\n(☁ Record Time) x: (-62) y: (-18) size: (134) color: (0)\n(Deaths) x: (-129) y: (-62) size: (134) color: (0)\n\nbroadcast (Stats/DONE v)\n\nwhen I start as a clone\nshow\nwait until <(page) = [title]>\ndelete this clone\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nwait until <(page) = [stats]>\nrepeat (10)\n    change [ghost v] effect by (-10)\n    if <not <(page) = [stats]>> then\n        delete this clone\n    end\nend\nwait until <not <(page) = [stats]>>\ndelete this clone\n\n@level select\n\nwhen I receive [loadsprites v]\nCLONE  x: [-183] y: [60] rows: [4] buttons.in.row: [8] distance: [52]\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nhide\nwait until <(page) = [select]>\nforever\n    if <(page) = [select]> 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) = [select]>>\n    else\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        wait until <(page) = [select]>\n    end\nend\n\ndefine next row x: (x) y: (y)\nset x to (x)\nchange y by (y)\n\nwhen I start as a clone\nforever\n    if <(page) = [select]> then\n        if <mouse down?> then\n            if <(ready?) = [1]> then\n                if <touching (mouse-pointer v)?> then\n                    if <mouse down?> then\n                        if <(costume [number v]) = [1]> then\n                            set [level v] to [1]\n                            broadcast (PlayerStartup v)\n                            broadcast (Play v)\n                        else\n                            if <<(username) = [nl320]> or <(username) = [BlueFlamingo12987]>> then\n                                set [level v] to (costume [number v])\n                                broadcast (PlayerStartup v)\n                                broadcast (lvl selected v)\n                            else\n                                if <[levels completed v] contains (costume [number v])?> then\n                                    set [level v] to (costume [number v])\n                                    broadcast (PlayerStartup v)\n                                    broadcast (lvl selected v)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine CLONE  x: (x) y: (y) rows: (r) buttons.in.row: (b.i.r.) distance: (d)\nswitch costume to (l1 v)\ngo to x: (x) y: (y)\nrepeat (r)\n    repeat (b.i.r.)\n        create clone of (_myself_ v)\n        change x by (d)\n        next costume\n    end\n    next row x: (x) y: [-32]\nend\n\nwhen I receive [playerstartup v]\nhide\n\nwhen I start as a clone\nforever\n    if <(costume [number v]) = [1]> then\n        if <touching (mouse-pointer v)?> then\n            set [brightness v] effect to (-5)\n            set [color v] effect to (0)\n            set size to (106.7) %\n        else\n            set [brightness v] effect to (0)\n            set [color v] effect to (0)\n            set size to (100) %\n        end\n    else\n        if <<(username) = [nl320]> or <(username) = [BlueFlamingo12987]>> then\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (-5)\n                set [color v] effect to (0)\n                set size to (106.7) %\n            else\n                set [brightness v] effect to (0)\n                set [color v] effect to (0)\n                set size to (100) %\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 [color v] effect to (0)\n                    set size to (106.7) %\n                else\n                    set [brightness v] effect to (0)\n                    set [color v] effect to (0)\n                    set size to (100) %\n                end\n            else\n                set [color v] effect to (0)\n                set [brightness v] effect to (-30)\n            end\n        end\n    end\nend\n\nwhen I receive [selct_lvl v]\nwait until <not <mouse down?>>\nset [ready? v] to [1]\n\nwhen I receive [playerstartup v]\nset [ready? v] to [0]\n\nwhen I receive [ts v]\nset [ready? v] to [0]\n\n@run example\n\nwhen I start as a clone\ngo to x: (0) y: (-161)\nhide\nforever\n    if <(page) = [help]> then\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) = [help]>>\n            if <touching (mouse-pointer v)?> then\n                set size to (106) %\n                set [brightness v] effect to (-14)\n                if <mouse down?> then\n                    set [level v] to [1]\n                    broadcast (Play v)\n                    broadcast (PlayerStartup v)\n                    broadcast (playback rec v)\n                end\n            else\n                set size to (100) %\n                set [brightness v] effect to (0)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nforever\n    if <<(page) = [game]> or <<(page) = [title]> or <(page) = [loading]>>> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        wait until <not <<(page) = [game]> or <<(page) = [title]> or <(page) = [loading]>>>>\n    end\nend\n\nwhen I receive [loadsprites v]\ncreate clone of (_myself_ v)\n\n@Coming Soon...\n\nwhen I start as a clone\nforever\n    if <<(page) = [game]> or <<(page) = [title]> or <(page) = [loading]>>> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        wait until <not <<(page) = [game]> or <<(page) = [title]> or <(page) = [loading]>>>>\n    end\nend\n\nwhen I receive [loadsprites v]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\ngo to x: (0) y: (0)\nhide\n\nforever\n    if <(page) = [settings]> then\n        if <not <(username) = [nl320]>> then\n            set [ghost v] effect to (100)\n            show\n            repeat (10)\n                change [ghost v] effect by (-10)\n            end\n            go to x: (0) y: (0)\n            repeat until <not <(page) = [settings]>>\n                repeat (5)\n                    change y by (-1)\n                    wait (0.05) seconds\n                end\n                repeat (5)\n                    change y by (1)\n                    wait (0.05) seconds\n                end\n            end\n        end\n    end\nend\n\n@splash\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nforever\n    go to [front v] layer\nend\n\n@Music\n\nwhen I receive [loadsprites v]\nSetup music\n\ndefine Setup music\nset [volume v] to [70]\nset volume to ((volume) - (volume)) %\ndelete all of [music list v]\nadd [Adventure] to [music list v]\n\nwhen I receive [loadsprites v]\nwait (3) seconds\nrepeat (10)\n    change volume by (7)\nend\n\nwhen I receive [loadsprites v]\nwait (3) seconds\nforever\n    play music\nend\n\ndefine play music\nif <[music list v] contains [Adventure]?> then\n    play sound [Adventure v] until done\nend\n\nwhen I receive [skip v]\nstop all sounds\n\nwhen flag clicked\nforever\n    set volume to (volume) %\nend\n\n@Portals\n\nwhen I receive [loadsprites v]\nswitch costume to (type 1 v)\nrepeat (2)\n    create clone of (_myself_ v)\n    next costume\nend\nswitch costume to (none v)\nhide\n\nwhen I start as a clone\nhide\n\nwhen I receive [nextlvl v]\nif <(costume [name v]) = [Type 1]> then\n    typ1 pos\nelse\n    if <(costume [name v]) = [Type 2]> then\n        typ2 pos\n    end\nend\n\ndefine typ1 pos\nhide\nif <(Level) = [6]> then\n    go to x: (-50) y: (144)\n    show\n    set [portal 1 x v] to (x position)\n    set [portal 1 y v] to (y position)\n    set [ghost v] effect to (0)\n    repeat until <not <(Level) = [6]>>\n        show\n        if <(touching player) = [false]> then\n            if <touching (player v)?> then\n                transport\n            end\n        end\n    end\nend\nif <(Level) = [9]> then\n    go to x: (-185) y: (147)\n    show\n    set [portal 1 x v] to (x position)\n    set [portal 1 y v] to (y position)\n    set [ghost v] effect to (0)\n    repeat until <not <(Level) = [9]>>\n        show\n        if <(touching player) = [false]> then\n            if <touching (player v)?> then\n                transport\n            end\n        end\n    end\nend\n\ndefine typ2 pos\nhide\nif <(Level) = [6]> then\n    go to x: (211) y: (140)\n    show\n    set [portal 2 x v] to (x position)\n    set [portal 2 y v] to (y position)\n    set [ghost v] effect to (0)\n    repeat until <not <(Level) = [6]>>\n        show\n        if <(touching player) = [false]> then\n            if <touching (player v)?> then\n                transport\n            end\n        end\n    end\nend\nif <(Level) = [9]> then\n    go to x: (27) y: (-148)\n    show\n    set [portal 2 x v] to (x position)\n    set [portal 2 y v] to (y position)\n    set [ghost v] effect to (0)\n    repeat until <not <(Level) = [9]>>\n        show\n        if <(touching player) = [false]> then\n            if <touching (player v)?> then\n                transport\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    change [color v] effect by (2)\nend\n\ndefine transport\nset [touching player v] to [true]\nif <(costume [number v]) = [1]> then\n    set [transport x v] to (portal 2 X)\n    set [transport y v] to (portal 2 Y)\nelse\n    if <(costume [number v]) = [2]> then\n        set [transport x v] to (portal 1 X)\n        set [transport y v] to (portal 1 Y)\n    end\nend\nbroadcast (tp v)\n\nwhen I start as a clone\nforever\n    if <<(page) = [stats]> or <<(page) = [title]> or <(page) = [loading]>>> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        wait until <not <<(page) = [stats]> or <<(page) = [title]> or <(page) = [loading]>>>>\n    end\nend\n\nbroadcast (NextLvl v)\n\n@recording\n\nwhen I receive [record v]\nforever\n    wait (.5) seconds\n    show\n    wait (1) seconds\n    hide\nend\n\nwhen I receive [stats/done v]\nstop [other scripts in sprite v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [ts v]\nstop [other scripts in sprite v]\nhide\n\n@costumeselect\n\nwhen I receive [loadsprites v]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    go to x: (-157) y: (-5)\n    switch costume to (costume)\n    if <[4] < (costume)> then\n        set [costume v] to [1]\n    end\nend\n\nwhen I start as a clone\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        set [ghost v] effect to (0)\n        wait until <not <(page) = [settings]>>\n    end\n    if <not <(page) = [settings]>> then\n        set [ghost v] effect to (100)\n        hide\n        wait until <(page) = [settings]>\n    end\nend\n\nwhen I start as a clone\nset [distance v] to [70]\nforever\n    if <(page) = [settings]> then\n        repeat until <not <(page) = [settings]>>\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (-2)\n                set [color v] effect to (0)\n                set size to (206) %\n                if <mouse down?> then\n                    set size to (211) %\n                    set [brightness v] effect to (5)\n                    change [costume v] by (1)\n                    wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n                end\n            else\n                set size to (200) %\n                set [color v] effect to (0)\n                set [brightness v] effect to (0)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nif <<((mouse x) + (distance)) < (x position)> and <((mouse x) - (distance)) < (x position)>> then\n    if <<((mouse y) + (distance)) < (y position)> and <((mouse y) - (distance)) < (y position)>> then\nend\n\nwhen I start as a clone\n\n@Tail\n\nwhen I start as a clone\nset [color v] effect to (10)\ngo to (player v)\nswitch costume to (costume)\nclear graphic effects\nset size to (80) %\nshow\nrepeat (11)\n    change [ghost v] effect by (10)\n    change size by (-2.5)\n    if <key (right arrow v) pressed?> then\n        turn right (6) degrees\n    end\n    if <key (left arrow v) pressed?> then\n        turn right (-6) degrees\n    end\nend\ndelete this clone\n\nwhen flag clicked\nhide\n\n@costumeheader\n\nwhen I receive [loadsprites v]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    go to x: (-157) y: (-35)\n    switch costume to (costume)\nend\n\nwhen I start as a clone\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        set [ghost v] effect to (0)\n        wait until <not <(page) = [settings]>>\n    end\n    if <not <(page) = [settings]>> then\n        set [ghost v] effect to (100)\n        hide\n        wait until <(page) = [settings]>\n    end\nend\n\nwhen I start as a clone\nset [distance v] to [70]\nforever\n    if <(page) = [settings]> then\n        repeat until <not <(page) = [settings]>>\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (-2)\n                set [color v] effect to (0)\n                set size to (156) %\n            else\n                set size to (150) %\n                set [color v] effect to (0)\n                set [brightness v] effect to (0)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\n@Sprite1\n\nforever\n    if <[1] = (costume [number v])> then\n        go to [back v] layer\n        set y to (([sin v] of (((timer) - (0)) * (300)) ) * (6.4))\n    end\nend\n\n