(Platformer) Nightlight for Scratch 3 v1.7

Instructions: Noss, the Cube of Darkness, has trapped the land in eternal night! Retrieve the 20 Medallions and defeat Noss to bring forth daylight again!\n----------------------------------------\nArrow Keys / Z to Move and Jump\nSpace to Start, Pause & Get Level Code\n----------------------------------------\nPlease ❤️  and ⭐ !

@Stage\n\nwhen I receive [start v]\nCorrectMusic\nforever\n    if <(MusicPref) = [2]> then\nend\n\nwhen flag clicked\nset [musicpref v] to [0]\nset [a v] to [0]\nerase all\n\nwhen I receive [wait v]\nswitch backdrop to (black v)\nrepeat (15)\n    clear graphic effects\nend\nbroadcast (title v)\nset [brightness v] effect to (-100)\nswitch backdrop to (nightlight v)\nrepeat (10)\n    change [brightness v] effect by (5)\nend\n\nwhen backdrop switches to [explstar v]\nforever\n    clear graphic effects\n    repeat (5)\n        change [brightness v] effect by (-20)\n        wait (0.1) seconds\n        if <(backdrop [number v]) = [1]> then\n    end\n    repeat (5)\n        change [brightness v] effect by (20)\n        wait (0.1) seconds\n        if <(backdrop [number v]) = [1]> then\n    end\nend\n\nwhen I receive [levelstart v]\nset volume to (100) %\nclear graphic effects\nif <(backdrop [name v]) = [ExplStar]> then\n    switch backdrop to (explstar v)\nend\nif <(a) = [6]> then\n    broadcast (swordboss v)\n    set [music v] to [8]\n    stop all sounds\nend\nif <(a) = [7]> then\n    set [music v] to [4]\n    stop all sounds\nend\nif <(a) = [13]> then\n    broadcast (noss1 v)\n    set [music v] to [8]\n    stop all sounds\nend\nif <(a) = [14]> then\n    switch backdrop to (brick v)\n    set [music v] to [3]\n    stop all sounds\nend\nif <(a) = [18]> then\n    set [music v] to [10]\n    stop all sounds\nend\nif <(a) = [20]> then\n    switch backdrop to (explstar v)\n    set [music v] to [1]\n    stop all sounds\nend\nif <(a) = [21]> then\n    switch backdrop to (explstar v)\n    set [music v] to [0]\n    stop [other scripts in sprite v]\n    stop all sounds\nend\nif <(a) = [22]> then\n    switch backdrop to (explstar v)\n    set [music v] to [0]\n    stop all sounds\nend\n\nset [music v] to [11]\nstop all sounds\n\ndefine CorrectMusic\nif <(a) < [6]> then\n    set [music v] to [0]\nend\nif <(a) = [6]> then\n    set [music v] to [8]\nend\nif <<(a) > [6]> and <(a) < [13]>> then\n    set [music v] to [4]\nend\nif <(a) = [13]> then\n    set [music v] to [8]\nend\nif <<(a) > [13]> and <(a) < [18]>> then\n    set [music v] to [3]\n    switch backdrop to (brick v)\nend\nif <<(a) > [17]> and <(a) < [20]>> then\n    set [music v] to [10]\nend\nif <(a) = [20]> then\n    set [music v] to [1]\nend\n\nwhen I receive [pause v]\nset volume to (20) %\n\nwhen I receive [unpause v]\nrepeat (8)\n    change volume by (10)\nend\nset volume to (100) %\n\nwhen I receive [bosskill v]\nset [music v] to [?]\nstop all sounds\n\nwhen I receive [beginend v]\nswitch backdrop to (sky v)\nset [music v] to [0]\nstop [other scripts in stage v]\nstop all sounds\nset [brightness v] effect to (-100)\nwait (1) seconds\nrepeat (100)\n    repeat (2)\n        change [brightness v] effect by (1)\n    end\n    change [brightness v] effect by (-1)\nend\nclear graphic effects\nwait (1) seconds\nbroadcast (endtext v)\nforever\n    if <(MusicPref) = [0]> then\n        play sound [Exploration v] until done\n    else\n        play sound [Playful Exercise v] until done\n    end\nend\n\nwhen I receive [reset v]\nset [brightness v] effect to (-50)\nswitch backdrop to (nightlight v)\nrepeat (50)\n    change volume by (-2)\nend\nstop all sounds\nstop [other scripts in sprite v]\nwait (0.1) seconds\nset volume to (100) %\nbroadcast (cursor v)\n\n@Trianull\n\nwhen flag clicked\ngo to x: (0) y: (4)\nset [vel v] to [3]\nstop all sounds\nrepeat (30)\n    change [vel v] by (-0.2)\n    change y by (vel)\n    if <key (any v) pressed?> then\n        hide\n        clear graphic effects\n        broadcast (wait v)\n        stop [this script v]\n    end\nend\nstart sound [click v]\nrepeat (30)\n    wait (0) seconds\n    if <key (any v) pressed?> then\n        hide\n        clear graphic effects\n        broadcast (wait v)\n        stop [this script v]\n    end\nend\nrepeat (4)\n    change [ghost v] effect by (25)\nend\nhide\nclear graphic effects\nbroadcast (wait v)\n\nwhen [u v] key pressed\nif <(username) = [TriforceMayhem]> then\n    go to x: (0) y: (0)\n    switch costume to (blue v)\n    switch backdrop to (explstar v)\n    show\n    erase all\nend\n\nwhen flag clicked\nswitch backdrop to (explstar v)\nswitch costume to (white v)\nif <key (any v) pressed?> then\n    hide\nelse\n    show\n    set size to (200) %\n    repeat (18)\n        next costume\n        wait (0.1) seconds\n    end\nend\n\n@Ground\n\ndefine render\nif <(isclone) = [0]> then\n    delete (all) of [coinloc v]\n    delete (all) of [orbloc v]\n    set [coins v] to [0]\n    set [orbs v] to [0]\n    set [render v] to [1]\n    set [rpressed v] to [0]\n    erase all\n    go to x: (-232) y: (-172)\n    set [b v] to [0]\n    repeat (23)\n        repeat (30)\n            change [b v] by (1)\n            if <(length of (item (a) of [level v])) < (b)> then\n                stop [this script v]\n            end\n            switch costume to (letter (b) of (item (a) of [level v]))\n            if <not <[.] = (letter (b) of (item (a) of [level v]))>> then\n                if <not <[stamps v] contains (costume [number v])?>> then\n                    create clone of (_myself_ v)\n                else\n                    set [ghost v] effect to (0)\n                    stamp\n                    clear graphic effects\n                end\n            end\n            change x by (16)\n        end\n        change y by (16)\n        set x to (-232)\n    end\n    set [render v] to [0]\n    show\n    go to x: (0) y: (0)\n    switch costume to ((a) + (64))\n    if <(costume [number v]) > [64]> then\n        set [ghost v] effect to (100)\n        create clone of (_myself_ v)\n    end\n    switch costume to (c v)\n    hide\nend\n\nwhen I receive [advancelevel v]\nif <(a) = [21]> then\n    erase all\n    broadcast (beginend v)\nelse\n    if <(a) = [23]> then\n        set [a v] to [22]\n    end\n    wait (0) seconds\n    show\n    render\n    hide\n    broadcast (levelstart v)\nend\n\ndefine Corner Test (dir) (x) (y)\nset [6065 v] to <<(costume [number v]) > [60]> and <(costume [number v]) < [65]>>\nset [detect v] to [0]\npoint in direction (dir)\nchange y by (y)\nif <<touching color (#787878)?> or <<touching color (#f8b800)?> or <<<touching color (#503000)?> and <(6065) = [false]>> or <touching color (#00a800)?>>>> then\n    change [detect v] by (1)\nend\nchange y by ((0) - (y))\nchange x by (x)\nif <<touching color (#787878)?> or <<touching color (#f8b800)?> or <<<touching color (#503000)?> and <(6065) = [false]>> or <touching color (#00a800)?>>>> then\n    change [detect v] by (1)\nend\nchange x by ((0) - (x))\nif <(6065) = [true]> then\n    point in direction (90)\nend\nif <(detect) = [2]> then\n    stamp\nend\n\nwhen I receive [start v]\nset [isclone v] to [0]\nbroadcast (advancelevel v)\n\nwhen I start as a clone\nset [isclone v] to [1]\nif <<<(costume [number v]) = [10]> or <(costume [number v]) = [11]>> or <(costume [number v]) = [12]>> then\n    change y by (-16)\n    stamp\n    hide\nend\nif <(costume [number v]) = [13]> then\n    switch costume to (a v)\n    stamp\n    switch costume to (m v)\n    set rotation style [all around v]\n    repeat until <(render) = [0]>\n    if <touching (thumb v)?> then\n        wait until <not <touching (thumb v)?>>\n        wait until <(e) = [0]>\n    end\n    Corner Test (90) (8) (8)\n    Corner Test (0) (-8) (8)\n    Corner Test (-90) (-8) (-8)\n    Corner Test (180) (8) (-8)\n    hide\nend\nif <(costume [number v]) = [14]> then\n    change y by (16)\n    add (x position) to [coinloc v]\n    add (y position) to [coinloc v]\n    change y by (-16)\n    set [coins v] to [1]\n    stamp\n    hide\nend\nif <(costume [number v]) = [15]> then\n    forever\n        change y by (1)\n        if <touching (hitbox v)?> then\n            broadcast (varreset v)\n        end\n        change y by (-1)\n    end\nend\nif <<(costume [number v]) = [16]> or <(costume [number v]) = [17]>> then\n    stamp\n    change y by (-16)\n    switch costume to (k v)\n    stamp\n    hide\nend\nif <(costume [number v]) = [20]> then\n    set [origin v] to (y position)\n    forever\n        change y by (1.5)\n        if <touching (hitbox v)?> then\n            change y by (-1.5)\n            repeat (8)\n                next costume\n                start sound [Break v]\n                wait (0.07) seconds\n            end\n            set [vel v] to [0]\n            start sound [Fall v]\n            repeat until <touching (_edge_ v)?>\n                change [vel v] by (-1)\n                change y by (vel)\n            end\n            hide\n            wait (3) seconds\n            switch costume to (t v)\n            set y to (origin)\n            change y by (1.5)\n            show\n        end\n        change y by (-1.5)\n    end\nend\nif <(costume [number v]) = [29]> then\n    change y by (16)\n    add (x position) to [switchloc v]\n    add (y position) to [switchloc v]\n    change y by (-16)\n    set [switches v] to [1]\n    stamp\n    set [ghost v] effect to (100)\nend\nif <(costume [number v]) = [31]> then\n    forever\n        show\n        set [blocks v] to [0]\n        delete (all) of [timing v]\n        wait until <(switchPressed) = [1]>\n        add (x position) to [timing v]\n        add (y position) to [timing v]\n        hide\n        wait until <(switchPressed) = [0]>\n        show\n    end\nend\nif <(costume [number v]) = [32]> then\n    set [rpressed v] to [0]\n    forever\n        next costume\n        if <<[32] > (costume [number v])> or <(costume [number v]) > [33]>> then\n            switch costume to (x v)\n        end\n        repeat (2)\n            change y by (1.5)\n            if <touching (hitbox v)?> then\n                switch costume to (x3 v)\n                change y by (-1.5)\n                if <(rPressed) = [0]> then\n                    set [rpressed v] to [1]\n                else\n                    set [rpressed v] to [0]\n                end\n                start sound [FDS v]\n                wait (1) seconds\n                hide\n                if <(rPressed) = [0]> then\n                    wait until <(rPressed) = [1]>\n                else\n                    wait until <(rPressed) = [0]>\n                end\n                change y by (1.5)\n                show\n            end\n            change y by (-1.5)\n        end\n    end\nend\nif <(costume [number v]) = [35]> then\n    set [rpressed v] to [0]\n    switch costume to (y v)\n    stamp\n    switch costume to (z v)\n    show\n    go to [front v] layer\n    forever\n        switch costume to (y v)\n        stamp\n        hide\n        wait until <(rPressed) = [1]>\n        show\n        switch costume to (z v)\n        stamp\n        go to [front v] layer\n        wait until <(rPressed) = [0]>\n    end\nend\nif <(costume [number v]) = [36]> then\n    set [rpressed v] to [0]\n    switch costume to (y v)\n    stamp\n    show\n    go to [front v] layer\n    hide\n    forever\n        show\n        switch costume to (z v)\n        go to [front v] layer\n        wait until <(rPressed) = [1]>\n        hide\n        wait until <(rPressed) = [0]>\n    end\nend\nif <(costume [number v]) = [45]> then\n    switch costume to (a v)\n    stamp\n    switch costume to (9 v)\n    set rotation style [all around v]\n    repeat until <(render) = [0]>\n    if <touching (thumb v)?> then\n        wait until <not <touching (thumb v)?>>\n        wait until <(e) = [0]>\n    end\n    Corner Test (90) (8) (8)\n    Corner Test (0) (-8) (8)\n    Corner Test (-90) (-8) (-8)\n    Corner Test (180) (8) (-8)\n    hide\nend\nif <(costume [number v]) = [46]> then\n    stamp\n    hide\n    forever\n        wait until <((y position) + (14.5)) < ([y position v] of [hitbox v])>\n        show\n        wait until <((y position) + (14.5)) > ([y position v] of [hitbox v])>\n        hide\n    end\nend\nif <(costume [number v]) = [47]> then\n    change y by (-16)\n    add (x position) to [coinloc v]\n    add (y position) to [coinloc v]\n    change y by (16)\n    set [coins v] to [1]\nend\nif <(costume [number v]) = [48]> then\n    forever\n        change x by (-1)\n        if <touching (hitbox v)?> then\n            broadcast (varreset v)\n        end\n        change x by (1)\n    end\nend\nif <(costume [number v]) = [49]> then\n    forever\n        change x by (1)\n        if <touching (hitbox v)?> then\n            broadcast (varreset v)\n        end\n        change x by (-1)\n    end\nend\nif <(costume [number v]) = [50]> then\n    forever\n        change y by (-1.75)\n        if <touching (hitbox v)?> then\n            broadcast (varreset v)\n        end\n        change y by (1.75)\n    end\nend\nif <(costume [number v]) = [60]> then\n    set rotation style [all around v]\n    repeat until <(render) = [0]>\n    if <touching (thumb v)?> then\n        wait until <not <touching (thumb v)?>>\n    end\n    wait (0.1) seconds\n    wait until <(e) = [0]>\n    switch costume to (`tr v)\n    Corner Test (90) (8) (8)\n    switch costume to (`tl v)\n    Corner Test (0) (-8) (8)\n    switch costume to (`bl v)\n    Corner Test (-90) (-8) (-8)\n    switch costume to (`br v)\n    Corner Test (180) (8) (-8)\n    hide\nend\nif <(costume [number v]) > [64]> then\n\nwhen flag clicked\nhide\n\nwhen I receive [advancelevel v]\ndelete this clone\n\n@color palette\n\nwhen flag clicked\ndelete (all) of [stamps v]\nadd [1] to [stamps v]\nadd [18] to [stamps v]\nadd [51] to [stamps v]\nadd [2] to [stamps v]\nadd [3] to [stamps v]\nadd [4] to [stamps v]\nadd [5] to [stamps v]\nadd [6] to [stamps v]\nadd [7] to [stamps v]\nadd [8] to [stamps v]\nadd [9] to [stamps v]\nadd [19] to [stamps v]\nadd [37] to [stamps v]\nadd [38] to [stamps v]\nadd [39] to [stamps v]\nadd [40] to [stamps v]\nadd [41] to [stamps v]\nadd [42] to [stamps v]\nadd [43] to [stamps v]\nadd [44] to [stamps v]\nadd [52] to [stamps v]\nadd [53] to [stamps v]\nadd [54] to [stamps v]\nadd [55] to [stamps v]\nadd [56] to [stamps v]\nadd [57] to [stamps v]\nadd [58] to [stamps v]\nadd [59] to [stamps v]\n\nwhen flag clicked\ndelete (all) of [level v]\nadd [eaaaaaaaaafeaaaafeaaaaaaaaaaaaeaaaaaaaaafbccccdeaaaaaaaaaaaaeaaaaaaaaafooooooeaaaaaaaaaaaaeaaaaaaaaaf......eaaaaaaaaaaaaeaaaaaaaaaf......eaaaaaaaaaaaabcccccccccd......bcccmaaaaaaaajkpppkkpqkl......jkqpeaaaaaaaa.....................eaaaaaaaa.....................eamccccnc.....................bcdkpkq.k.....................qpl..............................................................................................................................................................................................................................................................................................................................................................................] to [level v]\nadd [aaaaaaaaaafr.r.r.r.r.r.eaaaaaaaaaaaaaaaafo.o.o.o.o.o.eaaaaaaaaaaaaaaaaf............eaaaaaaaaaaaaaaaaf............eaaaaaaaaaaaaaaaaf............eaaaaaaaaaaaaaaaaf.gi.........eaaaaaaaaaaaaaaaaf.jl.........eaaaaaaaaaaaaaaaaf.......gi...eaaaaaaccccccccccd.......jl...eaaaaaaqkkpkpqqkkl...........gmaaaaaa.....................gmaaaaaaa.....................bcmaaaaaa.....................kqeaaaaaa............ghhhhi.....eaaaaaa............jpqqkl.....eaaaaaa......ghi..............eaaaaaa......qkp..............eaaaaaa.......................eaaaaaa.............ghhhhi....bccnccc.............jqkkpl....pkq.kqk..........................................................................................] to [level v]\nadd [aaaaaaf..............srrrrrrrraaaaaaf..............srrrrrrrraaaaaaf..............srrrrrrrraaaaaaf..............sssssrrrraaaaaaf..................srrrraaaaaaf..t....t..........srrrraaaaaaf..................srrrraaaaaaf..................ssnssaaaaaaf.......................ccccccd.......................kpkqqkl....gi............................ef.........ghhhhhhh...........ef.......ghmaaaaaaa...........ef......gmaaaaaaaaa...........emhhhhhhmaaaaaaaaaa...........eaaaaaaaaaaaaaaaaaa.........ghmaaaaaaaaaaaaaaaaaa.......ghmaaaaaaaaaaaaaaaaaaaa.....ghmaaaaaaaaaaaaaaaaaaaaaa...ghmaaaaaaaaaaaaaaaaaaaaaaaa..gmaaaaaaaaaaaaaaaaaaaaaaaaaa.gmaaaaaaaaaaaaaaaaaaaaaaaaaaa.eaaaaaaaaaaaaaaaaaaaaaaaaaaaa] to [level v]\nadd [rrrrrs...................srrrrrrrrrs...................srrrrrrrrrs...................srrrrrrrrrs...................srrrrrrssss...................ssnssrrs......t...t................rrs...........................sss..............t...................................................gi............................emhi.................hi......gmaaf.................amhi...gmaaami...............gaaamhhhmaaaaamhi...........ghmaaaaaaaaaaaaaaamhhi.....ghhmaaaaaaaaaaaaaaaaaaaamhhhhhmaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] to [level v]\nadd [aaaaaf.............t....eaaaaaaaaaaf...t..............bcmaaaaaaaaf........t...........bmaaaaamcd.....................bcmmccd.........................ef...........................gmf.....ghhhvvvvvvhhhi.......gmami...gmmcdoo..oobccmhhi....peafp..gmaf...........bcmmhhi..eaf...qeaf.............bmafp..eami...emmi.............emd...eaami..efpp..ghhhi......ef...gmaafq..ef....pqncmi....gmd...eaaaf...bmi.......ef....bd....eaaaf....ef.......ef....w....gmaaami...ef.ghhhhhmmi...w....eaaaaami..emhmccuccmamhi.w..ghmaaaaaaf..bccd.....bmaamhhhhmaaaaaaaaf............eaaaaaaaaaaaaaaaami..........gmaaaaaaaaaaaaaaaaami.......ghmaaaaaaaaaaaaaaaaaaamhhhhhhhmaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] to [level v]\nadd [aaaaaaaaaaafbccccdeaaaaaaaaaaaaaaaaaaaaaafooooooeaaaaaaaaaaaaaaaaaaaaaaf......eaaaaaaaaaaaaaaaaaaaaaaf......eaaaaaaaaaaaaaaaaaaaaaaf......eaaaaaaaaaaaaaaaaaaaaaaf......eaaaaaaaaaaaaaaaaaaaaaaf......eaaaaaaaaaaacccccccccccd......bccccccccccckkpppkkqpkkl......jkqkqkkpqqpp....................................................................................................................................................................................................................................................................................................................................................................................................................................] to [level v]\nadd [aaaaaa5...................4aaaaaaaaa5...........y.......4aaaaaaaaa5...................4aaaaaaaaa5.....y.zzz.........1222aaaaaa5............zzz......x.aaaaaa5.......................2222223..zzz..............................................................................................................y..........................................................................................................................y678...........................4a5..........67778............123...t......4aaa5......68..............t..12n23......13....................................................................................................................................................] to [level v]\nadd [aaaaaaaaaaaaaaaa5..!!!!!4aa5..aaaaaaaaaaaaaaaa5.....x.4aa98.aaaaaaaaaaaaaaaa5.......4aaa5.a9222222222229aa5.......4aaa98a5...w..w....4aa5..!!!!!122223a5...w.......4aa5.......aaaa..a5...w.......4aa5.......aaaa..a5.........!!4aa5!!!!!!!6778!.a5...........4aa5ooooooo4aa5..a978.........1223.......1223..aaa978........................aaaaa98.......................aaaaaa98......................aaaaaaa9778!!!!!..............229a9222223....................z1u3z.........................z...z......68ww68.............z...z......45!!45.............zzzzz......45..45........................45..45........................45..45........................497@95........................4aaaa5............] to [level v]\nadd [aaaa5...ooo45.45..45..soo4aaaaaaaa5......13.13..13..s..4aaaaaaaa5....s............s..4aaaa22223....s..#s$.......s..12222.........s..#ssss%s...s.......8........s..#ssssss!!!s.......978.....ss..#ss.......s.......aa98.....s...s$.sssssss@s.....aaa98....s...s$.s.......s.....aaaa98...s$..s$!s.......s.....aaaa93...s$..s$.s.......s.....aaaa5....s$..s$.s.......s.....aaaa5....s$..s$.s.......s.....aaaa5....s...s$!s.......s.....aaaa5...ss...s$.s.......s.....aaaa5....s..#s$.s!!!!!!!s.....aaaa5....s..#s$.sooooooos.....aaaa5....s..#s$!s......!s.....aaaa5.......#s$...............aaaa5.......ss$...............aaaa97778...ss$...............aaaaaaaa97778.................aaaaaaaaaaaa5.................] to [level v]\nadd [aaaaaaaaa5oooooooo4aa5......4aaaaaaaaaa5........4aa5......4aaaaaaaaaa5........1223......4a22222229a5..................4a.......4a5..................4a.......4a5..................4a.......4a5.............%....4a8ss....4a5.............o....4a5oo....4a5..................4a5......4a5..................4a5......4a5..................4a5......4a5...678............4a5....ss4a5...4a5.......%....4a5....oo4a5...4a5.......o....4a5......4a5...4a5............4a5......4a5...4a5............4a5......4a5...4a5............4a5s.....4a5...4a5............4a5o.....123...4a5.......%....4a5............4a5.......o....1n5............4a5..............5............4a5..............5............4a5..............] to [level v]\nadd [4aaaaaaaaaaaaa5............4aa4aaaaaaaaaaaaa5............4aa4aaaaaaaaaaaaa5............4aa4aaaaaaaaaaaaa5............1n2122222222222223............w........y....................w........y.............zzz....w..$..#ss$.#s..........z.z....w..$...#s$.#s..........z.z....w..$....s$.#s....%.....zzz....w..s$...s$.#s...#s$...........w..ss$..s$.#s...#s$...........w..sss!!s$.#s...#s$...........w..sx...s$.#s...#s$...........w..s....s$.#s...#s$...........w.......su!ss...#s$...........w.......s...s...#s$...........w.......s...s...#s$...........w.......s...s...#s$...........w.......s!!!s...#s$..........#s$..............#s$..........#s$..............#s$..........#s$..............#s$..........#s$.] to [level v]\nadd [aaaaaa5....................4aaaaa92n3....................4aaaaa5......................69aaaaa5.....................6aaaaaaa9778..................129aaaaaaaa5....................4aaaaaaaa5....................4aaaaaaaa5....................4aaaaaaaa5....................4aaaaaaaa5....................4aaaaaaaa5....................4aaaaaaaa5....................4aaaaaaaa5....................4aa2222223wwwwwwwwwwwwwwwwwwww1u2..............................................................................................................................................................................................................................................................................] to [level v]\nadd [2222222222229aaaa9222222222222............4aaaa5........................4aaaa5........................122223......................................._=+...........................\)^-...........................\)^-...........................\)^-......6778.................\)^-......1223.................\)^-...........................\)^-...........................\)^-...........................\)^-.......................6777\)^-.......................1222\)^-...........................\)^-...........................\)^-...67778...................\)^-...12223...................\)^-...........................\)^-.........................._`^-..........................&**\(..............................] to [level v]\nadd [^^^-..........................^^^-..........................***\(...t...................................t.............................................................................................t.....................................................................................t.......t................t..............................................................................u.......................................t.....%%%..........................%_=+%........................#_`^`+$.......................#\)^^^-$.......................#&*n*\($........%%%..............w.w.........._=+..............www..........\)^-...........................\)^-...........................\)^-.] to [level v]\nadd [^^^^-......................\)^^^^^^-......................\)^^****\(...t...t...t...t..t..t\)^^...........................\)^^...........................\)^^...........................&**....._==================+..........\)`*****************\(....._====`-oooooooooooooooooo.....&*****\(..t...t...t...t...t.....................................................................t.............................._=======================......&*******************`^^^......oooooooooooooooooooo\)^^^......t....t....t....t....&*n*........................................................................................................................==============================^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^] to [level v]\nadd [^^^^-....................\)^^^^^^^^-....................\)^^^^****\(....................&*u**.....................................................................................................................................................................................................................................................................................................................................%%%%%====+...................._====^^^^-....................\)^^^^****\(....................&*n**..x......................zw.wz.........................zwwwz.........................zzzzz..........................................................................................] to [level v]\nadd [^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^`****************************`-...........................#\)-...........................#\)-...........................#\)-!!_+......y.....zww..._+z..#\)-..\)-..................\)-...#\)-..\)-..................\)-...#\)-%.\)-..................\)-...#\)-sz\)-......y.......zww.\)-z..#\)-..\)-..................\)-...#\)-..\)-..................\)-...#\)-.%\)-..................\)-...#\)-zs\)-......y.....wwz...\)-z..#\)-..\)-..................\)-...#\)-..\)-..................\)-...#\)-%.\)-......s........._=`-s..#\)-uz&\(......x.........&n`-x..#\)-....................w.\)-...#\)-....................w.\)-...#\)`======================``====`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^] to [level v]\nadd [^^^^^^^^^^^^-....\)^^^^^^^-....^^^^^^^^^^^^-....\)^^^^^^^-....************\(....&*******\(................................................................................................yyy......................t.................................................................y..........ss............................x..............t.................................w............................w.w..........................._@+....................t......\)^-................t..........&u\(...t...t...t.................................................................................................................................................................................................] to [level v]\nadd [^^^^^^^^-oooooooooooo\)^^^^^^^^^^^^^^^^-............\)^^^^^^^^^^^^^^^^-............\)^^^^^^^^********\(............&********................................................................................................................................................................................................................................................==================+$..........^^^^^^^^^^^^^^^^^^-$..........`*****************\($..........-.............................-.............................-.............................-.............................-.............................-.............................`=======@=+...................^^^^^^^^^^-...................] to [level v]\nadd [..\)^^^^^^^^^^^^^^^^^^^^^^^^-....\)^^^^^^^^^^^^^^^^^^^^^^^^-....&************************\(..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................] to [level v]\nadd [] to [level v]\nadd [eaaaaf......eaaaaf......eaaaafeaaaaf......eaaaaf......eaaaafeaaaaf......eaaaaf......eaaaafeaaaaf......eaaaaf......eaaaafeaaaaf..gi..eaaaaf..gi..eaaaafeaaaaf..bd..eaaaaf..bd..eaaaafemcncd..jl..eaaaaf..jl..bcncmfef..........eaaaaf..........efef..........bccccd..........efef..........jkkkkl..........efbd..........................bdnl..........................jn...................................ghhi............ghhi..........eaaf............eaaf..........bccd............bccd.............................................................................ghhhhi........................jkkkkl......................................................................................................] to [level v]\n\nwhen this sprite clicked\nbroadcast (advancelevel v)\nset [a v] to [20]\n\n@SMB3 Text Engine\n\ndefine Display (\[text\]) at x: (\[x\]) y: (\[y\]) C: (\[centered\])\nif <(\[centered\]) = [1]> then\n    go to x: (0) y: (\[y\])\n    repeat ((length of (\[text\])) - (1))\n        change x by ((0) - ((letter (1) of (size)) * (4)))\n    end\nelse\n    go to x: (\[x\]) y: (\[y\])\nend\nset [ltr v] to [0]\nshow\nrepeat (length of (\[text\]))\n    change [ltr v] by (1)\n    if <(letter (Ltr) of (\[text\])) = [ ]> then\n    move ((letter (1) of (size)) * (8)) steps\nend\nhide\n\nwhen I receive [wait v]\nwait (1) seconds\nset [ghost v] to [0]\nrepeat (10)\n    erase all\n    clear graphic effects\n    set size to (800) %\n    Display [night] at x: (-200) y: (144) C: (0)\n    Display [light] at x: (-136) y: (80) C: (0)\n    set size to (100) %\n    set [ghost v] effect to (100)\n    change [ghost v] effect by (ghost)\n    Display (join (join (join [version ] (version)) (spaces)) [triforcemayhem 2017,2020]) at x: (0) y: (-172) C: (1)\n    Display [start game] at x: (0) y: (10) C: (1)\n    Display [load game] at x: (0) y: (0) C: (1)\n    Display [music:] at x: (0) y: (-10) C: (1)\n    change [ghost v] by (-10)\n    if <(MusicPref) = [0]> then\n        Display [original] at x: (0) y: (-20) C: (1)\n    else\n        if <(MusicPref) = [1]> then\n            Display [new] at x: (0) y: (-20) C: (1)\n        else\n            Display [off] at x: (0) y: (-20) C: (1)\n        end\n    end\nend\nbroadcast (cursor v)\n\nwhen I receive [levelstart v]\nif <(a) = (length of [level v])> then\n    Display [this was my testing level!] at x: (-232) y: (100) C: (1)\n    Display [i made sure these physics felt good before making the levels] at x: (-232) y: (92) C: (1)\n    Display [getting used to your physics also helps with level design.] at x: (-232) y: (84) C: (1)\nend\nif <(a) = [1]> then\n    Display [small challenges] at x: (-214) y: (-26) C: (0)\nend\nif <(a) = [2]> then\n    Display [higher hills!] at x: (-40) y: (-124) C: (0)\nend\nif <(a) = [3]> then\n    Display [they crumble beneath you!] at x: (-112) y: (-144) C: (0)\nend\nif <(a) = [4]> then\n    Display [watch your faces...] at x: (-232) y: (92) C: (1)\n    Display [all six of them] at x: (-232) y: (84) C: (1)\nend\nif <(a) = [10]> then\n    Display [touch a dot, jump again!] at x: (-56) y: (-108) C: (0)\nend\nif <(a) = [14]> then\n    Display [your final challenges.] at x: (56) y: (-127) C: (0)\nend\nif <(a) = [16]> then\n    Display [timing is everything] at x: (0) y: (-130) C: (1)\nend\n\nwhen I receive [options v]\nerase all\nchange [ghost v] effect by (-10)\nset size to (800) %\nDisplay [night] at x: (-200) y: (144) C: (0)\nDisplay [light] at x: (-136) y: (80) C: (0)\nset size to (100) %\nDisplay (join (join (join [version ] (version)) (spaces)) [triforcemayhem 2017,2020]) at x: (0) y: (-172) C: (1)\nDisplay [start game] at x: (0) y: (10) C: (1)\nDisplay [load game] at x: (0) y: (0) C: (1)\nDisplay [music:] at x: (0) y: (-10) C: (1)\nif <(MusicPref) = [0]> then\n    Display [new] at x: (0) y: (-20) C: (1)\n    set [musicpref v] to [1]\nelse\n    if <(MusicPref) = [1]> then\n        Display [off] at x: (0) y: (-20) C: (1)\n        set [musicpref v] to [2]\n    else\n        Display [original] at x: (0) y: (-20) C: (1)\n        set [musicpref v] to [0]\n    end\nend\n\nwhen I receive [endtext v]\nclear graphic effects\nset size to (100) %\nDisplay [with noss, the cube of darkness' defeat,] at x: (0) y: (164) C: (1)\nwait (2) seconds\nDisplay [the world was relieved to finally see the night pass.] at x: (0) y: (140) C: (1)\nwait (3) seconds\nDisplay [our little hero is now taking in the scenery...] at x: (0) y: (116) C: (1)\nwait (2) seconds\n\nwhen I receive [title v]\nset [ghost v] effect to (100)\nrepeat (10)\n    erase all\n    change [ghost v] effect by (-10)\n    set size to (800) %\n    Display [night] at x: (-200) y: (144) C: (0)\n    Display [light] at x: (-136) y: (80) C: (0)\nend\n\nwhen I receive [reset v]\nset [musicpref v] to [1]\nbroadcast (options v)\n\nset [version v] to [1.7]\n\nset [spaces v] to []\nrepeat (24)\n    set [spaces v] to (join (spaces) [ ])\nend\n\n@Position Helper\n\nwhen [q v] key pressed\nshow\ngo to [front v] layer\ngo to x: (-232) y: (-172)\nrepeat until <key (e v) pressed?>\n    if <key (up arrow v) pressed?> then\n        change y by (16)\n    end\n    if <key (down arrow v) pressed?> then\n        change y by (-16)\n    end\n    if <key (left arrow v) pressed?> then\n        change x by (-16)\n    end\n    if <key (right arrow v) pressed?> then\n        change x by (16)\n    end\n    say (join ((((x position) + (232)) / (16)) + (1)) (join [, ] ((((y position) + (172)) / (16)) + (1))))\n    if <key (space v) pressed?> then\n        say (join (x position) (join [, ] (y position)))\n    else\n        if <key (any v) pressed?> then\n            wait (0.1) seconds\n        end\n    end\nend\nsay []\nhide\n\n@Costume\n\nwhen I receive [render v]\npoint in direction ([direction v] of [hitbox v])\ngo to (hitbox v)\nchange y by (1)\nif <(((round (y position)) + (-4)) / (16)) = (round (((round (y position)) + (-4)) / (16)))> then\n\nwhen I receive [levelstart v]\ngo to [front v] layer\nshow\nforever\n    if <(e) = [0]> then\n        if <([costume # v] of [hitbox v]) = [1]> then\n            if <([ycol v] of [hitbox v]) > [0]> then\n                if <<<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> and <not <<key (left arrow v) pressed?> and <key (right arrow v) pressed?>>>> then\n                    next costume\n                    if <(costume [number v]) > [6]> then\n                        switch costume to (walk1 v)\n                    end\n                    if <<(costume [number v]) = [1]> or <(costume [number v]) = [4]>> then\n                        start sound [Shoe v]\n                    end\n                    wait (0.05) seconds\n                else\n                    switch costume to (walk1 v)\n                    wait (0.05) seconds\n                    switch costume to (wallaceidle v)\n                    wait until <<([ycol v] of [hitbox v]) < [1]> or <<<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> and <not <<key (left arrow v) pressed?> and <key (right arrow v) pressed?>>>>>\n                end\n            else\n                if <([yv v] of [hitbox v]) < [0.1]> then\n                    switch costume to (walk1 v)\n                else\n                    switch costume to (jump v)\n                end\n            end\n        else\n            if <([ycol v] of [hitbox v]) > [0]> then\n                if <<<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> and <not <<key (left arrow v) pressed?> and <key (right arrow v) pressed?>>>> then\n                    next costume\n                    if <<(costume [number v]) > [13]> or <(costume [number v]) < [10]>> then\n                        switch costume to (cw1 v)\n                    end\n                    wait (0.05) seconds\n                else\n                    switch costume to (cw1 v)\n                    wait (0.05) seconds\n                    switch costume to (cidle v)\n                    wait until <<([ycol v] of [hitbox v]) < [1]> or <<<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> and <not <<key (left arrow v) pressed?> and <key (right arrow v) pressed?>>>>>\n                end\n            else\n                if <([yv v] of [hitbox v]) < [0.1]> then\n                    switch costume to (down v)\n                else\n                    switch costume to (up v)\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\npoint in direction (90)\nswitch costume to (cidle v)\nhide\n\nwhen flag clicked\ngo to x: (-200) y: (-76)\n\nwhen I receive [beginend v]\nstop [other scripts in sprite v]\nhide\n\n@Hitbox\n\ndefine VarReset\nset [xv v] to [0]\nset [yv v] to [0]\nset [ycol v] to [1]\npoint in direction (90)\nif <(a) = (length of [level v])> then\n    go to x: (0) y: (0)\nelse\n    if <(a) = [20]> then\n        go to x: (pick random (-200) to (200)) y: (-172)\n    else\n        go to x: (-200) y: (-172)\n    end\n    repeat until <not <touching (_edge_ v)?>>\n        change y by (1)\n    end\n    repeat until <touching (ground v)?>\n        change y by (16)\n        if <touching (_edge_ v)?> then\n            stop [this script v]\n        end\n    end\n    repeat until <not <touching (ground v)?>>\n        change y by (16)\n    end\nend\n\nwhen I receive [levelstart v]\nshow\nset [d v] to [0]\nset [e v] to [0]\nVarReset\nforever\n    if <(e) = [0]> then\n        Function\n    end\n    if <(y position) < [-170]> then\n        broadcast (varreset v)\n    end\nend\n\nwhen I receive [varreset v]\nset [shardx v] to (x position)\nset [shardy v] to (y position)\nVarReset\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\ndefine Floor\nset [ycol v] to [2]\nif <(yV) < [-1.6]> then\n    start sound [quietding v]\nend\nset [yv v] to [0]\nrepeat until <not <touching (ground v)?>>\n    change y by (1)\nend\n\nwhen I receive [bounceoff v]\nset [yv v] to [8]\nset [j v] to [0]\n\ndefine Wall\nset x to (round (x position))\nif <(xV) > [0]> then\n    repeat until <not <touching (ground v)?>>\n        change x by (-1)\n    end\nelse\n    repeat until <not <touching (ground v)?>>\n        change x by (1)\n    end\nend\nset [xv v] to [0]\n\ndefine Ceiling\nset [yv v] to [0]\nrepeat until <not <touching (ground v)?>>\n    change y by (-1)\nend\n\ndefine Function\nset [ghost v] effect to (100)\nif <not <touching (ground v)?>> then\n    change [yv v] by (-0.8)\n    change [ycol v] by (-1)\nend\nchange y by (yV)\nif <[0] > (yV)> then\n    if <touching (ground v)?> then\n        set [j v] to [16]\n        Floor\n    end\nelse\n    if <touching (ground v)?> then\n        Ceiling\n    end\nend\nif <<(e) = [0]> and <<(j) > [0]> and <<key (z v) pressed?> or <key (up arrow v) pressed?>>>> then\n    if <(j) = [16]> then\n        if <(costume [number v]) = [1]> then\n            start sound [QuietJump v]\n        else\n            start sound [Jump2 v]\n        end\n        set [yv v] to [9.5]\n    end\n    change [yv v] by (0.2)\n    change [j v] by (-1)\nelse\n    set [j v] to [0]\n    if <(yV) > [6]> then\n        set [yv v] to [6]\n    end\nend\nif <<<key (left arrow v) pressed?> and <key (right arrow v) pressed?>> and <(yCol) > [0]>> then\n    if <(xV) > [0]> then\n        change [xv v] by (-0.8)\n        if <[0] > (xV)> then\n            set [xv v] to [0]\n        end\n    else\n        change [xv v] by (0.8)\n        if <(xV) > [0]> then\n            set [xv v] to [0]\n        end\n    end\nelse\n    if <<<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> and <(e) = [0]>> then\n        if <key (left arrow v) pressed?> then\n            point in direction (-90)\n            change [xv v] by (-0.5)\n            if <[-4] > (xV)> then\n                set [xv v] to [-4]\n            end\n        end\n        if <key (right arrow v) pressed?> then\n            point in direction (90)\n            change [xv v] by (0.5)\n            if <(xV) > [4]> then\n                set [xv v] to [4]\n            end\n        end\n    else\n        if <(xV) > [0]> then\n            change [xv v] by (-0.8)\n            if <[0] > (xV)> then\n                set [xv v] to [0]\n            end\n        else\n            change [xv v] by (0.8)\n            if <(xV) > [0]> then\n                set [xv v] to [0]\n            end\n        end\n    end\nend\nchange x by (xV)\nif <touching (ground v)?> then\n    if <(yCol) > [0]> then\n        change y by (1)\n        if <touching (ground v)?> then\n            change y by (-1)\n            Wall\n        end\n    else\n        Wall\n    end\nend\nif <[-232] > (x position)> then\n    set x to (-232)\n    set [xv v] to [0]\nend\nif <(x position) > [232]> then\n    set x to (232)\n    set [xv v] to [0]\nend\nbroadcast (render v)\n\nwhen I receive [advancelevel v]\ngo to x: (-200) y: (-165)\n\nwhen I receive [extrajump v]\nwait until <not <<key (z v) pressed?> or <key (up arrow v) pressed?>>>\nrepeat until <<key (z v) pressed?> or <key (up arrow v) pressed?>>\n    set [j v] to [16]\nend\n\nwhen I receive [beginend v]\nstop [other scripts in sprite v]\n\n@Selector\n\nwhen flag clicked\nhide\n\nwhen I receive [cursor v]\ngo to x: (-56) y: (10)\nshow\nforever\n    repeat until <key (space v) pressed?>\n        if <<key (up arrow v) pressed?> or <key (down arrow v) pressed?>> then\n            start sound [Blip_Select v]\n            if <key (up arrow v) pressed?> then\n                change y by (10)\n            end\n            if <key (down arrow v) pressed?> then\n                change y by (-10)\n            end\n            if <(y position) < [-10]> then\n                go to x: (-56) y: (10)\n            else\n                if <(y position) > [10]> then\n                    go to x: (-56) y: (-10)\n                end\n            end\n            wait until <<<key (up arrow v) pressed?> or <key (down arrow v) pressed?>> = [false]>\n        end\n    end\n    play sound [Pickup_Coin v] until done\n    if <(y position) = [10]> then\n        broadcast (new v)\n        set [a v] to [1]\n        wait (1) seconds\n        hide\n        stop [this script v]\n    else\n        if <(y position) = [0]> then\n            broadcast (load v)\n            wait (0) seconds\n            hide\n            ask [Enter Continue Code...] and wait\n            repeat until <<<(length of (answer)) = [8]> and <(round (answer)) = (answer)>> and <[23] > (join (letter (2) of (answer)) (letter (5) of (answer)))>>\n                start sound [Blip_Select v]\n                ask [Invalid Code, Please Retry...] and wait\n            end\n            set [a v] to (round (join (letter (2) of (answer)) (letter (5) of (answer))))\n            start sound [Pickup_Coin v]\n            broadcast (new v)\n            stop [this script v]\n        else\n            broadcast (options v)\n        end\n    end\nend\n\nwhen [u v] key pressed\nif <(username) = [TriforceMayhem]> then\n    hide\nend\n\n@Thumb\n\nwhen I receive [new v]\nset size to (100) %\nswitch costume to (black v)\nshow\ngo to x: (1337) y: (0)\nset [vel v] to [0]\nset [transit v] to [1]\nrepeat until <(x position) < [1]>\n    change [vel v] by (-1)\n    change x by (Vel)\nend\nset x to (0)\nbroadcast (start v)\nif <(a) > [13]> then\n    switch backdrop to (brick v)\nelse\n    switch backdrop to (explstar v)\nend\nerase all\nif <<(a) = [18]> or <(a) = [19]>> then\nhide\nset x to (0)\nset [e v] to [0]\nset [transit v] to [0]\n\nwhen I receive [render v]\nif <(Darkness) = [1]> then\n    go to (hitbox v)\nend\n\ndefine Size (number1)\nset size to (number1) %\n\nwhen I receive [darkness v]\nwait until <(transit) = [0]>\nswitch costume to (darknesssize v)\nSize (6400)\nswitch costume to (darkness v)\nif <(Darkness) = [1]> then\n    create clone of (_myself_ v)\n    clear graphic effects\n    show\n    wait until <(Darkness) = [0]>\n    clear graphic effects\n    show\n    set [size v] to [6400]\n    repeat (20)\n        change [size v] by (-160)\n        switch costume to (darknesssize v)\n        Size (Size)\n        switch costume to (darkness v)\n    end\n    set [darkness v] to [-1]\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    set [darkness v] to [0]\n    hide\nend\n\nswitch costume to (thumbnail2 v)\nclear graphic effects\nset size to (800) %\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\n\nwhen I start as a clone\nshow\nset size to (200) %\nclear graphic effects\nswitch costume to (darkness circle v)\nwait until <(Darkness) = [-1]>\ndelete this clone\n\nwhen I receive [brighten v]\nset [size v] to [3200]\nrepeat (20)\n    change [size v] by (160)\n    switch costume to (darknesssize v)\n    Size (Size)\n    switch costume to (darkness v)\nend\n\ndelete this clone\n\nset [darkness v] to [0]\n\nset [darkness v] to [1]\nbroadcast (darkness v)\n\nwhen I receive [levelstart v]\nif <<(a) = [18]> or <(a) = [19]>> then\n    stop [other scripts in sprite v]\n    set [darkness v] to [1]\n    broadcast (darkness v)\nend\nif <(a) = [20]> then\n    set [darkness v] to [0]\n    wait (2) seconds\n    broadcast (noss2 v)\nend\n\nwhen flag clicked\nset [darkness v] to [0]\nhide\n\nwhen I receive [endtext v]\nwait (8) seconds\nswitch costume to (darknesssize v)\nset size to (800) %\ngo to x: (-420) y: (-420)\nswitch costume to (endscene v)\nclear graphic effects\nshow\nrepeat (184)\n    change x by (1.32)\n    change y by (0.95)\nend\ngo to x: (0) y: (0)\nif <(MusicPref) = [0]> then\n    wait (8) seconds\nelse\n    wait (16.5) seconds\nend\nrepeat (7)\n    next costume\nend\nwait (1) seconds\nstamp\nset [ghost v] effect to (100)\nswitch costume to (thumbnail v)\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\nrepeat until <key (any v) pressed?>\nswitch backdrop to (nightlight v)\nerase all\nbroadcast (reset v)\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nclear graphic effects\n\n@Coin\n\ndefine Spin\nforever\n    switch costume to (spin1 v)\n    if <touching (hitbox v)?> then\n        hide\n        set [e v] to [1]\n        play sound [Pickup_Coin v] until done\n        change [a v] by (1)\n        broadcast (advancelevel v)\n        delete this clone\n    end\n    wait (0.05) seconds\n    if <touching (hitbox v)?> then\n        hide\n        set [e v] to [1]\n        play sound [Pickup_Coin v] until done\n        change [a v] by (1)\n        broadcast (advancelevel v)\n        delete this clone\n    end\n    next costume\n    if <touching (hitbox v)?> then\n        hide\n        set [e v] to [1]\n        play sound [Pickup_Coin v] until done\n        change [a v] by (1)\n        broadcast (advancelevel v)\n        delete this clone\n    end\n    wait (0.05) seconds\n    next costume\n    if <touching (hitbox v)?> then\n        hide\n        set [e v] to [1]\n        play sound [Pickup_Coin v] until done\n        change [a v] by (1)\n        broadcast (advancelevel v)\n        delete this clone\n    end\n    wait (0.05) seconds\n    next costume\n    if <touching (hitbox v)?> then\n        hide\n        set [e v] to [1]\n        play sound [Pickup_Coin v] until done\n        change [a v] by (1)\n        broadcast (advancelevel v)\n        delete this clone\n    end\n    wait (0.05) seconds\nend\n\nwhen I receive [advancelevel v]\ndelete this clone\n\nwhen I receive [levelstart v]\nif <(Coins) = [1]> then\n    broadcast (printmoney v)\nend\n\nwhen I receive [printmoney v]\nrepeat ((length of [coinloc v]) / (2))\n    set x to (item (1) of [coinloc v])\n    delete (1) of [coinloc v]\n    set y to (item (1) of [coinloc v])\n    delete (1) of [coinloc v]\n    set [x v] to (x position)\n    set [y v] to (y position)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <(a) = [6]> then\n    show\n    go to x: (0) y: (-180)\n    set [vel v] to [15]\n    repeat (38)\n        change [vel v] by (-0.5)\n        change y by (vel)\n    end\n    Spin\n    delete this clone\nelse\n    if <<(a) = [13]> or <(a) = [20]>> then\n        show\n        go to (noss v)\n        Spin\n        delete this clone\n    else\n        go to x: (x) y: (y)\n        if <(a) = [19]> then\n            change y by (-2)\n        end\n        show\n        Spin\n        delete this clone\n    end\nend\n\n@Shatter\n\ndefine Fragment\nswitch costume to (broken v)\ngo to x: (shardX) y: (shardY)\nrepeat (4)\n    next costume\n    create clone of (_myself_ v)\nend\nnext costume\nrepeat (6)\n    create clone of (_myself_ v)\nend\nswitch costume to (broken v)\n\nwhen I start as a clone\ngo to [front v] layer\nset [clone v] to [1]\nshow\nset [xvel v] to (pick random (2) to (-2))\nset [spin v] to (pick random (5) to (34))\nset size to (pick random (75) to (100)) %\nset [vel v] to (pick random (4) to (10))\nGoUp\nrepeat until <touching (_edge_ v)?>\n    turn left (spin) degrees\n    change x by (xvel)\n    change y by (vel)\n    change [vel v] by (-0.5)\nend\ndelete this clone\n\nwhen I receive [varreset v]\nif <(clone) = [0]> then\n    Fragment\n    start sound [rumble v]\nend\n\ndefine GoUp\nif <<(x position) < [-232]> or <(x position) > [232]>> then\n    if <(x position) < [0]> then\n        set x to (-232)\n    else\n        set x to (232)\n    end\nend\nrepeat until <not <touching (_edge_ v)?>>\n    change y by (1)\n    if <(y position) > [175]> then\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <<key (2 v) pressed?> and <<key (l v) pressed?> and <key (v v) pressed?>>> then\n        broadcast (varreset v)\n        wait (1) seconds\n    end\nend\n\n@Button\n\nwhen I start as a clone\nset [clone v] to [1]\ngo to x: (x) y: (y)\nshow\nswitch costume to (off v)\nforever\n    wait until <touching (hitbox v)?>\n    start sound [ouch v]\n    set [switchpressed v] to [1]\n    change y by (-16)\n    switch costume to (p v)\n    stamp\n    change y by (16)\n    switch costume to (on v)\n    wait (0) seconds\n    broadcast (buttonPressed v)\n    wait until <(switchPressed) = [0]>\nend\n\nwhen I receive [switches v]\nrepeat ((length of [switchloc v]) / (2))\n    set x to (item (1) of [switchloc v])\n    delete (1) of [switchloc v]\n    set y to (item (1) of [switchloc v])\n    delete (1) of [switchloc v]\n    set [x v] to (x position)\n    set [y v] to (y position)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [levelstart v]\nif <(Switches) = [1]> then\n    broadcast (Switches v)\nend\n\nwhen I receive [varreset v]\nset [switchpressed v] to [0]\nif <(Clone) = [1]> then\n    change y by (-16)\n    switch costume to (u v)\n    stamp\n    change y by (16)\n    switch costume to (off v)\nend\nset [rpressed v] to [0]\n\nwhen I receive [advancelevel v]\nset [switchpressed v] to [0]\nswitch costume to (off v)\ndelete this clone\n\n@Light Orbs\n\nwhen I receive [orb v]\nrepeat ((length of [orbloc v]) / (2))\n    set x to (item (1) of [orbloc v])\n    delete (1) of [orbloc v]\n    set y to (item (1) of [orbloc v])\n    delete (1) of [orbloc v]\n    set [x v] to (x position)\n    set [y v] to (y position)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [levelstart v]\nif <(Orbs) = [1]> then\n    broadcast (Orb v)\nend\n\nwhen I start as a clone\ngo to x: (x) y: (y)\nshow\nrepeat (3)\n    change y by (1)\nend\nforever\n    repeat (6)\n        change y by (-1)\n        if <touching (hitbox v)?> then\n            broadcast (Brighten v)\n            delete this clone\n        end\n    end\n    repeat (6)\n        change y by (1)\n        if <touching (hitbox v)?> then\n            broadcast (Brighten v)\n            delete this clone\n        end\n    end\nend\n\n@FallingBlock\n\nwhen I start as a clone\ngo to [front v] layer\ngo to x: (x) y: (y)\nshow\nchange x by (-1)\nrepeat (7)\n    change x by (2)\n    wait (0.05) seconds\n    change x by (-2)\n    wait (0.05) seconds\nend\nchange x by (1)\nwait (((y position) + (180)) / (250)) seconds\nset [vel v] to [0]\nstart sound [Smash v]\nrepeat until <touching (_edge_ v)?>\n    change [vel v] by (-1)\n    change y by (vel)\nend\nhide\ndelete this clone\n\nwhen I receive [buttonpressed v]\nCreateFallingBlocks\n\ndefine CreateFallingBlocks\nrepeat ((length of [timing v]) / (2))\n    set x to (item (1) of [timing v])\n    delete (1) of [timing v]\n    set y to (item (1) of [timing v])\n    delete (1) of [timing v]\n    set [x v] to (x position)\n    set [y v] to (y position)\n    create clone of (_myself_ v)\nend\n\n@Sword\n\ndefine Hitstun\nrepeat (10)\n    wait (0) seconds\n    switch costume to (swordopen v)\n    wait (0) seconds\n    switch costume to (swordhurt v)\nend\nswitch costume to (sword v)\n\ndefine Rest\nswitch costume to (swordopen v)\nif <(returnFromDeath) = [0]> then\n    repeat (90)\n        if <touching (hitbox v)?> then\n            broadcast (bounceoff v)\n            if <(hitsLeft) = [1]> then\n                broadcast (hiteffect v)\n                start sound [ouch v]\n                repeat (5)\n                    change y by (-10)\n                end\n                broadcast (bosskill v) and wait\n                start sound [Shadow5 v]\n                repeat (35)\n                    wait (0) seconds\n                    switch costume to (swordopen v)\n                    wait (0) seconds\n                    switch costume to (swordhurt v)\n                    change y by (-0.2)\n                    turn left (0.742857142857) degrees\n                end\n                set [hitsleft v] to [3]\n                repeat (30)\n                    change y by (hitsLeft)\n                    change [hitsleft v] by (-0.5)\n                end\n                hide\n                wait (0.5) seconds\n                create clone of (coin v)\n                stop [other scripts in sprite v]\n                stop [this script v]\n            else\n                broadcast (hiteffect v)\n                start sound [ouch v]\n                repeat (5)\n                    change y by (-10)\n                end\n                change [hitsleft v] by (-1)\n                start sound [rumble v]\n                Hitstun\n                repeat (20)\n                    change y by (2.5)\n                end\n            end\n            stop [this script v]\n        end\n    end\n    switch costume to (sword v)\nelse\n    switch costume to (swordheal v)\n    set [returnfromdeath v] to [0]\n    broadcast (swordheal v)\n    if <(hitsLeft) < [3]> then\n        change [hitsleft v] by (1)\n    end\n    wait (1) seconds\nend\n\ndefine Attack2\nset size to (100) %\nif <([x position v] of [hitbox v]) > [0]> then\n    set [rot v] to [-10]\nelse\n    set [rot v] to [10]\nend\nrepeat (18)\n    wait until <(e) = [0]>\n    turn left (rot) degrees\nend\nrepeat (8)\n    wait until <(e) = [0]>\n    change y by (12.5)\nend\nrepeat (9)\n    wait until <(e) = [0]>\n    turn left (rot) degrees\n    change size by (21)\nend\nrepeat (15)\n    wait until <(e) = [0]>\n    wait (0) seconds\n    switch costume to (swordopen v)\n    wait (0) seconds\n    switch costume to (sword v)\nend\nrepeat (8)\n    wait until <(e) = [0]>\n    change y by (-15)\nend\nrepeat (16)\n    wait until <(e) = [0]>\n    change y by (7.5)\nend\nrepeat (18)\n    wait until <(e) = [0]>\n    turn left ((0) - (rot)) degrees\nend\nrepeat (15)\n    wait until <(e) = [0]>\n    wait (0) seconds\n    switch costume to (swordopen v)\n    wait (0) seconds\n    switch costume to (sword v)\nend\nrepeat (8)\n    wait until <(e) = [0]>\n    change y by (-15)\nend\nrepeat (16)\n    wait until <(e) = [0]>\n    change y by (7.5)\nend\nrepeat (9)\n    wait until <(e) = [0]>\n    turn left ((0) - (rot)) degrees\n    change size by (-21)\nend\nrepeat (8)\n    wait until <(e) = [0]>\n    change y by (-12.5)\nend\n\ndefine Attack1\nwait (0.05) seconds\nswitch costume to (swordopen v)\nwait (0.05) seconds\nswitch costume to (sword v)\nwait (0.2) seconds\nif <([x position v] of [hitbox v]) > [0]> then\n    set [rot v] to [-5]\nelse\n    set [rot v] to [5]\nend\nrepeat (36)\n    wait until <(e) = [0]>\n    turn left (rot) degrees\n    change size by (8)\nend\nrepeat (36)\n    wait until <(e) = [0]>\n    turn left (rot) degrees\n    change size by (-8)\nend\n\nwhen I receive [swordboss v]\npoint in direction (90)\nset [hitsleft v] to [3]\nset [returnfromdeath v] to [0]\nswitch costume to (sword v)\nset size to (100) %\nset [ghost v] effect to (100)\nshow\ngo to x: (0) y: (-32)\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (1) seconds\nrepeat (3)\n    wait (0) seconds\n    switch costume to (swordopen v)\n    wait (0) seconds\n    switch costume to (sword v)\nend\ngo to [front v] layer\nforever\n    Attack1\n    wait (1) seconds\n    Attack2\n    Rest\nend\n\nwhen I receive [swordboss v]\nforever\n    if <(costume [number v]) = [1]> then\n        if <touching (hitbox v)?> then\n            set [returnfromdeath v] to [1]\n            broadcast (varreset v)\n        end\n    end\nend\n\nswitch costume to (swordheal v)\n\nwhen flag clicked\nhide\n\nstop [other scripts in sprite v]\nstop [this script v]\n\n@HitEffect\n\nwhen I start as a clone\nset size to (140) %\npoint in direction (90)\nshow\nswitch costume to (Costume)\nif <(a) = [6]> then\n    go to x: (0) y: (-33)\n    set [vel v] to [6]\n    repeat (25)\n        change y by (1)\n        change size by (5)\n        change [ghost v] effect by (4)\n    end\nend\nif <(a) = [13]> then\n    set size to (100) %\n    go to (noss v)\n    change y by (8)\n    set [vel v] to [6]\n    repeat (25)\n        change y by (1)\n        change size by (5)\n        change [ghost v] effect by (4)\n    end\nend\ndelete this clone\n\nwhen I receive [hiteffect v]\nset [costume v] to [-1]\nchange [hitsleft v] by (1)\ncreate clone of (_myself_ v)\n\nrepeat until <touching (_edge_ v)?>\n    change y by (vel)\n    change [vel v] by (-0.3)\n    turn right (1) degrees\n    change x by (1)\nend\n\nwhen I receive [swordheal v]\nif <[0] < (hitsLeft)> then\n    change [hitsleft v] by (-1)\n    set [costume v] to [+1]\nelse\n    set [costume v] to [+0]\nend\ncreate clone of (_myself_ v)\n\nwhen I receive [swordboss v]\nset [hitsleft v] to [0]\n\n@Noss\n\nwhen flag clicked\nhide\n\ndefine Poof\nhide\nswitch costume to (dust v)\npoint in direction (0)\nrepeat (8)\n    create clone of (_myself_ v)\n    turn right (45) degrees\nend\npoint in direction (90)\n\nwhen I start as a clone\nshow\nset rotation style [don't rotate v]\nrepeat (10)\n    move (2) steps\n    go to [front v] layer\nend\ndelete this clone\n\nset [posit_old v] to [1]\n\ndefine Attack1\nrepeat (10)\n    create clone of (nossbullet v)\nend\nwait (0.17) seconds\nplay sound [Shadow4 v] until done\n\ndefine Rest\nswitch costume to (noss2 v)\nrepeat (60)\n    if <<touching (hitbox v)?> and <[-1] > ([yv v] of [hitbox v])>> then\n        if <[1] < (health)> then\n            broadcast (hiteffect v)\n            broadcast (bounceoff v)\n            change [health v] by (-1)\n            start sound [ouch v]\n            repeat (12)\n                switch costume to (nosshit v)\n                wait (0) seconds\n                switch costume to (noss v)\n                wait (0) seconds\n            end\n            switch costume to (noss v)\n            stop [this script v]\n        else\n            broadcast (bounceoff v)\n            broadcast (hiteffect v)\n            broadcast (bosskill v) and wait\n            start sound [Shadow5 v]\n            repeat (35)\n                switch costume to (nosshit v)\n                wait (0) seconds\n                switch costume to (noss v)\n                wait (0) seconds\n            end\n            switch costume to (noss v)\n            wait (1) seconds\n            start sound [Shadow1 v]\n            create clone of (coin v)\n            change [health v] by (-1)\n            Poof\n        end\n    end\nend\nswitch costume to (noss v)\n\ndefine Teleport\nPoof\nplay sound [Shadow1 v] until done\nset [posit v] to (pick random (1) to (3))\nplay sound [Shadow3 v] until done\npoint in direction (90)\nif <(posit) = [1]> then\n    go to x: (-152) y: (132)\nelse\n    if <(posit) = [2]> then\n        go to x: (-112) y: (-12)\n    else\n        go to x: (160) y: (68)\n        point in direction (-90)\n    end\nend\nstart sound [Shadow2 v]\nPoof\nif <(posit) = [3]> then\n    point in direction (-90)\nend\nswitch costume to (noss v)\nshow\nwait (1) seconds\n\nwhen I receive [noss1 v]\nset size to (100) %\ngo to x: (0) y: (-108)\nwait (1) seconds\nset [health v] to [4]\nstart sound [Shadow2 v]\nPoof\nshow\npoint in direction (-90)\nswitch costume to (noss v)\nwait (1.5) seconds\nforever\n    Teleport\n    Attack1\n    Rest\n    if <[1] > (health)> then\n        stop [this script v]\n    end\nend\n\ndefine Attack3\nstart sound [Shadow2 v]\nset size to (300) %\ngo to x: ([x position v] of [hitbox v]) y: (200)\npoint towards (hitbox v)\nrepeat (10)\n    change y by (-28)\nend\nset y to (-108)\nrepeat (15)\n    if <touching (hitbox v)?> then\n        broadcast (varreset v)\n    end\nend\n\ndefine Attack2\nset size to (100) %\nrepeat (pick random (5) to (7))\n    start sound [Shadow3 v]\n    change size by (20)\n    go to x: (240) y: ([y position v] of [hitbox v])\n    point in direction (-90)\n    repeat (30)\n        if <touching (hitbox v)?> then\n            broadcast (varreset v)\n        end\n        change x by (-16)\n    end\n    wait (pick random (0) to (1)) seconds\n    start sound [Shadow3 v]\n    go to x: (-240) y: ([y position v] of [hitbox v])\n    point in direction (90)\n    repeat (30)\n        if <touching (hitbox v)?> then\n            broadcast (varreset v)\n        end\n        change x by (16)\n    end\n    wait (pick random (0) to (1)) seconds\nend\n\nwhen I receive [noss2 v]\nset size to (100) %\nshow\ngo to [front v] layer\nswitch costume to (noss v)\nset size to (100) %\nset [health v] to [3]\nforever\n    Attack2\n    repeat (5)\n        Attack3\n        wait (0.05) seconds\n    end\n    Rest\n    if <[1] > (health)> then\n        stop [this script v]\n    end\nend\n\n@Pause\n\nwhen I receive [start v]\nhide\nforever\n    wait until <key (space v) pressed?>\n    show\n    go to [front v] layer\n    set [e v] to [1]\n    broadcast (pause v) and wait\n    show variable [sav v]\n    start sound [Pause v]\n    wait until <not <key (space v) pressed?>>\n    wait until <<key (space v) pressed?> or <(e) = [0]>>\n    start sound [Pause v]\n    broadcast (unpause v)\n    hide variable [sav v]\n    set [e v] to [0]\n    hide\n    wait until <not <key (space v) pressed?>>\nend\n\nwhen I receive [advancelevel v]\nhide variable [sav v]\nhide\nif <(a) < [10]> then\n    set [a v] to (join [0] (a))\nend\nset [sav v] to (pick random (0) to (9))\nset [sav v] to (join (Sav) (letter (1) of (a)))\nrepeat (2)\n    set [sav v] to (join (Sav) (pick random (0) to (9)))\nend\nset [sav v] to (join (Sav) (letter (2) of (a)))\nrepeat (3)\n    set [sav v] to (join (Sav) (pick random (0) to (9)))\nend\nset [a v] to (round (a))\n\nwhen flag clicked\nhide\nhide variable [sav v]\n\nwhen I receive [beginend v]\nstop [other scripts in sprite v]\n\n@Jump Lights\n\nwhen I receive [levelstart v]\ndelete this clone\n\nwhen I start as a clone\nswitch costume to (^ v)\nshow\nforever\n    if <touching (hitbox v)?> then\n        broadcast (extrajump v)\n        hide\n        repeat until <([ycol v] of [hitbox v]) = [2]>\n        show\n        switch costume to (^4 v)\n        repeat (4)\n            next costume\n        end\n    end\nend\n\ndefine Lights (a)\nif <(a) = [10]> then\n    repeat ((length of [lightsxy1 v]) / (2))\n        set x to (item (1) of [lightsxy1 v])\n        delete (1) of [lightsxy1 v]\n        set y to (item (1) of [lightsxy1 v])\n        delete (1) of [lightsxy1 v]\n        create clone of (_myself_ v)\n    end\nend\nif <(a) = [11]> then\n    repeat ((length of [lightsxy2 v]) / (2))\n        set x to (item (1) of [lightsxy2 v])\n        delete (1) of [lightsxy2 v]\n        set y to (item (1) of [lightsxy2 v])\n        delete (1) of [lightsxy2 v]\n        create clone of (_myself_ v)\n    end\nend\nif <(a) = [12]> then\n    repeat ((length of [lightsxy3 v]) / (2))\n        set x to (item (1) of [lightsxy3 v])\n        delete (1) of [lightsxy3 v]\n        set y to (item (1) of [lightsxy3 v])\n        delete (1) of [lightsxy3 v]\n        create clone of (_myself_ v)\n    end\nend\nif <(a) = [13]> then\n    go to x: (0) y: (-44)\n    create clone of (_myself_ v)\n    go to x: (0) y: (20)\n    create clone of (_myself_ v)\n    go to x: (0) y: (84)\n    create clone of (_myself_ v)\nend\nif <(a) = [16]> then\n    repeat ((length of [lightsxy4 v]) / (2))\n        set x to (item (1) of [lightsxy4 v])\n        delete (1) of [lightsxy4 v]\n        set y to (item (1) of [lightsxy4 v])\n        delete (1) of [lightsxy4 v]\n        create clone of (_myself_ v)\n    end\nend\nif <(a) = [19]> then\n    go to x: (0) y: (-52)\n    create clone of (_myself_ v)\n    go to x: (104) y: (20)\n    create clone of (_myself_ v)\n    go to x: (176) y: (-35)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [levelstart v]\nwait (0.1) seconds\nLights (a)\n\nwhen I receive [advancelevel v]\ndelete (all) of [lightsxy1 v]\ndelete (all) of [lightsxy2 v]\ndelete (all) of [lightsxy3 v]\ndelete (all) of [lightsxy4 v]\ndelete (all) of [lightsxy5 v]\nadd [-168] to [lightsxy1 v]\nadd [-60] to [lightsxy1 v]\nadd [-184] to [lightsxy1 v]\nadd [20] to [lightsxy1 v]\nadd [-168] to [lightsxy1 v]\nadd [100] to [lightsxy1 v]\nadd [-56] to [lightsxy1 v]\nadd [36] to [lightsxy1 v]\nadd [136] to [lightsxy1 v]\nadd [-132] to [lightsxy1 v]\nadd [184] to [lightsxy1 v]\nadd [-76] to [lightsxy1 v]\nadd [136] to [lightsxy1 v]\nadd [-20] to [lightsxy1 v]\nadd [88] to [lightsxy1 v]\nadd [20] to [lightsxy1 v]\nadd [136] to [lightsxy1 v]\nadd [76] to [lightsxy1 v]\nadd [184] to [lightsxy1 v]\nadd [116] to [lightsxy1 v]\nadd [-200] to [lightsxy2 v]\nadd [116] to [lightsxy2 v]\nadd [104] to [lightsxy2 v]\nadd [-52] to [lightsxy2 v]\nadd [-120] to [lightsxy2 v]\nadd [-44] to [lightsxy2 v]\nadd [-120] to [lightsxy2 v]\nadd [36] to [lightsxy2 v]\nadd [-200] to [lightsxy2 v]\nadd [-28] to [lightsxy2 v]\nadd [104] to [lightsxy3 v]\nadd [-28] to [lightsxy3 v]\nadd [-80] to [lightsxy3 v]\nadd [-116] to [lightsxy3 v]\nadd [-144] to [lightsxy4 v]\nadd [-60] to [lightsxy4 v]\nadd [-144] to [lightsxy4 v]\nadd [0] to [lightsxy4 v]\nadd [-144] to [lightsxy4 v]\nadd [60] to [lightsxy4 v]\nadd [0] to [lightsxy4 v]\nadd [-44] to [lightsxy4 v]\nadd [144] to [lightsxy4 v]\nadd [-60] to [lightsxy4 v]\nadd [144] to [lightsxy4 v]\nadd [0] to [lightsxy4 v]\nadd [144] to [lightsxy4 v]\nadd [60] to [lightsxy4 v]\n\n@NossBullet\n\nwhen I start as a clone\nset rotation style [don't rotate v]\ngo to (noss v)\nset [spooed v] to [0]\nshow\nbroadcast (glide v)\nglide (0.5) secs to x: (0) y: (0)\nrepeat (90)\n    change [spooed v] by (1)\n    move (spooed) steps\n    turn right (15) degrees\n    if <touching (hitbox v)?> then\n        broadcast (VarReset v)\n    end\nend\ndelete this clone\n\nwhen I receive [glide v]\nrepeat (7.5)\n    if <touching (hitbox v)?> then\n        broadcast (VarReset v)\n    end\nend\n\n