The Ultimate Game

Instructions: Controls:\n[ WASD ] or arrowkeys to move\n[ P ] - Toggle Pause\n[ M ] - Toggle Music ON/OFF\n[ R ] - To restart level\n\nThe Ultimate Game is a puzzle platformer with levels made entirely using the level editor in Ultimate Game Creator 6.1. There are 15 carefully crafted levels that stretch from the basic "First steps" to the extremely difficult "The Rage Machine".\nTry to finish all of them as fast as you can and with as few deaths as possible. Enjoy! :)\n\nALL levels are possible :P\n

@Stage\n\nwhen flag clicked\nerase all\nswitch backdrop to (main menu v)\nbroadcast (Main Menu v)\nbroadcast (Music v)\n\nwhen [p v] key pressed\nif <(Win) = [0]> then\n    if <(PAUSE) = [0]> then\n        set [pause v] to [1]\n        set [∆time v] to (timer)\n    else\n        set [pause v] to [0]\n        set [∆time v] to ((timer) - (∆Time))\n        change [total pause time v] by (∆Time)\n    end\n    wait until <not <key (p v) pressed?>>\nend\n\nwhen [m v] key pressed\nif <(Music ON/OFF) = [ON]> then\n    set [music on/off v] to [OFF]\nelse\n    set [music on/off v] to [ON]\nend\nbroadcast (Music v)\nwait until <not <key (m v) pressed?>>\n\nwhen I receive [next level v]\nchange [#level v] by (1)\nbroadcast (Import Level v) and wait\nbroadcast (Build Level v)\nif <(#LEVEL) = (length of [levels v])> then\n    broadcast (YOU WIN v)\nelse\n    broadcast (Play v)\nend\n\nwhen I receive [music v]\nif <(Music ON/OFF) = [ON]> then\n    play sound [In My Paradise v] until done\n    broadcast (Music v)\nelse\n    stop all sounds\nend\n\nwhen I receive [start game v]\nswitch backdrop to (playing area v)\nset [total pause time v] to [0]\nset [music on/off v] to [ON]\nset [sfx on/off v] to [ON]\nset [#level v] to [0]\nset [#deaths v] to [0]\nset [pause v] to [0]\nset [play v] to [0]\nbroadcast (Fade v)\nreset timer\nset [play v] to [1]\nset [win v] to [0]\nrepeat until <(#LEVEL) = [16]>\n    if <<<key (up arrow v) pressed?> and <key (down arrow v) pressed?>> and <key (0 v) pressed?>> then\n        ask [Go to level:] and wait\n        set [#level v] to (answer)\n        broadcast (Import Level v) and wait\n        broadcast (Build Level v)\n        broadcast (Play v)\n    end\nend\nswitch backdrop to (you win v)\n\n@Main Menu\n\nwhen I receive [main menu v]\ngo to x: (0) y: (0)\nswitch costume to (main menu v)\nclear graphic effects\nset size to (100) %\ngo to [front v] layer\nshow\nwait until <([backdrop # v] of [_stage_ v]) > [1]>\nrepeat (5)\n    change size by (20)\n    change [ghost v] effect by (20)\nend\nhide\n\n@Start Button\n\nwhen I receive [main menu v]\nhide\nswitch costume to (start v)\nset size to (200) %\nclear graphic effects\nwait (0.0001) seconds\ngo to [front v] layer\nrepeat until <([backdrop # v] of [_stage_ v]) > [1]>\n    go to x: (0) y: (-120)\n    show\n    if <<touching (mouse-pointer v)?> and <not <touching (game info v)?>>> then\n        change size by (((115) - (size)) / (2))\n        if <mouse down?> then\n            set size to (100) %\n            broadcast (Start Game v)\n            wait (0) seconds\n            repeat (5)\n                change size by (20)\n                change [ghost v] effect by (20)\n            end\n            hide\n        end\n    else\n        change size by (((100) - (size)) / (3))\n    end\nend\nhide\n\nwhen I receive [you win v]\nhide\nswitch costume to (play again v)\nset size to (200) %\nclear graphic effects\nwait (1.5) seconds\nrepeat until <([backdrop # v] of [_stage_ v]) < [3]>\n    go to x: (0) y: (-120)\n    go to [front v] layer\n    show\n    if <touching (mouse-pointer v)?> then\n        change size by (((115) - (size)) / (2))\n        if <mouse down?> then\n            set size to (100) %\n            broadcast (Start Game v)\n            wait (0) seconds\n            repeat (5)\n                change size by (20)\n                change [ghost v] effect by (20)\n            end\n            hide\n        end\n    else\n        change size by (((100) - (size)) / (3))\n    end\nend\nhide\n\n@Game Info\n\nwhen I receive [main menu v]\nhide\nswitch costume to (info button v)\nset size to (200) %\nclear graphic effects\nwait (0.0001) seconds\ngo to [front v] layer\nrepeat until <([backdrop # v] of [_stage_ v]) > [1]>\n    go to x: (217) y: (-158)\n    show\n    if <touching (mouse-pointer v)?> then\n        change size by (((115) - (size)) / (2))\n        if <mouse down?> then\n            set size to (100) %\n            wait (0) seconds\n            repeat (5)\n                change size by (20)\n                change [ghost v] effect by (20)\n            end\n            hide\n            switch costume to (game info v)\n            go to x: (0) y: (0)\n            set size to (100) %\n            go to [front v] layer\n            show\n            repeat (5)\n                change [ghost v] effect by (-19)\n            end\n            wait until <not <mouse down?>>\n            wait until <<touching (mouse-pointer v)?> and <mouse down?>>\n            repeat (5)\n                change [ghost v] effect by (19)\n            end\n            switch costume to (info button v)\n            go to x: (217) y: (-158)\n            repeat (5)\n                change [ghost v] effect by (-20)\n            end\n        end\n    else\n        change size by (((100) - (size)) / (3))\n    end\nend\nhide\n\n@Character\n\ndefine None\nset [telecounter v] to [1]\nif <<(item (TeleCounter) of [teleportals v]) = (x)> and <(item ((TeleCounter) + (1)) of [teleportals v]) = (y)>> then\nelse\n    repeat until <<((TeleCounter) + (1)) > (length of [teleportals v])> or <<(item (TeleCounter) of [teleportals v]) = (x)> and <(item ((TeleCounter) + (1)) of [teleportals v]) = (y)>>>\n        change [telecounter v] by (2)\n    end\n    if <((TeleCounter) + (1)) > (length of [teleportals v])> then\n        set [telecounter v] to [0]\n    end\nend\n\ndefine Check Collision\nif <<not <(Disable) = [2]>> and <<touching (_edge_ v)?> or <<touching color (#a9a9a9)?> or <<touching color (#66d3f7)?> or <<touching color (#ff7475)?> or <<touching color (#8079ea)?> or <<touching color (#00d797)?> or <<touching color (#ffb400)?> or >>>>>>>> then\n    set [<charactercollision> v] to [1]\nelse\n    if <<not <(Disable) = [2]>> and <<touching color (#ff2b09)?> or <<touching color (#18e444)?> or <<key (r v) pressed?> or >>>> then\n        set [<charactercollision> v] to [2]\n    else\n        if <<not <(Disable) = [2]>> and <touching color (#006af5)?>> then\n            set [<charactercollision> v] to [Blue]\n        else\n            if <<not <(Disable) = [2]>> and <touching color (#36de09)?>> then\n                set [<charactercollision> v] to [Green]\n            else\n                if <<not <(Disable) = [2]>> and <touching color (#d35e4b)?>> then\n                    set [<charactercollision> v] to [Red]\n                else\n                    if <<not <(Disable) = [2]>> and <touching color (#fbc203)?>> then\n                        set [<charactercollision> v] to [Yellow]\n                    else\n                        set [<charactercollision> v] to [0]\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [somersault v]\nset [loopcounter v] to [0]\nrepeat until <<<(xv) = [0]> or <(yv) = [0]>> or <<(LoopCounter) = [21]> or <(<CharacterCollision>) = [1]>>>\n    change [loopcounter v] by (1)\n    if <(xv) < [0]> then\n        turn left (17.1) degrees\n    else\n        turn left (-17.1) degrees\n    end\n    Check Collision\nend\npoint in direction ((90) * (Gravity Dir.))\nCheck Collision\nif <(<Collision?>) = [1]> then\n    repeat until <not <(<CharacterCollision>) = [1]>>\n        point in direction ((90) * (Gravity Dir.))\n        change y by (((yv) + (0.5)) * (-1.5))\n        change x by (((xv) + (0.5)) * (-1.5))\n        Check Collision\n    end\nend\nset [loopcounter v] to [0]\n\nwhen I receive [main menu v]\nset [#n of characters v] to [10]\nreset timer\nset [# character v] to [1]\nset [wiggle v] to [40]\npoint in direction (90)\nset size to (1000) %\ngo [backward v] (1) layers\nshow\nrepeat until <([backdrop # v] of [_stage_ v]) > [1]>\n    go to x: (((mouse x) / (Wiggle)) + ((0) * ([sin v] of ((timer) * (200)) ))) y: (((mouse y) / (Wiggle)) + ((0) * ([sin v] of ((timer) * (400)) )))\n    if <<<<touching (mouse-pointer v)?> and <mouse down?>> and <not <touching (game info v)?>>> and <([sqrt v] of ((((mouse x) + (1)) * ((mouse x) + (1))) + (((mouse y) - (10)) * ((mouse y) - (10)))) ) < [82]>> then\n        if <(# Character) < (#n of characters)> then\n            change [# character v] by (1)\n        else\n            set [# character v] to [1]\n        end\n        repeat (10)\n            change x by (((200) - ((x position) / (2))) / (5))\n            set y to (((mouse y) / (Wiggle)) + ((0) * ([sin v] of ((timer) * (400)) )))\n        end\n        go to x: (-160) y: (((mouse y) / (Wiggle)) + ((0) * ([sin v] of ((timer) * (400)) )))\n        switch costume to (# Character)\n        repeat (10)\n            change x by (((((mouse x) / (Wiggle)) + ((0) * ([sin v] of ((timer) * (200)) ))) - ((x position) * (2))) / (5))\n            set y to (((mouse y) / (Wiggle)) + ((0) * ([sin v] of ((timer) * (400)) )))\n        end\n    end\n    if <not <(costume [number v]) = (# Character)>> then\n        switch costume to (# Character)\n    end\nend\nrepeat (11)\n    change size by (((100) - (size)) / (2))\nend\n\nwhen I receive [restart v]\nchange [#deaths v] by (1)\nif <not <(length of [checkpoint x/y v]) = [0]>> then\n    go to x: (item (1) of [checkpoint x/y v]) y: (item (2) of [checkpoint x/y v])\n    if <(Save Checkpoint Gravity 1/0) = [1]> then\n        set [gravity dir. v] to (item (3) of [checkpoint x/y v])\n        point in direction ((90) * (Gravity Dir.))\n    else\n        set [gravity dir. v] to [1]\n        if <not <(direction) = [90]>> then\n            point in direction (90)\n        end\n    end\nelse\n    go to x: (item (1) of [character start x/y v]) y: (item (2) of [character start x/y v])\n    set [gravity dir. v] to [1]\n    if <not <(direction) = [90]>> then\n        point in direction (90)\n    end\nend\nif <not <(costume [number v]) = (# Character)>> then\n    switch costume to (# Character)\nend\nset [xv v] to [0]\nset [yv v] to [0]\nset [restart v] to [0]\n\nwhen I receive [play v]\nhide\nif <not <(costume [number v]) = (# Character)>> then\n    switch costume to (# Character)\nend\nset [xv v] to [0]\nset [yv v] to [0]\nset [jumpheight v] to [11]\nset [gravity dir. v] to [1]\nset [disable v] to [0]\nset [<charactercollision> v] to [0]\nset [win v] to [0]\nset [restart v] to [0]\npoint in direction (90)\nset size to (100) %\ndelete (all) of [checkpoint x/y v]\ngo to x: (item (1) of [character start x/y v]) y: (item (2) of [character start x/y v])\nwait until <(PLAY) = [1]>\nwait (0.5) seconds\nset [ghost v] effect to (100)\ngo to [front v] layer\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nrepeat until <(Win) = [1]>\n    if <(Disable) = [0]> then\n        Character Physics (Disable)\n        if <(PAUSE) = [1]> then\n            go [backward v] (100) layers\n            repeat until <<not <(PAUSE) = [1]>> or <(PLAY) = [0]>>\n                if <not <(# Character) = (join (letter ((length of ([costume name v] of [character v])) - (1)) of ([costume name v] of [character v])) (letter (length of ([costume name v] of [character v])) of ([costume name v] of [character v])))>> then\n                    switch costume to (((costume [number v]) - (join (letter ((length of ([costume name v] of [character v])) - (1)) of ([costume name v] of [character v])) (letter (length of ([costume name v] of [character v])) of ([costume name v] of [character v])))) + (# Character))\n                end\n            end\n            go to [front v] layer\n        end\n    end\n    if <(Disable) = [1]> then\n        repeat until <<<touching color (#ff2b09)?> or <<key (r v) pressed?> or <(PLAY) = [0]>>> or <<not <touching color (#8b27af)?>> and <not <<<(length of [teleportals v]) > [2]> and <<touching color (#e8f7ff)?> and <<touching color (#208fff)?> and <touching color (#d487ff)?>>>> and <<[teleportals v] contains (((24) * (round (((x position) - (12)) / (24)))) + (12))?> and <[teleportals v] contains (((24) * (round (((y position) - (0)) / (24)))) + (0))?>>>>>>\n            Character Physics (Disable)\n            Check Collision\n            if <(PAUSE) = [1]> then\n                go [backward v] (100) layers\n                wait until <<not <(PAUSE) = [1]>> or <(PLAY) = [0]>>\n                go to [front v] layer\n            end\n        end\n        if <<touching color (#ff2b09)?> or <<key (r v) pressed?> or <(PLAY) = [0]>>> then\n            broadcast (Restart v)\n        end\n        set [disable v] to [0]\n    end\n    if <<(Disable) = [2]> or <(Disable) = [3]>> then\n        if <(Disable) = [2]> then\n            set [yv v] to ((yv) * (-0.5))\n        end\n        repeat (10)\n            if <(Disable) = [2]> then\n                turn right ((([abs v] of (xv) ) * (2)) * ((xv) / ([abs v] of (xv) ))) degrees\n            end\n            change [ghost v] effect by (10)\n            Character Physics (Disable)\n        end\n        broadcast (Restart v)\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        if <(Disable) = [3]> then\n            wait until <([y position v] of [event bar v]) > [50]>\n        end\n        set [disable v] to [0]\n    end\nend\nset [animation v] to [5]\nrepeat (30)\n    change [animation v] by (1)\n    change [ghost v] effect by (4)\n    change size by (Animation)\n    turn right ((Animation) * ((xv) / ([abs v] of (xv) ))) degrees\nend\nbroadcast (Fade v)\n\ndefine None\nif <<(disable) = [0]> and <touching color (#8b27af)?>> then\n    if <(SFX ON/OFF) = [ON]> then\n        start sound [Slow motion swish v]\n    end\n    set [yv v] to ((yv) * (-0.5))\n    if <(Gravity Dir.) = [1]> then\n        set [gravity dir. v] to [-1]\n        repeat (5)\n            turn right (36) degrees\n        end\n    else\n        set [gravity dir. v] to [1]\n        repeat (5)\n            turn right (-36) degrees\n        end\n    end\n    set [disable v] to [1]\nend\nif <<touching color (#fbbf57)?> and <<<touching color (#ff8100)?> and <touching color (#ffe797)?>> and <<touching color (#ffe28e)?> and <touching color (#ffb044)?>>>> then\n    if <not <(join (join (((24) * (round (((x position) - (12)) / (24)))) + (12)) ((24) * (round ((y position) / (24))))) (Gravity Dir.)) = (join (item (1) of [checkpoint x/y v]) (join (item (2) of [checkpoint x/y v]) (item (3) of [checkpoint x/y v])))>> then\n        if <(SFX ON/OFF) = [ON]> then\n            start sound [Checkpoint ding v]\n        end\n        delete (all) of [checkpoint x/y v]\n        add (((24) * (round (((x position) - (12)) / (24)))) + (12)) to [checkpoint x/y v]\n        add ((24) * (round ((y position) / (24)))) to [checkpoint x/y v]\n        add (Gravity Dir.) to [checkpoint x/y v]\n    end\nend\nif <<(disable) = [0]> and <<<(length of [teleportals v]) > [2]> and <<touching color (#e8f7ff)?> and <<touching color (#208fff)?> and <touching color (#d487ff)?>>>> and <<[teleportals v] contains (((24) * (round (((x position) - (12)) / (24)))) + (12))?> and <[teleportals v] contains (((24) * (round (((y position) - (0)) / (24)))) + (0))?>>>> then\n    set [disable v] to [1]\n    Find Teleportal at (((24) * (round ((((x position) + (xv)) - (12)) / (24)))) + (12)) ((24) * (round (((y position) + ((yv) * (Gravity Dir.))) / (24))))\n    if <not <(TeleCounter) = [0]>> then\n        set [xv v] to [0]\n        set [yv v] to [0]\n        glide (0.07) secs to x: (item (TeleCounter) of [teleportals v]) y: (item ((TeleCounter) + (1)) of [teleportals v])\n        if <(SFX ON/OFF) = [ON]> then\n            start sound [Teleportal Sound v]\n        end\n        repeat (8)\n            change [ghost v] effect by (12.5)\n            change size by (-6.25)\n            turn right (6.25) degrees\n        end\n        if <((((TeleCounter) + (1)) / (2)) mod (2)) = [1]> then\n            go to x: (item ((TeleCounter) + (2)) of [teleportals v]) y: (item ((TeleCounter) + (3)) of [teleportals v])\n        else\n            go to x: (item ((TeleCounter) - (2)) of [teleportals v]) y: (item ((TeleCounter) - (1)) of [teleportals v])\n        end\n        if <(SFX ON/OFF) = [ON]> then\n            start sound [Teleportal Sound v]\n        end\n        repeat (8)\n            change [ghost v] effect by (-12.5)\n            change size by (6.25)\n            turn right (-6.25) degrees\n        end\n        set [disable v] to [1]\n    end\nend\nCheck Collision\nif <<(<CharacterCollision>) = [2]> or <(RESTART) = [1]>> then\n    if <key (r v) pressed?> then\n        broadcast (Restart v)\n    else\n        if <touching color (#18e444)?> then\n            if <(Win) = [0]> then\n                set [win v] to [1]\n                delete (all) of [checkpoint x/y v]\n            end\n        else\n            set [disable v] to [2]\n            set [restart v] to [1]\n        end\n    end\nend\nif <(disable) < [2]> then\n    if <<touching color (#d0ecf9)?> or <touching color (#67ceff)?>> then\n        if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n            set [yv v] to [-5]\n        else\n            set [yv v] to [5]\n        end\n    end\n    if <<not <(costume [number v]) = (# Character)>> and <<(xv) = (yv)> or <<<(xv) = [0]> and <not <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<key (a v) pressed?> or <key (left arrow v) pressed?>>>>> or <<(yv) = [0]> and <not <<key (w v) pressed?> or <key (up arrow v) pressed?>>>>>>> then\n        switch costume to (# Character)\n    end\n    if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n        if <(Gravity Dir.) = [1]> then\n            if <not <(costume [number v]) = ((# Character) + ((1) * (#n of characters)))>> then\n                switch costume to ((# Character) + ((1) * (#n of characters)))\n            end\n        else\n            if <not <(costume [number v]) = ((# Character) + ((2) * (#n of characters)))>> then\n                switch costume to ((# Character) + ((2) * (#n of characters)))\n            end\n        end\n        if <(Ice?) = [1]> then\n            change [xv v] by (0.2)\n        else\n            change [xv v] by (1)\n        end\n    end\n    if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n        if <(Gravity Dir.) = [1]> then\n            if <not <(costume [number v]) = ((# Character) + ((2) * (#n of characters)))>> then\n                switch costume to ((# Character) + ((2) * (#n of characters)))\n            end\n        else\n            if <not <(costume [number v]) = ((# Character) + ((1) * (#n of characters)))>> then\n                switch costume to ((# Character) + ((1) * (#n of characters)))\n            end\n        end\n        if <(Ice?) = [1]> then\n            change [xv v] by (-0.2)\n        else\n            change [xv v] by (-1)\n        end\n    end\n    if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n        change y by ((-2) * (Gravity Dir.))\n        if <touching color (#66d3f7)?> then\n            set [ice? v] to [1]\n        else\n            set [ice? v] to [0]\n        end\n        if <touching color (#ffb400)?> then\n            if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n                change [xv v] by (0.9)\n            else\n                change [xv v] by (1.5)\n            end\n        end\n        if <touching color (#00d797)?> then\n            if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n                change [xv v] by (-0.9)\n            else\n                change [xv v] by (-1.5)\n            end\n        end\n        Check Collision\n        if <<(<CharacterCollision>) = [1]> and <not <touching color (#ff7475)?>>> then\n            if <not <(costume [number v]) = ((# Character) + ((3) * (#n of characters)))>> then\n                switch costume to ((# Character) + ((3) * (#n of characters)))\n            end\n            if <touching color (#8079ea)?> then\n                set [yv v] to ((JumpHeight) + (8))\n                if <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<key (a v) pressed?> or <key (left arrow v) pressed?>>> then\n                    broadcast (Somersault v)\n                end\n            else\n                set [yv v] to (JumpHeight)\n            end\n        end\n        change y by ((2) * (Gravity Dir.))\n    end\nend\nif <(yv) < [3]> then\n    change y by ((-1) * (Gravity Dir.))\n    Check Collision\n    if <not <(<CharacterCollision>) = [1]>> then\n        change [yv v] by (-1)\n    end\n    if <touching color (#66d3f7)?> then\n        set [ice? v] to [1]\n    else\n        set [ice? v] to [0]\n    end\n    if <touching color (#ffb400)?> then\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            change [xv v] by (0.9)\n        else\n            change [xv v] by (1.5)\n        end\n    end\n    if <touching color (#00d797)?> then\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            change [xv v] by (-0.9)\n        else\n            change [xv v] by (-1.5)\n        end\n    end\n    change y by ((1) * (Gravity Dir.))\nend\nif <(Ice?) = [1]> then\n    set [xv v] to ((xv) * (0.97))\nelse\n    set [xv v] to ((xv) * (0.84))\nend\nchange x by (xv)\nCheck Collision\nif <(<CharacterCollision>) = [1]> then\n    change y by (([abs v] of ((([abs v] of (xv) ) / ((xv) + (0.0001))) + (xv)) ) * (Gravity Dir.))\n    Check Collision\n    if <(<CharacterCollision>) = [1]> then\n        point in direction ((90) * (Gravity Dir.))\n        change y by ((([abs v] of ((([abs v] of (xv) ) / ((xv) + (0.0001))) + (xv)) ) * (-1)) * (Gravity Dir.))\n        change x by ((xv) * (-1))\n        set [xv v] to [0]\n    end\nend\nif <(length of (xv)) > [20]> then\n    set [xv v] to [0]\nend\nset [yv v] to ((yv) * (0.9))\nchange y by ((yv) * (Gravity Dir.))\nCheck Collision\nif <(<CharacterCollision>) = [1]> then\n    change y by (((yv) * (-1)) * (Gravity Dir.))\n    set [yv v] to [0]\nend\nCheck Collision\nif <(<CharacterCollision>) = [1]> then\n    go to x: (item (1) of [latest position x/y v]) y: (item (2) of [latest position x/y v])\n    Check Collision\n    if <<(([abs v] of (xv) ) + ([abs v] of (yv) )) = [0]> and <(<CharacterCollision>) = [1]>> then\n        go to x: (((round (((x position) + (12)) / (24))) * (24)) - (12)) y: ((round ((y position) / (24))) * (24))\n    end\nelse\n    delete (all) of [latest position x/y v]\n    add (x position) to [latest position x/y v]\n    add (y position) to [latest position x/y v]\nend\n\n@Blocks\n\ndefine None\nset [c1 v] to [0]\nset size to (size) %\nif <(size) = [50]> then\n    point in direction (90)\n    go to x: ((((item (1) of [character start x/y v]) / (100)) * (size)) + (xoffset)) y: ((((item (2) of [character start x/y v]) / (100)) * (size)) + (yoffset))\n    switch costume to ((26) + (# Character))\n    stamp\nend\nrepeat (length of [costume v])\n    change [c1 v] by (1)\n    if <not <(direction) = [90]>> then\n        point in direction (90)\n    end\n    go to x: ((((item (C1) of [blocks-x v]) / (100)) * (size)) + (xoffset)) y: ((((item (C1) of [blocks-y v]) / (100)) * (size)) + (yoffset))\n    if <(item (C1) of [costume v]) = [A]> then\n        switch costume to (basic block v)\n    end\n    if <(item (C1) of [costume v]) = [B]> then\n        switch costume to (slope block v)\n    end\n    if <(item (C1) of [costume v]) = [C]> then\n        switch costume to (red block v)\n    end\n    if <(item (C1) of [costume v]) = [D]> then\n        switch costume to (spike v)\n    end\n    if <(item (C1) of [costume v]) = [E]> then\n        switch costume to (pull-down block v)\n    end\n    if <(item (C1) of [costume v]) = [F]> then\n        switch costume to (jump block v)\n    end\n    if <(item (C1) of [costume v]) = [G]> then\n        switch costume to (conveyer belt right v)\n    end\n    if <(item (C1) of [costume v]) = [H]> then\n        switch costume to (conveyer belt left v)\n    end\n    if <(item (C1) of [costume v]) = [I]> then\n        switch costume to (ice block v)\n    end\n    if <(item (C1) of [costume v]) = [J]> then\n        switch costume to (gravity block v)\n    end\n    if <(item (C1) of [costume v]) = [K]> then\n        switch costume to (finish block v)\n    end\n    if <(item (C1) of [costume v]) = [L]> then\n        switch costume to (teleportal v)\n    end\n    if <(item (C1) of [costume v]) = [M]> then\n        switch costume to (gravity switch v)\n    end\n    if <(item (C1) of [costume v]) = [N]> then\n        switch costume to (checkpoint block v)\n    end\n    if <(item (C1) of [costume v]) = [O]> then\n        switch costume to (blue door v)\n    end\n    if <(item (C1) of [costume v]) = [P]> then\n        switch costume to (green door v)\n    end\n    if <(item (C1) of [costume v]) = [Q]> then\n        switch costume to (red door v)\n    end\n    if <(item (C1) of [costume v]) = [R]> then\n        switch costume to (yellow door v)\n    end\n    if <(item (C1) of [costume v]) = [S]> then\n        switch costume to (blue button v)\n    end\n    if <(item (C1) of [costume v]) = [T]> then\n        switch costume to (green button v)\n    end\n    if <(item (C1) of [costume v]) = [U]> then\n        switch costume to (red button v)\n    end\n    if <(item (C1) of [costume v]) = [V]> then\n        switch costume to (yellow button v)\n    end\n    if <(item (C1) of [costume v]) = [W]> then\n        switch costume to (laser cannon v)\n        if <(size) = [100]> then\n            set [clone mode v] to [Laser Cannon]\n            create clone of (_myself_ v)\n        end\n    end\n    if <(item (C1) of [costume v]) = [X]> then\n        switch costume to (enemy v)\n        if <(size) = [100]> then\n            set [clone mode v] to [Enemy]\n            create clone of (_myself_ v)\n        end\n    end\n    if <(item (C1) of [costume v]) = [Y]> then\n        if <not <(direction) = [0]>> then\n            point in direction (0)\n        end\n        switch costume to (slope block v)\n    end\n    if <(item (C1) of [costume v]) = [Z]> then\n        if <not <(direction) = [-90]>> then\n            point in direction (-90)\n        end\n        switch costume to (slope block v)\n    end\n    if <(item (C1) of [costume v]) = [!]> then\n        if <not <(direction) = [180]>> then\n            point in direction (180)\n        end\n        switch costume to (slope block v)\n    end\n    if <(item (C1) of [costume v]) = [?]> then\n        if <not <(direction) = [0]>> then\n            point in direction (0)\n        end\n        switch costume to (spike v)\n    end\n    if <(item (C1) of [costume v]) = [#]> then\n        if <not <(direction) = [-90]>> then\n            point in direction (-90)\n        end\n        switch costume to (spike v)\n    end\n    if <(item (C1) of [costume v]) = [\]> then\n        if <not <(direction) = [180]>> then\n            point in direction (180)\n        end\n        switch costume to (spike v)\n    end\n    if <(item (C1) of [costume v]) = [%]> then\n        if <not <(direction) = [-90]>> then\n            point in direction (-90)\n        end\n        switch costume to (pull-down block v)\n    end\n    if <(item (C1) of [costume v]) = [&]> then\n        if <not <(direction) = [-90]>> then\n            point in direction (-90)\n        end\n        switch costume to (jump block v)\n    end\n    if <(item (C1) of [costume v]) = [/]> then\n        if <not <(direction) = [0]>> then\n            point in direction (0)\n        end\n        switch costume to (laser cannon v)\n        if <(size) = [100]> then\n            set [clone mode v] to [Laser Cannon]\n            create clone of (_myself_ v)\n        end\n    end\n    if <(item (C1) of [costume v]) = [\(]> then\n        if <not <(direction) = [-90]>> then\n            point in direction (-90)\n        end\n        switch costume to (laser cannon v)\n        if <(size) = [100]> then\n            set [clone mode v] to [Laser Cannon]\n            create clone of (_myself_ v)\n        end\n    end\n    if <(item (C1) of [costume v]) = [\)]> then\n        if <not <(direction) = [180]>> then\n            point in direction (180)\n        end\n        switch costume to (laser cannon v)\n        if <(size) = [100]> then\n            set [clone mode v] to [Laser Cannon]\n            create clone of (_myself_ v)\n        end\n    end\n    if <<(x position) < [240]> and <(x position) > [-240]>> then\n        stamp\n    end\nend\n\ndefine Check Collision\nset [<collision?> v] to [0]\nif <<touching (_edge_ v)?> or <<touching color (#a9a9a9)?> or <<touching color (#66d3f7)?> or <<touching color (#ff7475)?> or <<touching color (#8079ea)?> or <<touching color (#00d797)?> or <touching color (#ffb400)?>>>>>>> then\n    set [<collision?> v] to [1]\nend\n\nwhen I start as a clone\nchange [test1 v] by (1)\nset [clonex v] to (x position)\nset [cloney v] to (y position)\nset [clonedir v] to (direction)\nif <not <(size) = [100]>> then\n    set size to (100) %\nend\nwait until <(PLAY) = [1]>\nif <<(PLAY) = [1]> and <([backdrop # v] of [_stage_ v]) = [2]>> then\n    if <(Clone Mode) = [Enemy]> then\n        if <not <(join (CloneX) (CloneY)) = (join (x position) (y position))>> then\n            go to x: (CloneX) y: (CloneY)\n        end\n        switch costume to (erasor v)\n        point in direction (90)\n        show\n        stamp\n        switch costume to (enemy v)\n        repeat until <(PLAY) = [0]>\n            if <not <(PAUSE) > [0]>> then\n                if <(Enemy Speed) > [0]> then\n                    repeat until <<<(PLAY) = [0]> or <(<Collision?>) = [0]>> or <<<touching (character v)?> and <<([yv v] of [character v]) < [-5]> and <(Defeat-able enemies 1/0) = [1]>>> and <not <(RESTART) = [1]>>>>\n                        if <not <(PAUSE) > [0]>> then\n                            move (Enemy Speed) steps\n                            Check Collision\n                        end\n                    end\n                    repeat until <<<(PLAY) = [0]> or <(<Collision?>) = [1]>> or <<<touching (character v)?> and <<([yv v] of [character v]) < [-5]> and <(Defeat-able enemies 1/0) = [1]>>> and <not <(RESTART) = [1]>>>>\n                        if <not <(PAUSE) > [0]>> then\n                            move (Enemy Speed) steps\n                            Check Collision\n                        end\n                    end\n                    repeat until <<<(PLAY) = [0]> or <(<Collision?>) = [0]>> or <<<touching (character v)?> and <<([yv v] of [character v]) < [-5]> and <(Defeat-able enemies 1/0) = [1]>>> and <not <(RESTART) = [1]>>>>\n                        if <not <(PAUSE) > [0]>> then\n                            move ((Enemy Speed) * (-1)) steps\n                            Check Collision\n                        end\n                    end\n                    repeat until <<<(PLAY) = [0]> or <(<Collision?>) = [1]>> or <<<touching (character v)?> and <<([yv v] of [character v]) < [-5]> and <(Defeat-able enemies 1/0) = [1]>>> and <not <(RESTART) = [1]>>>>\n                        if <not <(PAUSE) > [0]>> then\n                            move ((Enemy Speed) * (-1)) steps\n                            Check Collision\n                        end\n                    end\n                end\n                if <<<touching (character v)?> and <<([yv v] of [character v]) < [-5]> and <(Defeat-able enemies? 1/0) = [1]>>> and <not <(RESTART) = [1]>>> then\n                    switch costume to (enemydie v)\n                    if <(SFX ON/OFF) = [ON]> then\n                        start sound [Stomp v]\n                    end\n                    repeat (5)\n                        change size by (-20)\n                        change y by (-2)\n                    end\n                    hide\n                    set size to (100) %\n                    wait until <<(PLAY) = [0]> or <<(RESTART) = [1]> or <key (r v) pressed?>>>\n                    if <(PLAY) = [0]> then\n                        if <not <(join (CloneX) (CloneY)) = (join (x position) (y position))>> then\n                            go to x: (CloneX) y: (CloneY)\n                        end\n                        switch costume to (enemy v)\n                        show\n                        stamp\n                        delete this clone\n                    else\n                        if <not <(costume [number v]) = [24]>> then\n                            switch costume to (enemy v)\n                        end\n                        if <not <(join (CloneX) (CloneY)) = (join (x position) (y position))>> then\n                            go to x: (CloneX) y: (CloneY)\n                        end\n                        show\n                    end\n                end\n            end\n        end\n        if <not <(join (CloneX) (CloneY)) = (join (x position) (y position))>> then\n            go to x: (CloneX) y: (CloneY)\n        end\n        switch costume to (enemy v)\n        show\n        stamp\n        delete this clone\n    end\n    if <(Clone Mode) = [Laser Cannon]> then\n        if <not <(costume [number v]) = [23]>> then\n            switch costume to (laser cannon v)\n        end\n        show\n        repeat until <(PLAY) = [0]>\n            if <not <(join (CloneX) (CloneY)) = (join (x position) (y position))>> then\n                go to x: (CloneX) y: (CloneY)\n            end\n            if <<not <(PAUSE) > [0]>> and <<(Cannon Fire Rate) > [0]> and <<<(CloneDir) = [0]> and <<([y position v] of [character v]) > (CloneY)> and <(((round (((CloneX) + (12)) / (24))) * (24)) - (12)) = (((round ((([x position v] of [character v]) + (12)) / (24))) * (24)) - (12))>>> or <<<(CloneDir) = [180]> and <<([y position v] of [character v]) < (CloneY)> and <(((round (((CloneX) + (12)) / (24))) * (24)) - (12)) = (((round ((([x position v] of [character v]) + (12)) / (24))) * (24)) - (12))>>> or <<<(CloneDir) = [90]> and <<((round (([y position v] of [character v]) / (24))) * (24)) = ((round ((CloneY) / (24))) * (24))> and <(CloneX) < ([x position v] of [character v])>>> or <<(CloneDir) = [-90]> and <<((round (([y position v] of [character v]) / (24))) * (24)) = ((round ((CloneY) / (24))) * (24))> and <(CloneX) > ([x position v] of [character v])>>>>>>>> then\n                if <(SFX ON/OFF) = [ON]> then\n                    start sound (pick random (1) to (2))\n                end\n                set [cannon animation v] to [-1.8]\n                repeat (2)\n                    move (Cannon Animation) steps\n                end\n                set [clone mode v] to [Laser Beam]\n                create clone of (_myself_ v)\n                repeat (2)\n                    change [cannon animation v] by (2.4)\n                    move (Cannon Animation) steps\n                end\n                wait ((round (((5) / ((Cannon Fire Rate) + (1))) * (100))) / (100)) seconds\n            end\n        end\n    end\n    if <<(Clone Mode) = [Laser Beam]> and <not <(PLAY) = [0]>>> then\n        if <not <(costume [number v]) = [26]>> then\n            switch costume to (laser beam v)\n        end\n        if <not <(join (CloneX) (CloneY)) = (join (x position) (y position))>> then\n            go to x: (CloneX) y: (CloneY)\n        end\n        show\n        set [<collision?> v] to [0]\n        repeat (((24) / (Cannon Fire Rate)) + (1))\n            if <not <(PAUSE) > [0]>> then\n                move ((Cannon Fire Rate) * (1.5)) steps\n                if <<touching (character v)?> and <(RESTART) = [0]>> then\n                    if <(SFX ON/OFF) = [ON]> then\n                        start sound (pick random (6) to (7))\n                    end\n                    set [restart v] to [1]\n                end\n            end\n        end\n        if <not <<(PLAY) = [0]> or <(<Collision?>) = [1]>>> then\n            repeat until <<(PLAY) = [0]> or <(<Collision?>) = [1]>>\n                if <not <(PAUSE) > [0]>> then\n                    move ((Cannon Fire Rate) * (1.5)) steps\n                    if <<touching (character v)?> and <(RESTART) = [0]>> then\n                        if <(SFX ON/OFF) = [ON]> then\n                            start sound (pick random (6) to (7))\n                        end\n                        set [restart v] to [1]\n                    end\n                    Check Collision\n                end\n            end\n        end\n        if <<(<Collision?>) = [1]> and <(SFX ON/OFF) = [ON]>> then\n            start sound (pick random (3) to (4))\n        end\n    end\nelse\n    delete this clone\nend\nchange [test1 v] by (-1)\ndelete this clone\n\ndefine Open all [] doors\nif <not <(costume [number v]) = [25]>> then\n    switch costume to (erasor v)\nend\nset [c1 v] to [0]\nrepeat (length of [costume v])\n    change [c1 v] by (1)\n    if <(item (C1) of [costume v]) = (index)> then\n        go to x: (item (C1) of [blocks-x v]) y: (item (C1) of [blocks-y v])\n        stamp\n    end\nend\nhide\n\ndefine Draw Clone Blocks\nset [c1 v] to [0]\nrepeat (length of [costume v])\n    change [c1 v] by (1)\n    if <(item (C1) of [costume v]) = [O]> then\n        go to x: (item (C1) of [blocks-x v]) y: (item (C1) of [blocks-y v])\n        if <not <(costume [number v]) = [15]>> then\n            switch costume to (blue door v)\n        end\n        stamp\n    end\n    if <(item (C1) of [costume v]) = [P]> then\n        go to x: (item (C1) of [blocks-x v]) y: (item (C1) of [blocks-y v])\n        if <not <(costume [number v]) = [16]>> then\n            switch costume to (green door v)\n        end\n        stamp\n    end\n    if <(item (C1) of [costume v]) = [Q]> then\n        go to x: (item (C1) of [blocks-x v]) y: (item (C1) of [blocks-y v])\n        if <not <(costume [number v]) = [17]>> then\n            switch costume to (red door v)\n        end\n        stamp\n    end\n    if <(item (C1) of [costume v]) = [R]> then\n        go to x: (item (C1) of [blocks-x v]) y: (item (C1) of [blocks-y v])\n        if <not <(costume [number v]) = [18]>> then\n            switch costume to (yellow door v)\n        end\n        stamp\n    end\nend\nhide\n\nwhen I receive [build level v]\nclear graphic effects\nerase all\nif <(#LEVEL) < (length of [levels v])> then\n    broadcast (Stamp Background v) and wait\n    Build Level with size: (100) at X: (0) Y: (0)\nend\n\nwhen I receive [play v]\nhide\ndelete (all) of [doors open/close v]\nrepeat (4)\n    add [N/A] to [doors open/close v]\nend\nrepeat until <(Win) = [1]>\n    if <<not <[doors open/close v] contains (join (<CharacterCollision>) [: Open])?>> and <<(<CharacterCollision>) = [Blue]> or <<(<CharacterCollision>) = [Green]> or <<(<CharacterCollision>) = [Red]> or <(<CharacterCollision>) = [Yellow]>>>>> then\n        if <(SFX ON/OFF) = [ON]> then\n            start sound [Unlock Door v]\n        end\n        if <(<CharacterCollision>) = [Blue]> then\n            Open all [O] doors\n            replace item (1) of [doors open/close v] with (join [Blue: ] [Open])\n        else\n            if <(<CharacterCollision>) = [Green]> then\n                Open all [P] doors\n                replace item (2) of [doors open/close v] with (join [Green: ] [Open])\n            else\n                if <(<CharacterCollision>) = [Red]> then\n                    Open all [Q] doors\n                    replace item (3) of [doors open/close v] with (join [Red: ] [Open])\n                else\n                    if <(<CharacterCollision>) = [Yellow]> then\n                        Open all [R] doors\n                        replace item (4) of [doors open/close v] with (join [Yellow: ] [Open])\n                    end\n                end\n            end\n        end\n    end\n    if <<<<<key (r v) pressed?> or <(RESTART) = [1]>> and <(Reset doors on restart 1/0) = [1]>> or <<(RESTART) = [1]> and <([disable v] of [character v]) = [3]>>> and <<[doors open/close v] contains (join [Blue:] [ Open])?> or <<[doors open/close v] contains (join [Green:] [ Open])?> or <<[doors open/close v] contains (join [Red:] [ Open])?> or <[doors open/close v] contains (join [Yellow:] [ Open])?>>>>> then\n        Draw Clone Blocks\n        set [restart v] to [0]\n        replace item (1) of [doors open/close v] with (join [Blue: ] [Close])\n        replace item (2) of [doors open/close v] with (join [Green: ] [Close])\n        replace item (3) of [doors open/close v] with (join [Red: ] [Close])\n        replace item (4) of [doors open/close v] with (join [Yellow: ] [Close])\n    end\nend\ndelete (all) of [doors open/close v]\nrepeat (4)\n    add [N/A] to [doors open/close v]\nend\n\n@Save/Load engine\n\nwhen I receive [import level v]\nLoad Level from (item (#LEVEL) of [levels v])\n\ndefine Load Level from []\nif <<(letter (1) of (code)) = [{]> and <(letter (length of (code)) of (code)) = [}]>> then\n    set [c1 v] to (length of (code))\n    repeat (length of (code))\n        change [c1 v] by (-1)\n        if <(letter (C1) of (code)) = [:]> then\n            set [v1 v] to [H]\n        end\n        if <(letter (C1) of (code)) = [;]> then\n            set [v1 v] to [V]\n        end\n    end\n    delete (all) of [placed blocks x/y v]\n    delete (all) of [blocks-x v]\n    delete (all) of [blocks-y v]\n    delete (all) of [costume v]\n    delete (all) of [teleportals v]\n    delete (all) of [teleportal order v]\n    if <(V1) = [H]> then\n        delete (all) of [character start x/y v]\n        set [c1 v] to [2]\n        if <(letter (2) of (code)) = [D]> then\n            add [-12] to [character start x/y v]\n            add [0] to [character start x/y v]\n        else\n            set [v1 v] to []\n            repeat (letter (2) of (code))\n                change [c1 v] by (1)\n                set [v1 v] to (join (V1) (letter (C1) of (code)))\n            end\n            add (item (V1) of [all x v]) to [character start x/y v]\n            add (item (V1) of [all y v]) to [character start x/y v]\n        end\n        change [c1 v] by (1)\n        set [save checkpoint gravity 1/0 v] to (letter (1) of (item (letter (C1) of (code)) of [level settings combinations v]))\n        set [reset doors on restart 1/0 v] to (letter (2) of (item (letter (C1) of (code)) of [level settings combinations v]))\n        set [defeat-able enemies 1/0 v] to (letter (3) of (item (letter (C1) of (code)) of [level settings combinations v]))\n        change [c1 v] by (1)\n        set [cannon fire rate v] to (letter (C1) of (code))\n        change [c1 v] by (1)\n        set [enemy speed v] to (letter (C1) of (code))\n        change [c1 v] by (1)\n        set [#background v] to (letter (C1) of (code))\n        set [c2 v] to [0]\n        repeat until <(letter ((C1) + (1)) of (code)) = [:]>\n            change [c1 v] by (1)\n            if <((letter (C1) of (code)) / (1)) = (letter (C1) of (code))> then\n                set [v1 v] to (letter (C1) of (code))\n                repeat until <not <((letter ((C1) + (1)) of (code)) / (1)) = (letter ((C1) + (1)) of (code))>>\n                    change [c1 v] by (1)\n                    set [v1 v] to (join (V1) (letter (C1) of (code)))\n                end\n                change [c1 v] by (1)\n                repeat (V1)\n                    change [c2 v] by (1)\n                    if <not <(letter (C1) of (code)) = [.]>> then\n                        add (item (C2) of [all x/y v]) to [placed blocks x/y v]\n                        add (item (C2) of [all x v]) to [blocks-x v]\n                        add (item (C2) of [all y v]) to [blocks-y v]\n                        add (letter (C1) of (code)) to [costume v]\n                        if <(letter (C1) of (code)) = [L]> then\n                            add (item (C2) of [all x v]) to [teleportal order v]\n                            add (item (C2) of [all y v]) to [teleportal order v]\n                        end\n                    end\n                end\n            else\n                change [c2 v] by (1)\n                if <not <(letter (C1) of (code)) = [.]>> then\n                    add (item (C2) of [all x/y v]) to [placed blocks x/y v]\n                    add (item (C2) of [all x v]) to [blocks-x v]\n                    add (item (C2) of [all y v]) to [blocks-y v]\n                    add (letter (C1) of (code)) to [costume v]\n                    if <(letter (C1) of (code)) = [L]> then\n                        add (item (C2) of [all x v]) to [teleportal order v]\n                        add (item (C2) of [all y v]) to [teleportal order v]\n                    end\n                end\n            end\n        end\n    else\n        delete (all) of [character start x/y v]\n        set [c1 v] to [2]\n        if <(letter (2) of (code)) = [D]> then\n            add [-12] to [character start x/y v]\n            add [0] to [character start x/y v]\n        else\n            set [v1 v] to []\n            repeat (letter (2) of (code))\n                change [c1 v] by (1)\n                set [v1 v] to (join (V1) (letter (C1) of (code)))\n            end\n            add (item (V1) of [all x \(vertical\) v]) to [character start x/y v]\n            add (item (V1) of [all y \(vertical\) v]) to [character start x/y v]\n        end\n        change [c1 v] by (1)\n        set [save checkpoint gravity 1/0 v] to (letter (1) of (item (letter (C1) of (code)) of [level settings combinations v]))\n        set [reset doors on restart 1/0 v] to (letter (2) of (item (letter (C1) of (code)) of [level settings combinations v]))\n        set [defeat-able enemies 1/0 v] to (letter (3) of (item (letter (C1) of (code)) of [level settings combinations v]))\n        change [c1 v] by (1)\n        set [cannon fire rate v] to (letter (C1) of (code))\n        change [c1 v] by (1)\n        set [enemy speed v] to (letter (C1) of (code))\n        change [c1 v] by (1)\n        set [#background v] to (letter (C1) of (code))\n        set [c2 v] to [0]\n        repeat until <(letter ((C1) + (1)) of (code)) = [;]>\n            change [c1 v] by (1)\n            if <((letter (C1) of (code)) / (1)) = (letter (C1) of (code))> then\n                set [v1 v] to (letter (C1) of (code))\n                repeat until <not <((letter ((C1) + (1)) of (code)) / (1)) = (letter ((C1) + (1)) of (code))>>\n                    change [c1 v] by (1)\n                    set [v1 v] to (join (V1) (letter (C1) of (code)))\n                end\n                change [c1 v] by (1)\n                repeat (V1)\n                    change [c2 v] by (1)\n                    if <not <(letter (C1) of (code)) = [.]>> then\n                        add (item (C2) of [all x/y \(vertical\) v]) to [placed blocks x/y v]\n                        add (item (C2) of [all x \(vertical\) v]) to [blocks-x v]\n                        add (item (C2) of [all y \(vertical\) v]) to [blocks-y v]\n                        add (letter (C1) of (code)) to [costume v]\n                        if <(letter (C1) of (code)) = [L]> then\n                            add (item (C2) of [all x \(vertical\) v]) to [teleportal order v]\n                            add (item (C2) of [all y \(vertical\) v]) to [teleportal order v]\n                        end\n                    end\n                end\n            else\n                change [c2 v] by (1)\n                if <not <(letter (C1) of (code)) = [.]>> then\n                    add (item (C2) of [all x/y \(vertical\) v]) to [placed blocks x/y v]\n                    add (item (C2) of [all x \(vertical\) v]) to [blocks-x v]\n                    add (item (C2) of [all y \(vertical\) v]) to [blocks-y v]\n                    add (letter (C1) of (code)) to [costume v]\n                    if <(letter (C1) of (code)) = [L]> then\n                        add (item (C2) of [all x \(vertical\) v]) to [teleportal order v]\n                        add (item (C2) of [all y \(vertical\) v]) to [teleportal order v]\n                    end\n                end\n            end\n        end\n    end\n    if <(length of [teleportal order v]) > [0]> then\n        delete (all) of [teleportals v]\n        repeat (length of [teleportal order v])\n            add [N/A] to [teleportals v]\n        end\n        set [c2 v] to [0]\n        repeat ((length of [teleportal order v]) / (2))\n            change [c1 v] by (2)\n            change [c2 v] by (2)\n            if <(letter (C1) of (code)) = [1]> then\n                replace item (((2) * (letter ((C1) + (1)) of (code))) - (1)) of [teleportals v] with (item ((C2) - (1)) of [teleportal order v])\n                replace item ((2) * (letter ((C1) + (1)) of (code))) of [teleportals v] with (item (C2) of [teleportal order v])\n            else\n                if <(letter (C1) of (code)) = [2]> then\n                    replace item (((2) * (((letter ((C1) + (1)) of (code)) * (10)) + (letter ((C1) + (2)) of (code)))) - (1)) of [teleportals v] with (item ((C2) - (1)) of [teleportal order v])\n                    replace item ((2) * (((letter ((C1) + (1)) of (code)) * (10)) + (letter ((C1) + (2)) of (code)))) of [teleportals v] with (item (C2) of [teleportal order v])\n                    change [c1 v] by (1)\n                else\n                    if <(letter (C1) of (code)) = [3]> then\n                        replace item (((2) * (((letter ((C1) + (1)) of (code)) * (100)) + (((letter ((C1) + (2)) of (code)) * (10)) + (letter ((C1) + (3)) of (code))))) - (1)) of [teleportals v] with (item ((C2) - (1)) of [teleportal order v])\n                        replace item ((2) * (((letter ((C1) + (1)) of (code)) * (100)) + (((letter ((C1) + (2)) of (code)) * (10)) + (letter ((C1) + (3)) of (code))))) of [teleportals v] with (item (C2) of [teleportal order v])\n                        change [c1 v] by (2)\n                    end\n                end\n            end\n        end\n    end\nelse\nend\n\n@Fader\n\nwhen I receive [fade v]\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\ngo to [front v] layer\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nset [play v] to [0]\nwait (1) seconds\nbroadcast (Next Level v)\nwait (1.5) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nclear graphic effects\nset [play v] to [1]\n\nwhen I receive [main menu v]\nhide\n\n@Level Name\n\nwhen I receive [fade v]\nwait (0.25) seconds\nhide\ngo to x: (0) y: (-138)\npoint in direction (90)\nset size to (10) %\ngo to [front v] layer\nif <(#LEVEL) = [0]> then\n    switch costume to (klädsel1 v)\nelse\n    switch costume to ((#LEVEL) + (1))\nend\nshow\nset [acc v] to [8]\nrepeat (10)\n    set [acc v] to ((acc) * (1.05))\n    change size by (acc)\n    change y by (acc)\nend\nrepeat (10)\n    set [acc v] to ((acc) * (0.8))\n    change size by (acc)\n    change y by ((acc) * (0.7))\nend\nwait (1) seconds\nrepeat (10)\n    set [acc v] to ((acc) * (1.5))\n    change size by ((0) - (acc))\n    change y by ((acc) * (-0.7))\nend\nhide\n\nwhen I receive [main menu v]\nhide\n\n@#Level\n\nwhen I receive [build level v]\nwait (1.5) seconds\nswitch costume to (#LEVEL)\ngo to [front v] layer\nshow\nrepeat until <(Win) = [1]>\n    if <<([x position v] of [character v]) < [-180]> and <([y position v] of [character v]) > [75]>> then\n        go to x: (220) y: (160)\n        set [ghost v] effect to ((440) - (distance to [character v]))\n    else\n        go to x: (-220) y: (160)\n        set [ghost v] effect to ((140) - (distance to [character v]))\n    end\nend\nif <(#LEVEL) < (length of [levels v])> then\n    wait (1.5) seconds\nend\nhide\n\nwhen flag clicked\nhide\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen [t v] key pressed\nif <(username) = [Yllie]> then\n    go to x: (0) y: (0)\n    go to [front v] layer\n    show\nend\n\nwhen [q v] key pressed\nif <<(username) = [Yllie]> and <key (z v) pressed?>> then\n    stop [all v]\nend\n\n@BSH1's Font Engine\n\ndefine Calculate Spacing! [do not use]\ndelete (all) of [spacing v]\nswitch costume to (case_sense v)\nadd [0] to [spacing v]\nrepeat (95)\n    next costume\n    go to x: (0) y: (0)\n    repeat until <touching (_edge_ v)?>\n        change x by (1)\n    end\n    add (((100) - (x position)) + (181)) to [spacing v]\nend\nadd [46] to [spacing v]\n\nwhen I start as a clone\nshow\nset [costume v] to (costume [number v])\nswitch costume to (o v)\nset size to (GS) %\nswitch costume to (costume)\n\ndefine None\nset [gs v] to (size)\nclear graphic effects\nif <black/white> then\n    set [brightness v] effect to (0)\nelse\n    set [brightness v] effect to (100)\nend\nset [ghost v] effect to (ghost)\nswitch costume to (o v)\nhide\nset size to (size) %\ngo to x: (x) y: (y)\nset [counter! v] to [0]\nrepeat (length of (text))\n    if <(x position) > ((240) - (((10) / (100)) * (size)))> then\n        set x to (x)\n        change y by (((-65) / (100)) * (size))\n    end\n    change [counter! v] by (1)\n    if <(letter (Counter!) of (text)) = [ ]> then\n        if <not <(x position) = (x)>> then\n            change x by (((50) / (100)) * (size))\n            Check Length [do not use] (text) (size) (x)\n        end\n    else\n        switch costume to (case_sense v)\n        switch costume to (letter (Counter!) of (text))\n        if <(costume [number v]) = [1]> then\n            switch costume to (join (letter (Counter!) of (text)) [2])\n        end\n        if <vector> then\n            create clone of (_myself_ v)\n        else\n            stamp\n        end\n        change x by (((item (costume [number v]) of [spacing v]) / (100)) * (size))\n        move (((5) / (100)) * (size)) steps\n    end\nend\nhide\n\nwhen I receive [you win v]\nset [time v] to ((timer) - (Total Pause Time))\nRender Text: (join [Time: ] (join (join ([floor v] of ((Time) / (60)) ) [min ]) (join (round ((((Time) / (60)) - ([floor v] of ((Time) / (60)) )) * (60))) [s]))) At [ (-195) (25) ] In font size (35) Ghost (0) Black/White <[1] = [1]> Vector? <[1] = [1]>\nRender Text: (join [Deaths: ] (#Deaths)) At [ (-195) (-5) ] In font size (35) Ghost (0) Black/White <[1] = [1]> Vector? <[1] = [1]>\nif <<(#Deaths) < (☁ Deaths)> and <(Time) < (☁ Time)>> then\n    set [☁ deaths v] to (#Deaths)\n    set [☁ time v] to (Time)\nend\nRender Text: (join [Time: ] (join (join ([floor v] of ((☁ Time) / (60)) ) [min ]) (join (round ((((☁ Time) / (60)) - ([floor v] of ((☁ Time) / (60)) )) * (60))) [s]))) At [ (40) (25) ] In font size (35) Ghost (0) Black/White <[1] = [1]> Vector? <[1] = [1]>\nRender Text: (join [Deaths: ] (☁ Deaths)) At [ (40) (-5) ] In font size (35) Ghost (0) Black/White <[1] = [1]> Vector? <[1] = [1]>\n\ndefine None\nset [gs v] to (size)\nclear graphic effects\nif <black/white> then\n    set [brightness v] effect to (0)\nelse\n    set [brightness v] effect to (100)\nend\nset [ghost v] effect to (ghost)\nswitch costume to (o v)\nhide\nset size to (size) %\ngo to x: (x) y: (y)\nset [counter! v] to [0]\nrepeat (length of (text))\n    if <(x position) > ((240) - (((10) / (100)) * (size)))> then\n        set x to (x)\n        change y by (((-65) / (100)) * (size))\n    end\n    change [counter! v] by (1)\n    if <(letter (Counter!) of (text)) = [ ]> then\n        if <not <(x position) = (x)>> then\n            change x by (((50) / (100)) * (size))\n            Check Length [do not use] (text) (size) (x)\n        end\n    else\n        switch costume to (case_sense v)\n        switch costume to (letter (Counter!) of (text))\n        if <(costume [number v]) = [1]> then\n            switch costume to (join (letter (Counter!) of (text)) [2])\n        end\n        if <vector> then\n            create clone of (_myself_ v)\n        else\n            stamp\n        end\n        change x by (((item (costume [number v]) of [spacing v]) / (100)) * (size))\n        move (((5) / (100)) * (size)) steps\n    end\nend\nhide\n\nwhen I receive [clear vector v]\ndelete this clone\n\ndefine Clear Vector\nbroadcast (Clear Vector v)\n\ndefine Paragraph!\nchange y by (((-100) / (100)) * (GS))\n\ndefine None\nset [counter2! v] to ((Counter!) + (1))\nset [temp length v] to [0]\nrepeat until <<(Counter2!) > (length of (text))> or <(letter (Counter2!) of (text)) = [ ]>>\n    switch costume to (case_sense v)\n    switch costume to (letter (Counter!) of (text))\n    if <(costume [number v]) = [1]> then\n        switch costume to (join (letter (Counter!) of (text)) [2])\n    end\n    change [temp length v] by (((item (costume [number v]) of [spacing v]) / (100)) * (size))\n    change [counter2! v] by (1)\nend\nif <((x position) + (Temp Length)) > ((240) - (((15) / (100)) * (size)))> then\n    set x to (x)\n    change y by (((-65) / (100)) * (size))\nend\n\nwhen I receive [start game v]\nClear Vector\n\nset [☁ deaths v] to [9999]\nset [☁ time v] to [9999]\n\n@Sprite1\n\nwhen I receive [start game v]\nhide\nrepeat until <(#LEVEL) = (length of [levels v])>\n    if <<<(Win) = [0]> and <(PLAY) = [1]>> and <(PAUSE) = [1]>> then\n        wait (0.1) seconds\n        go to [front v] layer\n        show\n        wait until <not <<<(Win) = [0]> and <(PLAY) = [1]>> and <(PAUSE) = [1]>>>\n        hide\n    else\n        hide\n    end\nend\nhide\n\n