Night || -A Platformer-       #Games

Instructions:    ✿ Welcome to "Blackout - Platformer" ✿\n\n ✿ Controls: Press space to start playing ✿\n➤ Arrow keys to move your character \n➤ 9 Levels\n➤ Blackout II: https://scratch.mit.edu/projects/911850735/\n➤ Make sure to play with headphones :)\n➤ Flash warning!\n\nIf your player breaks, double-tap the flag!\nPlease like, follow, and fav to support me :D\n\nIf you want to talk to me, join my studio! Link down below!\nhttps://scratch.mit.edu/studios/27433923/\n\nMassive thanks to: @NoseyNose for the code and inspiration! Go follow him!\n\nTags: #all #games #platformer #trending #all #games #platformer #trending #all #games #platformer #trending #all #games #platformer #trending #all #games #platformer #trending #all #games #platformer #trending #all #games #platformer #trending #games #trending #all #platformer #all #games #platformer #trending #all #games #platformer #trending #all #games #platformer #trending #all #games #platformer #trending #all #games #platformer #trending #all #games #platformer #trending #all #games #platformer #trending #all #games #platformer #trending #all #games #platformer #trending #all #games #platformer #trending #all #games #platformer #trending #all #games #platformer #trending #all #games #platformer #trending #all #games #platformer #trending

@Stage\n\nwhen flag clicked\nswitch backdrop to (sky v)\nhide variable [mouse v]\nforever\n    switch backdrop to (sky v)\n    wait (pick random (1.5) to (6)) seconds\n    broadcast (ENEMY v) and wait\nend\n\nwhen [m v] key pressed\nset [mouse v] to (join ((SCROLL X) + (mouse x)) (join [,] ((SCROLL Y) + (mouse y))))\nshow variable [mouse v]\n\nwait (0.5) seconds\n\nwhen I receive [loading v]\nwait (5) seconds\nrepeat (999)\n    play sound [TheFatRat - Time Lapse v] until done\n    play sound [Alan Walker - Force v] until done\nend\n\nbroadcast (ENEMY v)\n\n@BLANK\n\n@Player\n\nwhen I receive [begin v]\nswitch costume to (player v)\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    set [frame time to show v] to [1]\n    broadcast (Setup v) and wait\n    set [frame time to show v] to [0]\n    Game On\n    repeat until <(EXIT) > []>\n        broadcast (Tick v)\n        Tick\n    end\n    hide\n    if <(EXIT) = [win]> then\n        Game - Win\n    end\n    if <(EXIT) = [offline]> then\n        Game - Win\n    end\nend\n\nif <(EXIT) = [win]> then\n    start sound [Teleport2 v]\n    Game - Win\n    wait (0.1) seconds\nelse\n    Game - Die\nend\n\ndefine Game On\nshow\nset [sx v] to [0]\nset [sy v] to [0]\nset [gravity v] to [-12]\nset [in air v] to [0]\nset size to (100) %\nset [ghost v] effect to (0)\nif <(Checkpoint) = [1]> then\n    set [player2: x v] to [1409]\n    set [scroll y v] to [0]\n    set [player2: y v] to [-80]\nelse\n    if <(Checkpoint) = [2]> then\n        set [player2: x v] to [2597]\n        set [scroll y v] to [0]\n        set [player2: y v] to [-76]\n    else\n        if <(Checkpoint) = [3]> then\n            set [player2: x v] to [3734]\n            set [scroll y v] to [0]\n            set [player2: y v] to [-67]\n        else\n            if <(Checkpoint) = [4]> then\n                set [player2: x v] to [2530]\n                set [scroll y v] to [-80]\n                set [player2: y v] to [-80]\n            end\n        end\n    end\nend\nset [exit v] to []\n\nshow\n\ndefine Tick\nif <<key (a v) pressed?> or <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>>> then\n    change [sx v] by (-2)\nend\nif <<key (d v) pressed?> or <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>>> then\n    change [sx v] by (2)\nend\nset [sx v] to ((sx) * (friction))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <<key (w v) pressed?> or <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>>> then\n    if <(in air) < [4]> then\n        set [sy v] to [17]\n    end\nend\nif <(sy) > [-17]> then\n    change [sy v] by (-2)\nend\nChange Player Y by (sy)\nTest - Die\nset [scroll x v] to (Player2: x)\nif <(SCROLL X) < [-100]> then\n    set [scroll x v] to [-100]\n    set [player2: x v] to [-100]\nend\nchange [scroll y v] by (round (((Player2: y) - (SCROLL Y)) / (2)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(Player2: y) < [-180]> then\n    set [exit v] to [die]\nend\nif <touching (spring v)?> then\n    set [sy v] to [25]\nend\nif <touching (ice v)?> then\n    set [friction v] to [0.93]\nelse\n    set [friction v] to [0.8]\nend\nif <touching (speed v)?> then\n    set [sx v] to [13]\nend\nif <touching (slow v)?> then\n    set [friction v] to [0.5]\nend\nif <touching (water v)?> then\n    set [sy v] to [3]\n    if <key (down arrow v) pressed?> then\n        change [sy v] by (-4)\n    end\n    if <key (up arrow v) pressed?> then\n        change [sy v] by (4)\n    end\nend\n\nstart sound [bubbles v]\n\ndefine Change Player Y by (sy)\nchange [in air v] by (1)\nchange [player2: y v] by (sy)\nPosition\nrepeat until <not <<<touching (platforms v)?> or <touching (horizontal platforms v)?>> or <touching (horizontal platforms move v)?>>>\n    if <(sy) > [0]> then\n        change [player2: y v] by (-1)\n    else\n        change [player2: y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Position\ngo to x: ((Player2: x) - (SCROLL X)) y: ((Player2: y) - (SCROLL Y))\n\ndefine Change Player x by (sx)\nchange [player2: x v] by (sx)\nPosition\nif <<<touching (platforms v)?> or <touching (horizontal platforms v)?>> or <touching (horizontal platforms move v)?>> then\n    repeat (12)\n        change [player2: y v] by (1)\n        Position\n        if <not <<<touching (platforms v)?> or <touching (horizontal platforms v)?>> or <touching (horizontal platforms move v)?>>> then\n            stop [this script v]\n        end\n    end\n    change [player2: y v] by (GRAVITY)\n    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>>> then\n        if <(sx) > [0]> then\n            set [sx v] to [-16]\n        else\n            set [sx v] to [16]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <<<touching (platforms v)?> or <touching (horizontal platforms v)?>> or <touching (horizontal platforms move v)?>>>\n        if <(sx) > [0]> then\n            change [player2: x v] by (-1)\n        else\n            change [player2: x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Game - Die\n\nstart sound [Oops v]\nrepeat (3)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.1) seconds\n\ndefine Test - Die\nif <<<<<touching (acid v)?> or <touching (danger v)?>> or <touching (gears v)?>> or <touching (saws v)?>> or <touching (moving enemies v)?>> then\n    start sound [Hurt v]\n    set [exit v] to [die]\nend\n\ndefine Game - Win\nhide\nset [my player # v] to []\nstop [all v]\n\nwhen flag clicked\nhide\ngo to [front v] layer\n\nwhen flag clicked\nset [exit v] to []\ngo to x: (0) y: (0)\nset [max players v] to [10]\nset [my player # v] to [0]\nbroadcast (setup - opponents v) and wait\nbroadcast (join game v) and wait\nif <(MY PLAYER #) > [0]> then\n    broadcast (Joined! v)\nelse\n    broadcast (Game Full :\( v)\nend\nbroadcast (begin v)\n\nwhen I receive [begin v]\nset [frame time to show v] to [0]\nforever\n    set [testoff v] to (OFF)\n    wait (60) seconds\n    if <(OFF) = (TestOFF)> then\n        set [exit v] to [offline]\n    end\nend\n\nforever\n\nif <(MY PLAYER #) > [0]> then\n    send cloud data\nend\n\ndefine send cloud data\nset [encoded v] to []\nwrite (username) to encoded\nwrite (round ((timer) * (10))) to encoded\nwrite ((x position) + (SCROLL X)) to encoded\nwrite ((y position) + (SCROLL Y)) to encoded\nwrite (round (Costume)) to encoded\nif <(MY PLAYER #) = [1]> then\n    write ((FRAME) + (58)) to encoded\nend\nset cloud # (MY PLAYER #) to (encoded)\n\ndefine set cloud # (player) to (value)\nif <(player) = [1]> then\n    set [☁ p1 v] to (value)\nelse\n    if <(player) = [2]> then\n        set [☁ p2 v] to (value)\n    else\n        if <(player) = [3]> then\n            set [☁ p3 v] to (value)\n        else\n            if <(player) = [4]> then\n                set [☁ p4 v] to (value)\n            else\n                if <(player) = [5]> then\n                    set [☁ p5 v] to (value)\n                else\n                    if <(player) = [6]> then\n                        set [☁ p6 v] to (value)\n                    else\n                        if <(player) = [7]> then\n                            set [☁ p7 v] to (value)\n                        else\n                            if <(player) = [8]> then\n                                set [☁ p8 v] to (value)\n                            else\n                                if <(player) = [9]> then\n                                    set [☁ p9 v] to (value)\n                                else\n                                    set [☁ p10 v] to (value)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine write (val) to encoded\nset [letter # v] to [1]\nrepeat (length of (val))\n    set [encoded v] to (join (encoded) (item # of (letter (letter #) of (val)) in [code v]))\n    change [letter # v] by (1)\nend\nset [encoded v] to (join (encoded) [00])\n\nwhen I receive [tick v]\nif <(Costume) = [2]> then\n    if <<<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>>> and <<key (d v) pressed?> or <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>>>> then\n        switch costume to (up right2 v)\n    else\n        if <<<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>>> and <<key (a v) pressed?> or <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>>>> then\n            switch costume to (up left2 v)\n        else\n            if <<key (d v) pressed?> or <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>>> then\n                switch costume to (right2 v)\n            else\n                if <<key (a v) pressed?> or <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>>> then\n                    switch costume to (left2 v)\n                else\n                    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>>> then\n                        switch costume to (up2 v)\n                    else\n                        switch costume to (normal2 v)\n                    end\n                end\n            end\n        end\n    end\nelse\n    if <<<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>>> and <<key (d v) pressed?> or <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>>>> then\n        switch costume to (up right v)\n    else\n        if <<<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>>> and <<key (a v) pressed?> or <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>>>> then\n            switch costume to (up left v)\n        else\n            if <<key (d v) pressed?> or <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>>> then\n                switch costume to (right v)\n            else\n                if <<key (a v) pressed?> or <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>>> then\n                    switch costume to (left v)\n                else\n                    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>>> then\n                        switch costume to (up v)\n                    else\n                        switch costume to (normal v)\n                    end\n                end\n            end\n        end\n    end\nend\nif <<key (any v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n    set [off v] to (pick random (0) to (99999))\nend\n\nchange [sy v] by (3)\n\nset [scroll y v] to [324]\n\nbroadcast (Reset v) and wait\nbroadcast (Setup v) and wait\nset [scroll x v] to [618]\n\nbroadcast (SCROLL Y GLITCH.. :\( v) and wait\n\nwhen I receive [setup v]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nif <(Checkpoint) = [1]> then\n    set [player2: x v] to [1409]\n    set [scroll y v] to [0]\n    set [player2: y v] to [-80]\nelse\n    if <(Checkpoint) = [2]> then\n        set [player2: x v] to [2597]\n        set [scroll y v] to [0]\n        set [player2: y v] to [-76]\n    else\n        if <(Checkpoint) = [3]> then\n            set [player2: x v] to [3734]\n            set [scroll y v] to [0]\n            set [player2: y v] to [-67]\n        end\n    end\nend\nset [exit v] to []\n\nrepeat until <<(SCROLL Y) = [400]> and <(Player2: x) = [618]>>\n\nwhen I receive [setup v]\n\nset [checkpoint v] to [2]\n\nset [scroll y v] to (Player2: y)\n\nset [player2: y v] to [324]\n\nset [player2: y v] to [324]\nset [scroll y v] to [324]\nwait (1) seconds\nif <(Player2: y) > [9900]> then\n    set [scroll y v] to [324]\n    set [player2: y v] to [324]\nend\nwait (1) seconds\nif <(Player2: y) > [9900]> then\n    set [scroll y v] to [324]\n    set [player2: y v] to [324]\nend\n\nbroadcast (SCROLL Y GLITCH.. :\( v) and wait\n\nif <(Player2: y) > [1000]> then\n    set [exit v] to [die]\n    set [player2: y v] to [0]\n    set [scroll y v] to [0]\nend\n\nwhen I receive [reset v]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [player2: x v] to [0]\nset [player2: y v] to [0]\n\nwhen I receive [tick v]\nif <<(MY PLAYER #) > [0]> and <(MY PLAYER #) < [10]>> then\n    send cloud data\nend\n\nwhen I receive [tick v]\n\nif <(MY PLAYER #) = [1]> then\n    change [frame v] by (1)\nend\n\nstart sound [bubbles v]\n\nforever\n\nset [frame v] to [0]\nreset timer\nset [old value v] to (encoded)\nwait (15) seconds\nset [frame v] to [0]\nreset timer\nif <(old value) = (encoded)> then\n    set [exit v] to [offline]\nend\n\nset [player2: y v] to [-80]\n\n@Opponents\n\ndefine begin decode of (encoded)\nset [encoded v] to (encoded)\nset [letter # v] to [1]\n\ndefine value = read from encoded\nset [value v] to []\nforever\n    set [idx v] to (join (letter (letter #) of (encoded)) (letter ((letter #) + (1)) of (encoded)))\n    change [letter # v] by (2)\n    if <(idx) < [1]> then\n        stop [this script v]\n    end\n    set [value v] to (join (value) (item (idx) of [code v]))\nend\n\ndefine setup players\nhide\nset [offline v] to [100]\nset [player # v] to [1]\nrepeat ((MAX PLAYERS) - (1))\n    create clone of (_myself_ v)\n    change [player # v] by (1)\nend\n\nwhen I receive [begin v]\nclear graphic effects\nforever\n    if <(MY PLAYER #) = (player #)> then\n        set [offline v] to [100]\n        hide\n    else\n        set size to (400) %\n        tick\n        set size to (100) %\n    end\nend\n\nwhen I receive [setup - opponents v]\nsetup players\n\ndefine tick\nvalue = cloud # (player #)\nif <(join [A] (value)) = (last value)> then\n    change [offline v] by (1)\n    if <(offline) = [100]> then\n        hide\n    end\nelse\n    set [last value v] to (join [A] (value))\n    if <(offline) > [99]> then\n        show\n    end\n    set [offline v] to [0]\nend\nbegin decode of (value)\nvalue = read from encoded\nsay (value)\nvalue = read from encoded\nvalue = read from encoded\nset x to ((value) - (SCROLL X))\nvalue = read from encoded\nset y to ((value) - (SCROLL Y))\nvalue = read from encoded\nswitch costume to (value)\nif <(FRAME TIME TO SHOW) = [1]> then\n    if <(MY PLAYER #) > [1]> then\n        value = read from encoded\n        set [frame v] to (value)\n    end\nend\n\nwhen I receive [join game v]\nvalue = cloud # (player #)\nset [last value v] to (join [A] (value))\nwait (3) seconds\nvalue = cloud # (player #)\nif <(join [A] (value)) = (last value)> then\n    set [my player # v] to (player #)\nend\n\nbroadcast (Update Player v)\n\ndefine value = cloud # (player)\nif <(player) = [1]> then\n    set [value v] to (☁ P1)\nelse\n    if <(player) = [2]> then\n        set [value v] to (☁ P2)\n    else\n        if <(player) = [3]> then\n            set [value v] to (☁ P3)\n        else\n            if <(player) = [4]> then\n                set [value v] to (☁ P4)\n            else\n                if <(player) = [5]> then\n                    set [value v] to (☁ P5)\n                else\n                    if <(player) = [6]> then\n                        set [value v] to (☁ P6)\n                    else\n                        if <(player) = [7]> then\n                            set [value v] to (☁ P7)\n                        else\n                            if <(player) = [8]> then\n                                set [value v] to (☁ P8)\n                            else\n                                if <(player) = [9]> then\n                                    set [value v] to (☁ P9)\n                                else\n                                    set [value v] to (☁ P10)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [update player v]\n\nforever\n\nvalue = cloud # (player #)\nset [old value v] to (join [A] (value))\nwait (3) seconds\nvalue = cloud # (player #)\nif <(join [A] (value)) = (old value)> then\n    set [my player # v] to (player #)\nend\n\n@Join Game\n\nwhen flag clicked\nhide\n\nwhen I receive [setup - opponents v]\nwait (1.6) seconds\nbroadcast (LOADING v)\nshow\nswitch costume to (joining v)\n\nwhen I receive [joined! v]\nstart sound [Connect v]\nset [ghost v] effect to (0)\nshow\nswitch costume to (joined v)\nwait (2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [game full :\( v]\nstart sound [Disconnect v]\nset [ghost v] effect to (0)\nshow\nswitch costume to (game full v)\nwait (3) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@ICE\n\nwhen I receive [tick v]\nPosition ((Danger: x) - (SCROLL X)) ((Danger: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [up/down lava v] to [0]\nhide\ngo to x: (0) y: (0)\nset [danger: x v] to [0]\nset [danger: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\nend\n\nClone at x: [460] y: [0]\nClone at x: [460] y: [0]\nClone at x: [460] y: [0]\nClone at x: [460] y: [0]\nClone at x: [-1200] y: [360]\nClone at x: [800] y: [360]\nClone at x: [1300] y: [-560]\nClone at x: [600] y: [0]\n\ndefine Position (x) (y)\ngo to [back v] layer\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [danger: x v] by (x)\nchange [danger: y v] by (y)\nnext costume\n\nwhen flag clicked\nhide\n\n@Slow\n\nwhen I receive [tick v]\nPosition ((Danger: x) - (SCROLL X)) ((Danger: y) - (SCROLL Y))\n\nwhen I receive [setup v]\ngo to [back v] layer\nset [up/down lava v] to [0]\nhide\ngo to x: (0) y: (0)\nset [danger: x v] to [0]\nset [danger: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [-1400] y: [600]\n    Clone at x: [1700] y: [-600]\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\ngo to [back v] layer\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [danger: x v] by (x)\nchange [danger: y v] by (y)\nnext costume\n\nwhen flag clicked\nhide\n\n@Intro\n\nwhen flag clicked\npoint in direction (-90)\nset [intro v] to [0]\nhide\ngo to x: (0) y: (0)\nclear graphic effects\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\npoint in direction (-90)\nset size to (100) %\nshow\nchange [intro v] by (1)\nif <(intro) = [1]> then\n    go to [front v] layer\n    switch costume to (q v)\n    go to x: (-240) y: (180)\n    glide (0.5) secs to x: (0) y: (0)\nelse\n    if <(intro) = [2]> then\n        switch costume to (back 1 v)\n        go to x: (240) y: (-180)\n        broadcast (message 2 v)\n        glide (0.5) secs to x: (0) y: (0)\n    else\n        if <(intro) = [3]> then\n            go [forward v] (1) layers\n            switch costume to (back 2 v)\n            go to x: (240) y: (180)\n            glide (0.5) secs to x: (0) y: (0)\n        else\n            if <(intro) = [4]> then\n                go [forward v] (1) layers\n                switch costume to (move shadow v)\n                go to x: (-240) y: (-180)\n                glide (0.5) secs to x: (0) y: (0)\n                switch costume to (main shadow v)\n            end\n        end\n    end\nend\nswitch costume to (template v)\nwait (0.5) seconds\nbroadcast (BOOM v)\n\nset [pitch v] effect to (0)\nstart sound [High Whoosh v]\n\nwhen I receive [message 2 v]\nrepeat (15)\n    turn right (12) degrees\nend\n\nwhen I receive [boom v]\nrepeat (7)\n    change [brightness v] effect by (16)\n    change [ghost v] effect by (16)\n    change size by (25)\nend\nhide\nbroadcast (Intro Over v)\ndelete this clone\n\nstart sound [boom v]\n\n@Loading\n\nwhen I receive [loading v]\nshow\nset size to (20) %\nforever\n    turn right (15) degrees\n    go to [front v] layer\n    change size by (((size) - (90)) / (-5))\nend\n\nwhen I receive [win v]\nhide\nstop [other scripts in sprite v]\nstop all sounds\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\nhide\n\n@MinionSkin\n\nwhen I receive [minion v]\nswitch costume to (costume2 v)\ngo to x: (0) y: (50)\nshow\ngo to [front v] layer\nstart sound [pop v]\nrepeat (9)\n    change y by (-6)\nend\nrepeat (5)\n    change y by (3)\nend\nrepeat (5)\n    change y by (-1)\nend\nswitch costume to (costume3 v)\ncreate clone of (_myself_ v)\nswitch costume to (costume2 v)\nwait (0.02) seconds\nswitch costume to (costume4 v)\ncreate clone of (_myself_ v)\nswitch costume to (costume2 v)\nwait until <(Costume) > [0.9]>\nrepeat (27)\n    change y by (15)\nend\nhide\n\nwhen I start as a clone\ngo to x: (0) y: (50)\nshow\ngo to [front v] layer\nrepeat (12)\n    change y by (-9)\nend\nrepeat (5)\n    change y by (3)\nend\nrepeat (5)\n    change y by (-1)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (50)\n        if <(costume [number v]) = [2]> then\n            if <mouse down?> then\n                set [costume v] to [2]\n                repeat (25)\n                    change y by (10)\n                end\n                hide\n                delete this clone\n            end\n        else\n            if <(costume [number v]) = [3]> then\n                if <mouse down?> then\n                    set [costume v] to [1]\n                    repeat (25)\n                        change y by (15)\n                    end\n                    hide\n                    delete this clone\n                end\n            end\n        end\n    else\n        set [ghost v] effect to (0)\n    end\n    if <(Costume) > [0.99]> then\n        repeat (25)\n            change y by (15)\n        end\n        hide\n        delete this clone\n    end\nend\n\nwhen flag clicked\nhide\nset [costume v] to [0.9]\n\nif <[] = [3]> then\nif <[] = [2]> then\n\nwhen I receive [begin v]\nset [costume v] to [0.9]\nwait (0.1) seconds\nset [costume v] to [0.9]\nwait (0.2) seconds\nset [costume v] to [0.9]\n\n@detector\n\nwhen flag clicked\nhide\nset [faved___ v] to [0]\nset [loved__ v] to [0]\nset [clone id v] to [0]\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nwait until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\nwait (1) seconds\nbroadcast (MINION v)\n\ngo to x: (0) y: (0)\nshow\nreset timer\nswitch costume to (pick random (1) to (4))\nset [ghost v] effect to (100)\nrepeat until <(timer) > [3.5]>\n    change y by ((y position) / (-15))\n    change [ghost v] effect by (-3)\nend\nreset timer\nrepeat until <(timer) > [3.5]>\n    change y by (((y position) - (-100)) / (-15))\n    change [ghost v] effect by (10)\nend\n\nwhen I start as a clone\nif <(clone id) = [0]> then\n    go to x: (-15) y: (0)\n    set [loved__ v] to [0]\n    switch costume to (love v)\n    forever\n        set [love? v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [loved__ v] to [1]\n        end\n    end\nend\nif <(clone id) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (fave v)\n    set [faved___ v] to [0]\n    forever\n        set [fav v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [faved___ v] to [1]\n        end\n    end\nend\n\n@Sprite1\n\nwhen flag clicked\nset [costume v] to [0]\nhide\nforever\n    if <not <<(LOVED__) = [1]> and <(FAVED___) = [1]>>> then\n        wait (pick random (30) to (40)) seconds\n        switch costume to (costume1 v)\n        go to x: (0) y: (50)\n        show\n        go to [front v] layer\n        start sound [pop v]\n        repeat (9)\n            change y by (-6)\n        end\n        repeat (5)\n            change y by (3)\n        end\n        repeat (5)\n            change y by (-1)\n        end\n        wait (2) seconds\n        repeat (15)\n            change y by (7)\n        end\n        hide\n    end\n    if <(Costume) > [0]> then\n        hide\n        stop [this script v]\n    end\nend\n\n@Number Engine\n\ndefine Type (size) (width between) (what they are writing) (x) (y)\ngo to [front v] layer\nerase all\nshow\nset size to (size) %\nset [counter v] to [1]\ngo to x: (x) y: (y)\nrepeat (length of (what they are writing))\n    go to [front v] layer\n    switch costume to (letter (counter) of (what they are writing))\n    create clone of (_myself_ v)\n    change x by (width between)\n    change [counter v] by (1)\nend\nhide\n\nwhen I receive [time v]\nset [minutes v] to [0]\nset [ghost v] effect to (0)\nset [seconds v] to (time)\nrepeat until <(seconds) < [60]>\n    change [seconds v] by (-60)\n    change [minutes v] by (1)\nend\nif <(seconds) < [10]> then\n    Type [150] [20] (join [Time: ] (join (minutes) (join [:] (join [0] (seconds))))) [-100] [-85]\nelse\n    Type [150] [20] (join [Time: ] (join (minutes) (join [:] (seconds)))) [-100] [-85]\nend\n\nwhen flag clicked\nhide\nclear graphic effects\nerase all\n\nwhen I start as a clone\ngo to [front v] layer\n\ngo to [front v] layer\nstamp\ngo to [back v] layer\n\nset [ghost v] effect to (100)\nrepeat (100)\n    go to [front v] layer\n    change [ghost v] effect by (-1)\nend\n\nwhen I receive [begin v]\nset [time v] to [0]\nforever\n    wait (1) seconds\n    change [time v] by (1)\nend\n\nset [time v] to [6043]\nset [exit v] to [win]\n\nif  then\n\n@Sprite2\n\nwhen I receive [begin v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [time v]\ngo to x: (50) y: (0)\nshow\ngo to [front v] layer\nrepeat (10)\n    change x by (-5)\nend\nforever\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        repeat until <(x position) < [-150]>\n            change x by (-15)\n        end\n    else\n        repeat until <(x position) > [-1]>\n            change x by (15)\n        end\n    end\nend\n\nstart sound [pop v]\n\n@Sprite\n\nwhen I receive [begin v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [time v]\ngo to x: (0) y: (-50)\nshow\ngo to [front v] layer\nrepeat (10)\n    change y by (5)\nend\nforever\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        repeat until <(y position) > [50]>\n            change y by (10)\n        end\n    else\n        repeat until <(y position) < [1]>\n            change y by (-10)\n        end\n    end\nend\n\nset [exit v] to [win]\n\n@Checkpoint 5\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((Checkpoint : x) - (SCROLL X)) ((Checkpoint : y) - (SCROLL Y))\nif <(costume [number v]) = [2]> then\n    if <(Checkpoint) = [4]> then\n        switch costume to (checkpoint open v)\n    end\nend\nturn right (1) degrees\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nset [checkpoint : x v] to (x)\nset [checkpoint : y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [checkpoint : x v] to [0]\nset [checkpoint : y v] to [0]\nset [checkpoint v] to [0]\ngo to [back v] layer\nswitch costume to (checkpoint closed v)\nhide\nif <(LEVEL) = [1]> then\n    switch costume to (checkpoint closed v)\n    Clone at x: [3255] y: [270]\nend\nset [checkpoint : x v] to [-99999]\n\nClone at x: [1404] y: [-78]\n\nswitch costume to (checkpoint closed2 v)\n\nClone at x: [1586] y: [602]\nClone at x: [2530] y: [-100]\n\nwhen I receive [setup v]\n\nif <touching (player v)?> then\n    start sound [CHECKPOINT v]\n    switch costume to (checkpoint open v)\n    change [checkpoint v] by (1)\nend\n\n@Checkpoint\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((Checkpoint : x) - (SCROLL X)) ((Checkpoint : y) - (SCROLL Y))\nif <(costume [number v]) = [2]> then\n    if <(Checkpoint) = [3]> then\n        switch costume to (checkpoint open v)\n    end\nend\nturn right (1) degrees\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nset [checkpoint : x v] to (x)\nset [checkpoint : y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [checkpoint : x v] to [0]\nset [checkpoint : y v] to [0]\nset [checkpoint v] to [0]\ngo to [back v] layer\nswitch costume to (checkpoint closed v)\nhide\nif <(LEVEL) = [1]> then\n    switch costume to (checkpoint closed v)\n    Clone at x: [3750] y: [-63]\nend\nset [checkpoint : x v] to [-99999]\n\nClone at x: [1404] y: [-78]\n\nswitch costume to (checkpoint closed2 v)\n\nClone at x: [1586] y: [602]\nClone at x: [2530] y: [-100]\n\nwhen I receive [setup v]\n\nif <touching (player v)?> then\n    start sound [CHECKPOINT v]\n    switch costume to (checkpoint open v)\n    change [checkpoint v] by (1)\nend\n\n@Speed\n\nwhen I receive [tick v]\nPosition ((Danger: x) - (SCROLL X)) ((Danger: y) - (SCROLL Y))\n\nwhen I receive [setup v]\ngo to [back v] layer\nset [up/down lava v] to [0]\nhide\ngo to x: (0) y: (0)\nset [danger: x v] to [0]\nset [danger: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 7 v)\n    Clone at x: [3710] y: [94]\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [danger: x v] by (x)\nchange [danger: y v] by (y)\nnext costume\n\nwhen flag clicked\nhide\n\nClone at x: [460] y: [0]\nClone at x: [460] y: [0]\nClone at x: [460] y: [0]\nClone at x: [460] y: [0]\nClone at x: [460] y: [0]\nClone at x: [-1750] y: [630]\n\n@Checkpoint 3\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((Checkpoint : x) - (SCROLL X)) ((Checkpoint : y) - (SCROLL Y))\nif <(costume [number v]) = [2]> then\n    if <(Checkpoint) = [2]> then\n        switch costume to (checkpoint open v)\n    end\nend\nturn right (1) degrees\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nset [checkpoint : x v] to (x)\nset [checkpoint : y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [checkpoint : x v] to [0]\nset [checkpoint : y v] to [0]\nset [checkpoint v] to [0]\ngo to [back v] layer\nswitch costume to (checkpoint closed v)\nhide\nif <(LEVEL) = [1]> then\n    switch costume to (checkpoint closed v)\n    Clone at x: [2474] y: [-130]\nend\nset [checkpoint : x v] to [-99999]\n\nClone at x: [1404] y: [-78]\n\nswitch costume to (checkpoint closed2 v)\n\nClone at x: [1586] y: [602]\nClone at x: [2530] y: [-100]\n\nwhen I receive [setup v]\n\nif <touching (player v)?> then\n    start sound [CHECKPOINT v]\n    switch costume to (checkpoint open v)\n    change [checkpoint v] by (1)\nend\n\n@Checkpoint 2\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((Checkpoint : x) - (SCROLL X)) ((Checkpoint : y) - (SCROLL Y))\nif <(costume [number v]) = [2]> then\n    if <(Checkpoint) = [1]> then\n        switch costume to (checkpoint open v)\n    end\nend\nturn right (1) degrees\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nset [checkpoint : x v] to (x)\nset [checkpoint : y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [checkpoint : x v] to [0]\nset [checkpoint : y v] to [0]\nset [checkpoint v] to [0]\ngo to [back v] layer\nswitch costume to (checkpoint closed v)\nhide\nif <(LEVEL) = [1]> then\n    switch costume to (checkpoint closed v)\n    Clone at x: [1404] y: [-78]\n    Clone at x: [2474] y: [-130]\nend\nset [checkpoint : x v] to [-99999]\n\nswitch costume to (checkpoint closed2 v)\n\nClone at x: [1586] y: [602]\nClone at x: [2530] y: [-100]\n\nwhen I receive [setup v]\n\nif <touching (player v)?> then\n    start sound [CHECKPOINT v]\n    switch costume to (checkpoint open v)\n    change [checkpoint v] by (1)\nend\n\n@Portal\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nnext costume\nPosition ((Checkpoint : x) - (SCROLL X)) ((Checkpoint : y) - (SCROLL Y))\nif <touching (player v)?> then\n    set [exit v] to [win]\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nset [checkpoint : x v] to (x)\nset [checkpoint : y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [color v] effect to (-5)\nset size to (100) %\nhide\nset [checkpoint : x v] to [0]\nset [checkpoint : y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (costume1 v)\n    Clone at x: [3255] y: [270]\nend\nset [checkpoint : x v] to [-99999]\n\nturn right (2) degrees\n\n@Thumbnail\n\nwhen flag clicked\nclear graphic effects\nhide\nforever\n    set [ghost v] effect to (100)\n    set [timer v] to ((timer) + (0.05))\nend\n\nwhen [timer v] > (TIMER)\nbroadcast (Reset v)\nshow\nset [red thing v] to [15]\ngo to [front v] layer\nif <(EXIT) = [win]> then\n    if <(Costume) = [2]> then\n        switch costume to (win minion v)\n        END\n    else\n        switch costume to (win normal v)\n        END\n    end\nelse\n    if <(EXIT) = [offline]> then\n        switch costume to (offline v)\n        repeat ((RED THING) * (2))\n            go to x: (pick random ((RED THING) - ((RED THING) * (2))) to (RED THING)) y: (pick random ((RED THING) - ((RED THING) * (2))) to (RED THING))\n            change [red thing v] by (-0.5)\n        end\n    else\n        switch costume to (thumbnail v)\n        repeat ((RED THING) * (2))\n            go to x: (pick random ((RED THING) - ((RED THING) * (2))) to (RED THING)) y: (pick random ((RED THING) - ((RED THING) * (2))) to (RED THING))\n            change [red thing v] by (-0.5)\n        end\n    end\nend\n\ndefine END\nstart sound [win v]\ngo to x: (300) y: (0)\nrepeat (10)\n    change x by (-30)\nend\nrepeat ((RED THING) * (2))\n    go to x: (pick random ((RED THING) - ((RED THING) * (2))) to (RED THING)) y: (pick random ((RED THING) - ((RED THING) * (2))) to (RED THING))\n    change [red thing v] by (-0.5)\nend\nbroadcast (TIME v)\n\nwhen [timer v] > (TIMER)\nforever\n    reset timer\nend\n\n@transition\n\nwhen flag clicked\nhide\n\nwhen I receive [setup v]\ngo to x: (0) y: (0)\nset [ghost v] effect to (0)\ngo [forward v] (1) layers\ngo to [front v] layer\ngo to [front v] layer\nswitch costume to (costume1 v)\nset x to (500)\nshow\nstart sound [Whoosh v]\nrepeat (25)\n    change x by (-60)\nend\nwait (0.1) seconds\nhide\n\n@Water\n\nwhen I receive [tick v]\ngo to [back v] layer\nPosition ((Danger: x) - (SCROLL X)) (((Danger: y) - (SCROLL Y)) + (([cos v] of (UP/DOWN LAVA) ) * (5)))\n\nwhen I receive [setup v]\ngo to [back v] layer\nset [up/down lava v] to [0]\nhide\ngo to x: (0) y: (0)\nset [danger: x v] to [0]\nset [danger: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [360] y: [0]\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [danger: x v] by (x)\nchange [danger: y v] by (y)\nnext costume\n\nset [danger: y v] to [0]\n\nwhen flag clicked\nhide\n\n@Spring\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((Checkpoint : x) - (SCROLL X)) ((Checkpoint : y) - (SCROLL Y))\nif <touching (player v)?> then\n    broadcast (SPRING v) and wait\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nset [checkpoint : x v] to (x)\nset [checkpoint : y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nhide\nset [checkpoint : x v] to [0]\nset [checkpoint : y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (costume1 v)\n    Clone at x: [78] y: [-73]\n    Clone at x: [840] y: [95]\n    Clone at x: [847] y: [547]\n    Clone at x: [3790] y: [-70]\n    Clone at x: [3920] y: [90]\nend\nset [checkpoint : x v] to [-99999]\n\nwhen I receive [spring v]\nstart sound [Big Boing v]\nswitch costume to (costume1 v)\nrepeat (5)\n    next costume\nend\nswitch costume to (costume1 v)\n\nClone at x: [3625] y: [-90]\nClone at x: [3710] y: [94]\n\n@Landscape\n\nwhen I receive [tick v]\nPosition ((Platforms: x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [platforms: x v] to [0]\nset [platforms: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [-1700] y: [360]\n    Clone at x: [-200] y: [200]\n    Clone at x: [400] y: [0]\n    Clone at x: [600] y: [0]\n    Clone at x: [1500] y: [-500]\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [platforms: x v] by (x)\nchange [platforms: y v] by (y)\nnext costume\n\nwait (1) seconds\n\nbroadcast (Setup v)\nstop [this script v]\n\nbroadcast (Reset v)\n\nwhen flag clicked\nhide\n\n@Gears\n\nwhen I receive [tick v]\nturn right (3) degrees\nPosition ((Danger: x) - (SCROLL X)) ((Danger: y) - (SCROLL Y))\n\nwhen I receive [setup v]\ngo to [back v] layer\nset [up/down lava v] to [0]\nhide\ngo to x: (0) y: (0)\nset [danger: x v] to [0]\nset [danger: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [539] y: [70]\n    Clone at x: [1930] y: [-100]\n    Clone at x: [1140] y: [-95]\n    Clone at x: [3710] y: [-90]\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [danger: x v] by (x)\nchange [danger: y v] by (y)\nnext costume\n\nwhen flag clicked\nhide\n\nClone at x: [460] y: [0]\nClone at x: [460] y: [0]\n\n@Saws\n\nwhen I receive [green flag v]\n\nwhen I receive [tick v]\nturn right (10) degrees\nPosition (((Moving Platforms: x) - (SCROLL X)) + (([cos v] of ((FRAME) * (3)) ) * (100))) ((Moving Platforms: y) - (SCROLL Y))\n\nwhen I receive [setup v]\ngo to [back v] layer\nhide\nset [moving platforms - horizontal v] to [0]\nset [enemy jump v] to [0]\nset [collected v] to [0]\nset [collected max v] to [0]\nset [moving platforms: x v] to [0]\nset [moving platforms: y v] to [0]\nshow\nClone at x: [2033] y: [-40]\n\nClone at x: [170] y: [-158]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [moving platforms: x v] to (x)\nset [moving platforms: y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\nClone at x: [340] y: [27]\nClone at x: [530] y: [27]\nClone at x: [786] y: [27]\nClone at x: [1124] y: [27]\nClone at x: [1331] y: [245]\nClone at x: [1065] y: [345]\nClone at x: [825] y: [272]\nClone at x: [392] y: [245]\nClone at x: [197] y: [335]\n\nClone at x: [631] y: [11]\n\nwhen flag clicked\nhide\n\n@Checkpoint \n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((Checkpoint : x) - (SCROLL X)) ((Checkpoint : y) - (SCROLL Y))\nif <(costume [number v]) = [2]> then\n    if <touching (player v)?> then\n        start sound [CHECKPOINT v]\n        switch costume to (checkpoint open v)\n        change [checkpoint v] by (1)\n    end\nend\nif <(costume [number v]) = [3]> then\n    if <touching (player v)?> then\n        start sound [CHECKPOINT v]\n        switch costume to (checkpoint open v)\n        change [checkpoint v] by (1)\n    end\nend\nif <(costume [number v]) = [4]> then\n    if <touching (player v)?> then\n        start sound [CHECKPOINT v]\n        switch costume to (checkpoint open v)\n        change [checkpoint v] by (1)\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nset [checkpoint : x v] to (x)\nset [checkpoint : y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [checkpoint : x v] to [0]\nset [checkpoint : y v] to [0]\nset [checkpoint v] to [0]\nswitch costume to (checkpoint closed v)\nhide\nif <(LEVEL) = [1]> then\n    switch costume to (checkpoint closed v)\n    Clone at x: [1404] y: [-70]\n    switch costume to (checkpoint closed2 v)\n    Clone at x: [2474] y: [-130]\n    switch costume to (checkpoint closed3 v)\n    Clone at x: [3750] y: [-63]\nend\nset [checkpoint : x v] to [-99999]\n\nClone at x: [600] y: [324]\n\nwhen I receive [reset v]\n\nwhen I receive [setup v]\n\n@Horizontal Platforms Move\n\nwhen I receive [tick v]\nPosition ((Moving Platforms: x) - (SCROLL X)) ((((Moving Platforms: y) - (SCROLL Y)) + (([cos v] of ((FRAME) * (2)) ) * (50))) + (50))\n\nwhen I receive [setup v]\nhide\nset [moving platforms - horizontal v] to [0]\nset [enemy jump v] to [0]\nset [collected v] to [0]\nset [collected max v] to [0]\nshow\nif <(LEVEL) = [1]> then\n    switch costume to (costume1 v)\n    Clone at x: [474] y: [0]\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\nhide\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [moving platforms: x v] to (x)\nset [moving platforms: y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\nClone at x: [340] y: [27]\nClone at x: [530] y: [27]\nClone at x: [786] y: [27]\nClone at x: [1124] y: [27]\nClone at x: [1331] y: [245]\nClone at x: [1065] y: [345]\nClone at x: [825] y: [272]\nClone at x: [392] y: [245]\nClone at x: [197] y: [335]\n\nClone at x: [631] y: [11]\n\nwhen flag clicked\nhide\n\n@Horizontal Platforms\n\nwhen I receive [tick v]\nchange [frame v] by (1)\nPosition ((((Moving Platforms: x) - (SCROLL X)) + (([cos v] of (FRAME) ) * (100))) - (-30)) ((Moving Platforms: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [enemy jump v] to [0]\nset [collected v] to [0]\nset [collected max v] to [0]\nset [moving platforms: x v] to [0]\nset [moving platforms: y v] to [0]\nshow\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [1300] y: [40]\n    Clone at x: [1610] y: [-95]\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\nhide\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [moving platforms: x v] to (x)\nset [moving platforms: y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\nClone at x: [340] y: [27]\nClone at x: [530] y: [27]\nClone at x: [786] y: [27]\nClone at x: [1124] y: [27]\nClone at x: [1331] y: [245]\nClone at x: [1065] y: [345]\nClone at x: [825] y: [272]\nClone at x: [392] y: [245]\nClone at x: [197] y: [335]\n\nClone at x: [631] y: [11]\n\nwhen flag clicked\nhide\n\n@Acid\n\nwhen I receive [tick v]\nchange [up/down lava v] by (2.5)\nPosition ((Danger: x) - (SCROLL X)) (((Danger: y) - (SCROLL Y)) + (([cos v] of (UP/DOWN LAVA) ) * (4)))\n\nwhen I receive [setup v]\ngo to [back v] layer\nset [up/down lava v] to [0]\nhide\ngo to x: (0) y: (0)\nset [danger: x v] to [0]\nset [danger: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [800] y: [0]\n    Clone at x: [500] y: [0]\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [danger: x v] by (x)\nchange [danger: y v] by (y)\nnext costume\n\nset [danger: y v] to [0]\n\nwhen flag clicked\nhide\n\nwait (1) seconds\n\n@Platforms\n\nwhen I receive [tick v]\nPosition ((Platforms: x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [platforms: x v] to [0]\nset [platforms: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [-1700] y: [360]\n    Clone at x: [-200] y: [200]\n    Clone at x: [400] y: [0]\n    Clone at x: [600] y: [0]\n    Clone at x: [300] y: [-600]\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [500] y: [0]\n    Clone at x: [500] y: [0]\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [platforms: x v] by (x)\nchange [platforms: y v] by (y)\nnext costume\n\nwait (1) seconds\n\nbroadcast (Setup v)\nstop [this script v]\n\nbroadcast (Reset v)\n\nwhen flag clicked\nhide\n\n@Moving Enemies\n\nwhen I receive [green flag v]\n\nwhen I receive [tick v]\nchange [enemy v] by (1.5)\nPosition (((Moving Platforms: x) - (SCROLL X)) + (([cos v] of ((FRAME) * (1.5)) ) * (100))) ((Moving Platforms: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nswitch costume to (enemy v)\nset [enemy v] to [0]\nset [collected v] to [0]\nset [collected max v] to [0]\nset [moving platforms: x v] to [0]\nset [moving platforms: y v] to [0]\nshow\nClone at x: [2780] y: [-77]\nClone at x: [3444] y: [267]\n\nClone at x: [950] y: [-100]\nClone at x: [430] y: [600]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [moving platforms: x v] to (x)\nset [moving platforms: y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\nClone at x: [340] y: [27]\nClone at x: [530] y: [27]\nClone at x: [786] y: [27]\nClone at x: [1124] y: [27]\nClone at x: [1331] y: [245]\nClone at x: [1065] y: [345]\nClone at x: [825] y: [272]\nClone at x: [392] y: [245]\nClone at x: [197] y: [335]\n\nClone at x: [631] y: [11]\n\nwhen flag clicked\nhide\n\nwhen I receive [enemy v]\nswitch costume to (enemy v)\nrepeat (10)\n    next costume\nend\nswitch costume to (enemy v)\n\n@Intro2\n\ndefine Clone Particles\nset [clone id v] to [Particle]\nrepeat (75)\n    create clone of (_myself_ v)\n    turn right (15) degrees\nend\npoint in direction (90)\n\ndefine Clone Row of Boxes\nset [brightness v] effect to (10)\nrepeat (9)\n    create clone of (_myself_ v)\n    change [var 2 v] by (-1)\n    change [brightness v] effect by (-2)\nend\n\ndefine Bounce with (bounciness) , (speed) and (finishing size)\nset [var 1 v] to [0]\nrepeat until <<(finishing size) = (size)> and <(Var 1) = (size)>>\n    set [var 2 v] to (((Var 2) * ((bounciness) / (100))) + (((finishing size) - (size)) * ((speed) / (20))))\n    set [var 1 v] to (size)\n    change size by (Var 2)\nend\nset size to (finishing size) %\n\ndefine Smooth Glide x: (x) y: (y) speed: (speed) (size)\nrepeat until <<(round (x position)) = (round (x))> and <(round (y position)) = (round (y))>>\n    change x by (((round (x)) - (round (x position))) / (speed))\n    change y by (((round (y)) - (round (y position))) / (speed))\n    change size by (((size) - (size)) / (speed))\nend\ngo to x: (x) y: (y)\nrepeat until <(round (size)) = (round (size))>\n    change size by (((size) - (size)) / (speed))\nend\nset size to (size) %\n\ndefine Type: System (text) (x) (y) (size) (color) (brightness) (speed)\nswitch costume to (master v)\nhide\ngo to x: (x) y: (y)\nset size to (size) %\nset [# v] to [1]\nset [color v] effect to (color)\nset [brightness v] effect to (brightness)\nset [length v] to (length of (text))\nrepeat (length of (text))\n    if <(letter (#) of (text)) > [ ]> then\n        switch costume to (letter (#) of (text))\n        create clone of (_myself_ v)\n        change x by ((size) * ((item (costume [number v]) of [character widths v]) / (90)))\n        change [# v] by (1)\n    else\n        switch costume to ( v)\n        create clone of (_myself_ v)\n        change x by ((size) * ((item (costume [number v]) of [character widths v]) / (90)))\n        change [# v] by (1)\n    end\n    wait (speed) seconds\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Letter]> then\n    wait until <(timer) > [0.5]>\n    wait ((#) / (Length)) seconds\n    show\n    set [x v] to (x position)\n    set [y v] to (y position)\n    go to [front v] layer\n    set size to (0) %\n    go to x: (0) y: (0)\n    Smooth Glide x: (X) y: (Y) speed: (5) (Size)\n    wait until <(timer) > [1.9]>\n    wait ((#) / ((Length) * (2))) seconds\n    set [var 1 v] to ((size) / (10))\n    repeat (30)\n        Change Size By: (Var 1)\n        change y by (Var 1)\n        change [var 1 v] by ((0) - ((size) / (100)))\n        change [ghost v] effect by (2)\n    end\n    delete this clone\nend\nif <(Clone ID) = [Box]> then\n    set [color v] effect to (0)\n    point in direction (180)\n    switch costume to (box v)\n    set [ghost v] effect to (50)\n    set size to (15) %\n    show\n    go to [back v] layer\n    go to x: ((Var 1) * (40)) y: ((Var 2) * (40))\n    repeat until <(size) > [89]>\n        change size by (((91) - (size)) / (10))\n        turn right (((180) - (direction)) / (10)) degrees\n        change [ghost v] effect by (-5)\n    end\n    set size to (90) %\n    set [ghost v] effect to (0)\n    wait until <(timer) > [3.5]>\n    set [brightness v] effect to (0)\n    repeat (20)\n        turn right (5) degrees\n        change size by (-5)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nend\n\nwhen flag clicked\nset volume to (100) %\nreset timer\nset [username v] to (join [Hi ] (username))\nset [clone id v] to [Back 2]\ncreate clone of (_myself_ v)\nSetup Lists\nType (Username) [-200] [0] [200] [115] [100] [0]\nstart sound [Tobu - Candyland pt II2 v]\nreset timer\nset [clone id v] to [Box]\nset [var 1 v] to [-6]\nrepeat (13)\n    set [var 2 v] to [4]\n    Clone Row of Boxes\n    change [var 1 v] by (1)\nend\nwait (4) seconds\nbroadcast (Start Project v)\nrepeat (40)\n    change volume by (-2.5)\nend\nstop all sounds\n\nset [clone id v] to [Logo]\ncreate clone of (_myself_ v)\nset [clone id v] to [Back]\ncreate clone of (_myself_ v)\nset [clone id v] to [Hider 1]\ncreate clone of (_myself_ v)\nset [clone id v] to [Hider 2]\ncreate clone of (_myself_ v)\n\nwait until <(timer) > [4]>\nClone Particles\nwait until <(timer) > [5.7]>\nClone Particles\nwait until <(timer) > [8.5]>\n\ndefine Setup Lists\ndelete all of [character widths v]\ndelete all of [characters v]\nadd [thing] to [character widths v]\nadd [29] to [character widths v]\nadd [24] to [character widths v]\nadd [28] to [character widths v]\nadd [27] to [character widths v]\nadd [24] to [character widths v]\nadd [24] to [character widths v]\nadd [28] to [character widths v]\nadd [28] to [character widths v]\nadd [7] to [character widths v]\nadd [21] to [character widths v]\nadd [22] to [character widths v]\nadd [22] to [character widths v]\nadd [34] to [character widths v]\nadd [27] to [character widths v]\nadd [34] to [character widths v]\nadd [22] to [character widths v]\nadd [34] to [character widths v]\nadd [21] to [character widths v]\nadd [23] to [character widths v]\nadd [27] to [character widths v]\nadd [27] to [character widths v]\nadd [29] to [character widths v]\nadd [38] to [character widths v]\nadd [26] to [character widths v]\nadd [27] to [character widths v]\nadd [27] to [character widths v]\nadd [11] to [character widths v]\nadd [20] to [character widths v]\nadd [21] to [character widths v]\nadd [25] to [character widths v]\nadd [21] to [character widths v]\nadd [20] to [character widths v]\nadd [21] to [character widths v]\nadd [20] to [character widths v]\nadd [20] to [character widths v]\nadd [20] to [character widths v]\nadd [14] to [character widths v]\nadd [25] to [character widths v]\nadd [15] to [character widths v]\nadd [10] to [character widths v]\nadd [24] to [character widths v]\nadd [24] to [character widths v]\nadd [20] to [character widths v]\nadd [24] to [character widths v]\nadd [22] to [character widths v]\nadd [16] to [character widths v]\nadd [24] to [character widths v]\nadd [22] to [character widths v]\nadd [10] to [character widths v]\nadd [14] to [character widths v]\nadd [18] to [character widths v]\nadd [9] to [character widths v]\nadd [33] to [character widths v]\nadd [22] to [character widths v]\nadd [24] to [character widths v]\nadd [24] to [character widths v]\nadd [24] to [character widths v]\nadd [15] to [character widths v]\nadd [19] to [character widths v]\nadd [16] to [character widths v]\nadd [22] to [character widths v]\nadd [22] to [character widths v]\nadd [30] to [character widths v]\nadd [20] to [character widths v]\nadd [23] to [character widths v]\nadd [20] to [character widths v]\nswitch costume to (a v)\nrepeat (66)\n    add (costume [name v]) to [characters v]\n    next costume\nend\n\ndefine Change Size By: (size)\nchange size by (size)\nchange x by ((0) - ((size) / (20)))\n\ndefine Find Size (text) (size)\nset [size v] to (size)\nset [width v] to [1]\nset [# v] to [1]\nrepeat (length of (text))\n    if <(letter (#) of (text)) > [ ]> then\n        switch costume to (letter (#) of (text))\n        change [width v] by ((Size) * ((item (costume [number v]) of [character widths v]) / (90)))\n        change [# v] by (1)\n    else\n        switch costume to ( v)\n        change [width v] by ((Size) * ((item (costume [number v]) of [character widths v]) / (90)))\n        change [# v] by (1)\n    end\nend\nif <(Width) > [400]> then\n    change [size v] by (-1)\nend\nif <(Width) < [390]> then\n    change [size v] by (1)\nend\nrepeat until <<<(Width) < [400]> and <(Width) > [389]>> or <(Size) > [300]>>\n    set [width v] to [0]\n    set [# v] to [1]\n    repeat (length of (text))\n        if <(letter (#) of (text)) > [ ]> then\n            switch costume to (letter (#) of (text))\n            change [width v] by ((Size) * ((item (costume [number v]) of [character widths v]) / (90)))\n            change [# v] by (1)\n        else\n            switch costume to ( v)\n            change [width v] by ((Size) * ((item (costume [number v]) of [character widths v]) / (90)))\n            change [# v] by (1)\n        end\n    end\n    if <(Width) > [400]> then\n        change [size v] by (-1)\n    end\n    if <(Width) < [390]> then\n        change [size v] by (1)\n    end\n    if <(Size) > [301]> then\n        set [size v] to [290]\n    end\nend\nset [x v] to ((0) - ((Width) / (2)))\n\ndefine Type (text) (x) (y) (size) (color) (brightness) (speed)\nset [clone id v] to [Letter]\nif <(length of (text)) > [20]> then\n    Find Size [Username Too Long] (size)\n    Type: System [Username Too Long] (X) (y) (Size) (color) (brightness) (speed)\nelse\n    Find Size (text) (size)\n    Type: System (text) (X) (y) (Size) (color) (brightness) (speed)\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Logo]> then\n    wait until <(timer) > [4]>\n    go to [front v] layer\n    clear graphic effects\n    switch costume to (logo v)\n    show\n    go to x: (0) y: (0)\n    set size to (0) %\n    Bounce with (65) , (20) and (90)\n    wait until <(timer) > [5.7]>\n    set [var 1 v] to [10]\n    repeat (27)\n        change size by (Var 1)\n        change [var 1 v] by (-1)\n    end\n    delete this clone\nend\nif <(Clone ID) = [Back]> then\n    go to [back v] layer\n    show\n    go to x: (0) y: (0)\n    set size to (100) %\n    switch costume to (landscape v)\n    clear graphic effects\n    repeat until <(timer) > [8]>\n        set x to (([cos v] of ((timer) * (200)) ) * (50))\n    end\n    delete this clone\nend\nif <(Clone ID) = [Back 2]> then\n    go to [back v] layer\n    show\n    go to x: (0) y: (0)\n    set size to (100) %\n    switch costume to (back2 v)\n    clear graphic effects\n    repeat until <(timer) > [8]>\n        go to [back v] layer\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Particle]> then\n    switch costume to (particle v)\n    clear graphic effects\n    set size to (100) %\n    go to x: (0) y: (0)\n    set [color v] effect to (pick random (0) to (30))\n    go to [front v] layer\n    go [backward v] (10) layers\n    set [var 1 v] to (pick random (10) to (15))\n    set [var 2 v] to (pick random (2) to (7))\n    turn right (pick random (-10) to (10)) degrees\n    show\n    repeat until <touching (_edge_ v)?>\n        move (Var 1) steps\n        change y by (Var 2)\n        change [var 2 v] by (-0.4)\n        set [var 1 v] to ((Var 1) * (0.95))\n    end\n    repeat (10)\n        move (Var 1) steps\n        change y by (Var 2)\n        change [var 2 v] by (-0.4)\n        set [var 1 v] to ((Var 1) * (0.95))\n        change [ghost v] effect by (10)\n    end\n    hide\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Hider 1]> then\n    wait until <(timer) > [7]>\n    go to [front v] layer\n    point in direction (105)\n    show\n    go to x: (300) y: (0)\n    set size to (100) %\n    switch costume to (hider 2 v)\n    clear graphic effects\n    repeat until <<(round (x position)) = [0]> and <(round (y position)) = [0]>>\n        change x by (((0) - (round (x position))) / (5))\n        change y by (((0) - (round (y position))) / (5))\n    end\n    go to x: (0) y: (0)\n    wait (1) seconds\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nend\nif <(Clone ID) = [Hider 2]> then\n    wait until <(timer) > [7]>\n    go to [front v] layer\n    point in direction (105)\n    show\n    go to x: (-300) y: (0)\n    set size to (100) %\n    switch costume to (hider 1 v)\n    clear graphic effects\n    repeat until <<(round (x position)) = [0]> and <(round (y position)) = [0]>>\n        change x by (((0) - (round (x position))) / (5))\n        change y by (((0) - (round (y position))) / (5))\n    end\n    go to x: (0) y: (0)\n    wait (1) seconds\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nend\n\n@Sprite3\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\nshow\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\nforever\n    if <(Checkpoint) = [1]> then\n        switch costume to (costume3 v)\n    end\n    if <(Checkpoint) = [2]> then\n        switch costume to (costume4 v)\n    end\n    if <(Checkpoint) = [3]> then\n        switch costume to (costume5 v)\n    end\n    if <(Checkpoint) = [4]> then\n        switch costume to (costume1 v)\n    end\nend\n\n