Pen World || a Mobile Platformer #games #all

Instructions: Checkout Bubble Frenzy! https://scratch.mit.edu/projects/488284180\nWelcome to Pen World!\n99% pen platformer (including intro)\nArrow keys, WASD, or tap to move\nColors:\nRed = Lava\nBlue = Platforms\nYellow = Bounce\nGreen = Gravity switch\nPink = Win

@Stage\n\nwhen flag clicked\nset [☁ test v] to [1]\n\nwhen flag clicked\nwait (10.5) seconds\nset volume to (5) %\nforever\n    play sound [Vexento - Tevo v] until done\nend\n\n@Blank\n\n@Render\n\ndefine Render\ndelete all of [platform-type v]\ndelete all of [platform-height v]\ndelete all of [platform-length v]\ndelete all of [platform-x v]\ndelete all of [platform-y v]\nRender Grid\nPlatforms\nLava\nGravitiy\nBouncy\nWin\nDraw Player // Width: (Player width) X: (Player X) Y: (Player Y) Size: [10]\nbroadcast (tick v)\n\nwhen flag clicked\nwait (12) seconds\nbroadcast (Scripts v)\nbroadcast (reset v) and wait\nforever\n    Loop\n    if <(Dead) = [1]> then\n        stop [other scripts in sprite v]\n        broadcast (Scripts v)\n        broadcast (reset v) and wait\n    end\n    if <[1] = (win)> then\n        repeat until <<(round (item (item # of [w] in [platform-type v]) of [platform-x v])) = (round (Player X))> and <(round (item (item # of [w] in [platform-type v]) of [platform-y v])) = (round (Player Y))>>\n            change [player x v] by (((item (item # of [w] in [platform-type v]) of [platform-x v]) - (Player X)) / (5))\n            change [player y v] by (((item (item # of [w] in [platform-type v]) of [platform-y v]) - (Player Y)) / (5))\n            set [cam x v] to (Player X)\n            set [cam y v] to (Player Y)\n            change [player width v] by (-0.3)\n            erase all\n            Render\n        end\n        set [win text v] to [You Win!]\n        broadcast (win v) and wait\n        stop [this script v]\n    end\nend\n\ndefine Draw Player // Width: (width) X: (x) Y: (y) Size: (size)\nset pen color to (#ff6100)\nLine // X: ((x) - (width)) Y: ((y) + (width)) X2: ((x) + (width)) Y2: ((y) + (width)) Size: (size)\nLine // X: ((x) + (width)) Y: ((y) + (width)) X2: ((x) + (width)) Y2: ((y) - (width)) Size: (size)\nLine // X: ((x) + (width)) Y: ((y) - (width)) X2: ((x) - (width)) Y2: ((y) - (width)) Size: (size)\nLine // X: ((x) - (width)) Y: ((y) - (width)) X2: ((x) - (width)) Y2: ((y) + (width)) Size: (size)\n\ndefine Line // X: (x) Y: (y) X2: (x2) Y2: (y2) Size: (size)\nset pen size to (size)\npen up\ngo to x: ((x) - (Cam X)) y: ((y) - (Cam Y))\npen down\ngo to x: ((x2) - (Cam X)) y: ((y2) - (Cam Y))\npen up\n\ndefine Physics // Move Speed: (speed) Jump Height: (jump)\ngo to x: ((Player X) - (Cam X)) y: ((Player Y) - (Cam Y))\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<(mouse x) > ((x position) + (10))> and <mouse down?>>> then\n    change [xvel v] by (speed)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<(mouse x) < ((x position) - (10))> and <mouse down?>>> then\n    change [xvel v] by ((0) - (speed))\nend\nset [xvel v] to ((xvel) * (0.9))\nif <([abs v] of (xvel) ) > [0.9]> then\n    Change X // Change: (round (xvel))\nend\nchange [yvel v] by (-2)\nif <(in air) < [6]> then\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<(mouse y) > (x position)> and <mouse down?>>> then\n        set [yvel v] to (jump)\n    end\nend\nif <[collisions v] contains [b]?> then\n    set [yvel v] to [30]\nend\nChange Y // Change: (yvel)\nif <<<[collisions v] contains [l]?> or <(Player Y) < [-300]>> or <(Player Y) > [800]>> then\n    set [dead v] to [1]\nend\nchange [cam x v] by (((Player X) - (Cam X)) / (5))\nchange [cam y v] by (((Player Y) - (Cam Y)) / (5))\nCollisions // Width: (Collision Width)\nif <[collisions v] contains [w]?> then\n    set [win v] to [1]\nend\n\ndefine Change X // Change: (change)\nchange [player x v] by (change)\nCollisions // Width: (Collision Width)\nif <[collisions v] contains [p]?> then\n    repeat (8)\n        change [player y v] by (1)\n        Collisions // Width: (Collision Width)\n        if <not <[collisions v] contains [p]?>> then\n            stop [this script v]\n        end\n    end\n    change [player y v] by (-8)\n    repeat until <not <[collisions v] contains [p]?>>\n        Collisions // Width: (Collision Width)\n        if <(change) > [0]> then\n            change [player x v] by (-1)\n        else\n            change [player x v] by (1)\n        end\n    end\nend\n\nwhen I receive [reset v]\nReset\n\ndefine Render Grid\nset pen color to (#191919)\nset pen size to (10)\ngo to x: (((-240) - (((Cam X) * (0.5)) mod (Grid Length))) + (() mod (Grid Length))) y: (-180)\nrepeat (13)\n    pen down\n    set y to (180)\n    pen up\n    change x by (40)\n    set y to (-180)\nend\ngo to x: (-240) y: (((-180) - (((Cam Y) * (0.5)) mod (Grid Length))) + (() mod (Grid Length)))\nrepeat (10)\n    pen down\n    set x to (240)\n    pen up\n    change y by (40)\n    set x to (-240)\nend\n\ndefine Draw Platform // X: (x) Y: (y) Length: (length) Height: (height)\nadd (x) to [platform-x v]\nadd (y) to [platform-y v]\nadd ([abs v] of (length) ) to [platform-length v]\nadd ([abs v] of (height) ) to [platform-height v]\nadd [p] to [platform-type v]\nset pen color to (#0050ff)\nset pen (brightness v) to (60)\nLine // X: ((x) - (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) + (height)) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + (height)) Size: (Size 2)\nset pen color to (#0050ff)\nLine // X: ((x) - (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) + (height)) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + (height)) Size: (Size 1)\n\ndefine Platforms\nDraw Platform // X: [2] Y: [-40] Length: ((3) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Platform // X: [394] Y: [-40] Length: ((2) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Platform // X: [606] Y: [60] Length: (((1) * (Grid Length)) / (2)) Height: ((3.5) * (Grid Length))\nDraw Platform // X: [706] Y: [430] Length: ((3) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Platform // X: [1130] Y: [430] Length: ((3) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Platform // X: [1400] Y: [100] Length: ((3) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Platform // X: [1792] Y: [100] Length: ((2) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Platform // X: [2070] Y: [200] Length: ((2) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [2185] Y: [400] Length: ((5) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [2800] Y: [400] Length: ((5) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [2680] Y: [200] Length: ((2) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [3000] Y: [200] Length: ((2) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [3200] Y: [500] Length: ((2) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Platform // X: [3550] Y: [580] Length: ((1) * (Grid Length)) Height: ((3) * (Grid Length))\nDraw Platform // X: [3700] Y: [380] Length: ((2.5) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Platform // X: [4100] Y: [560] Length: ((7) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [4000] Y: [700] Length: ((7) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [4500] Y: [400] Length: ((1) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [4500] Y: [700] Length: ((1) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [4700] Y: [300] Length: ((1) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [5105] Y: [300] Length: ((1) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [5305] Y: [300] Length: ((1) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [5510] Y: [500] Length: ((6) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [6000] Y: [500] Length: ((2) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [-170] Y: [95] Length: [40] Height: [180]\nDraw Platform // X: [3550] Y: [850] Length: [150] Height: [25]\nDraw Platform // X: [3710] Y: [750] Length: [] Height: [70]\nDraw Platform // X: [4000] Y: [400] Length: [155] Height: [20]\nDraw Platform // X: [4500] Y: [810] Length: [120] Height: [15]\nDraw Platform // X: [3200] Y: [300] Length: [10] Height: [120]\nDraw Platform // X: [2490] Y: [530] Length: [130] Height: [20]\n\ndefine Change Y // Change: (change)\nif <(Reverse?) = [0]> then\n    change [player y v] by (change)\nelse\n    change [player y v] by ((0) - (change))\nend\nchange [in air v] by (1)\nCollisions // Width: (Collision Width)\nrepeat until <not <[collisions v] contains [p]?>>\n    Collisions // Width: (Collision Width)\n    set [yvel v] to [0]\n    if <(Reverse?) = [1]> then\n        if <((0) - (change)) > [0]> then\n            change [player y v] by (-1)\n            set [in air v] to [0]\n        else\n            change [player y v] by (1)\n        end\n    else\n        if <(change) > [0]> then\n            change [player y v] by (-1)\n        else\n            change [player y v] by (1)\n            set [in air v] to [0]\n        end\n    end\nend\n\ndefine Collisions // Width: (width)\ndelete all of [collisions v]\nset [i v] to [0]\nrepeat (length of [platform-x v])\n    change [i v] by (1)\n    if <not <(Player X) > (((item (i) of [platform-x v]) + (item (i) of [platform-length v])) + (width))>> then\n        if <not <(Player Y) > (((item (i) of [platform-y v]) + (item (i) of [platform-height v])) + (width))>> then\n            if <not <(Player X) < (((item (i) of [platform-x v]) - (item (i) of [platform-length v])) - (width))>> then\n                if <not <(Player Y) < (((item (i) of [platform-y v]) - (item (i) of [platform-height v])) - (width))>> then\n                    add (item (i) of [platform-type v]) to [collisions v]\n                end\n            end\n        end\n    end\nend\n\ndefine Loop\nerase all\nRender\nPhysics // Move Speed: [1.5] Jump Height: [16]\n\ndefine Draw Bounce // X: (x) Y: (y) Length: (length) Height: (height)\nadd (x) to [platform-x v]\nadd (y) to [platform-y v]\nadd ([abs v] of (length) ) to [platform-length v]\nadd ([abs v] of (height) ) to [platform-height v]\nadd [b] to [platform-type v]\nset pen color to (#ffdd00)\nset pen (brightness v) to (80)\nLine // X: ((x) - (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) + (height)) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + (height)) Size: (Size 2)\nset pen color to (#ffdc00)\nLine // X: ((x) - (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) + (height)) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + (height)) Size: (Size 1)\n\ndefine Draw Lava // X: (x) Y: (y) Length: (length) Height: (height)\nadd (x) to [platform-x v]\nadd (y) to [platform-y v]\nadd ([abs v] of (length) ) to [platform-length v]\nadd (([abs v] of (height) ) + ((0) - (pen tick))) to [platform-height v]\nadd [l] to [platform-type v]\nset pen color to (#ff0000)\nset pen (brightness v) to (60)\nLine // X: ((x) - (length)) Y: ((y) + ((height) + ((0) - (pen tick)))) X2: ((x) + (length)) Y2: ((y) + ((height) + ((0) - (pen tick)))) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) + ((height) + ((0) - (pen tick)))) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + ((height) + ((0) - (pen tick)))) Size: (Size 2)\nset pen color to (#ff0000)\nLine // X: ((x) - (length)) Y: ((y) + ((height) + ((0) - (pen tick)))) X2: ((x) + (length)) Y2: ((y) + ((height) + ((0) - (pen tick)))) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) + ((height) + ((0) - (pen tick)))) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + ((height) + ((0) - (pen tick)))) Size: (Size 1)\n\nwhen I receive [scripts v]\nforever\n    change [pen tick v] by (1)\n    if <(pen tick) > [20]> then\n        repeat until <(pen tick) < [1]>\n            change [pen tick v] by (-1)\n        end\n    end\nend\n\nwhen I receive [scripts v]\nforever\n    set [reverse? v] to [0]\n    wait until <not <[collisions v] contains [r]?>>\n    wait until <[collisions v] contains [r]?>\n    set [reverse? v] to [1]\n    wait until <not <[collisions v] contains [r]?>>\n    wait until <[collisions v] contains [r]?>\n    set [reverse? v] to [0]\nend\n\ndefine Draw Gravity Switch // X: (x) Y: (y) Length: (length) Height: (height)\nadd (x) to [platform-x v]\nadd (y) to [platform-y v]\nadd (length) to [platform-length v]\nadd (height) to [platform-height v]\nadd [r] to [platform-type v]\nset pen color to (#2aff00)\nset pen (brightness v) to (60)\nLine // X: ((x) - (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) + (height)) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + (height)) Size: (Size 2)\nset pen color to (#2aff00)\nLine // X: ((x) - (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) + (height)) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + (height)) Size: (Size 1)\n\ndefine Lava\nDraw Lava // X: [218] Y: [-40] Length: ((2) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Lava // X: [1616] Y: [100] Length: ((2) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Lava // X: [1930] Y: [100] Length: ((1) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Lava // X: [2900] Y: [475] Length: ((1.2) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Lava // X: [2900] Y: [475] Length: ((1.2) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Lava // X: [3345] Y: [500] Length: ((1.2) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Lava // X: [4000] Y: [605] Length: ((0.1) * (Grid Length)) Height: ((0.3) * (Grid Length))\nDraw Lava // X: [4150] Y: [605] Length: ((0.1) * (Grid Length)) Height: ((0.3) * (Grid Length))\nDraw Lava // X: [4575] Y: [400] Length: ((0.5) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Lava // X: [4990] Y: [307] Length: ((1.5) * (Grid Length)) Height: ((0.7) * (Grid Length))\n\ndefine Gravitiy\nDraw Gravity Switch // X: [682] Y: [160] Length: ((01) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Gravity Switch // X: [1306] Y: [430] Length: ((01) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Gravity Switch // X: [2110] Y: [250] Length: ((01) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Gravity Switch // X: [2700] Y: [350] Length: ((01) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Gravity Switch // X: [3750] Y: [450] Length: ((01) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Gravity Switch // X: [4100] Y: [505] Length: ((6) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Gravity Switch // X: [3820] Y: [650] Length: ((1.5) * (Grid Length)) Height: ((0.4) * (Grid Length))\nDraw Gravity Switch // X: [5600] Y: [200] Length: ((1.5) * (Grid Length)) Height: ((0.4) * (Grid Length))\nDraw Gravity Switch // X: [4500] Y: [600] Length: [75] Height: [20]\n\ndefine Reset\ndelete all of [platform-type v]\ndelete all of [platform-height v]\ndelete all of [platform-length v]\ndelete all of [platform-x v]\ndelete all of [platform-y v]\ndelete all of [collisions v]\nset [reverse? v] to [0]\nset [dead v] to [0]\nset [collision width v] to [23]\nset [grid length v] to [40]\nset [cam x v] to [0]\nset [cam y v] to [0]\nset [player x v] to [0]\nset [player y v] to [50]\nset [xvel v] to [0]\nset [yvel v] to [0]\nset [player width v] to [15]\nset [win v] to [0]\n\ndefine Bouncy\nDraw Bounce // X: [530] Y: [-20] Length: ((1) * (Grid Length)) Height: (((1) * (Grid Length)) / (2))\nDraw Bounce // X: [2320] Y: [345] Length: ((1) * (Grid Length)) Height: (((1) * (Grid Length)) / (2))\nDraw Bounce // X: [3135] Y: [200] Length: ((1) * (Grid Length)) Height: (((1) * (Grid Length)) / (2))\nDraw Bounce // X: [3450] Y: [480] Length: ((1) * (Grid Length)) Height: (((1) * (Grid Length)) / (2))\nDraw Bounce // X: [4835] Y: [300] Length: ((2) * (Grid Length)) Height: (((1) * (Grid Length)) / (2))\n\ndefine Win\nDraw Win // X: [6000] Y: [400] Length: ((0.5) * (Grid Length)) Height: ((0.5) * (Grid Length))\n\ndefine Draw Win // X: (x) Y: (y) Length: (length) Height: (height)\nadd (x) to [platform-x v]\nadd (y) to [platform-y v]\nadd ([abs v] of (length) ) to [platform-length v]\nadd ([abs v] of (height) ) to [platform-height v]\nadd [w] to [platform-type v]\nset pen color to (#ff00e9)\nset pen (brightness v) to (60)\nLine // X: ((x) - (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) + (height)) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + (height)) Size: (Size 2)\nset pen color to (#ff00e7)\nLine // X: ((x) - (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) + (height)) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + (height)) Size: (Size 1)\n\nwhen [timer v] > (0.01)\nerase all\nset [player x v] to [0]\nset [player y v] to [25]\nset [cam x v] to [0]\nset [cam y v] to [40]\nset [player width v] to [15]\nRender Grid\nPlatforms\nLava\nGravitiy\nBouncy\nWin\nDraw Player // Width: (Player width) X: (Player X) Y: (Player Y) Size: [10]\nbroadcast (tn v)\n\nwhen I receive [scripts v]\nforever\n    reset timer\nend\n\n@TextEngine\n\ndefine _calcWW (text) (width) (firstwidth) (cspace) (spacewidth)\ndelete all of [_ww0 v]\ndelete all of [_ww1 v]\ndelete all of [_ww2 v]\nset [_i3 v] to [1]\nset [_i4 v] to [0]\nset [_i5 v] to [0]\nset [_i6 v] to [0]\nset [_i7 v] to (firstwidth)\nrepeat (length of (text))\n    if <(letter (_i3) of (text)) = [ ]> then\n        if <(_i4) = [0]> then\n            if <((_i7) + ((_i5) - (cspace))) > (width)> then\n                insert [1] at (1) of [_ww0 v] \n                add [0] to [_ww1 v]\n                add [0] to [_ww2 v]\n                set [_i6 v] to [1]\n            end\n            change [_i7 v] by ((_i5) - (cspace))\n        else\n            if <((_i7) + ((spacewidth) + (_i5))) > (width)> then\n                if <(_i4) > (_i6)> then\n                    add (_i7) to [_ww1 v]\n                    add (((_i4) - (_i6)) - (1)) to [_ww2 v]\n                end\n                set [_i6 v] to (_i4)\n                set [_i7 v] to ((_i5) - (cspace))\n            else\n                change [_i7 v] by ((spacewidth) + (_i5))\n            end\n        end\n        add [1] to [_ww0 v]\n        set [_i4 v] to (length of [_ww0 v])\n        set [_i5 v] to [0]\n    else\n        switch costume to (blank v)\n        switch costume to (join (letter (_i3) of (text)) [_])\n        set [_i9 v] to ((costume [number v]) - (1))\n        if <(_i9) > [0]> then\n            set [_i8 v] to (item (_i9) of [_chwidth v])\n            if <((_i5) + (_i8)) > (width)> then\n                if <(_i4) > (_i6)> then\n                    add (_i7) to [_ww1 v]\n                    add (((_i4) - (_i6)) - (1)) to [_ww2 v]\n                end\n                add ((_i5) - (cspace)) to [_ww1 v]\n                add ((length of [_ww0 v]) - (_i4)) to [_ww2 v]\n                add [1] to [_ww0 v]\n                set [_i4 v] to (length of [_ww0 v])\n                set [_i5 v] to ((_i8) + (cspace))\n                set [_i6 v] to (_i4)\n                set [_i7 v] to ((-1) * ((cspace) + (spacewidth)))\n            else\n                change [_i5 v] by ((_i8) + (cspace))\n            end\n            add (_i9) to [_ww0 v]\n        end\n    end\n    change [_i3 v] by (1)\nend\nif <(length of [_ww0 v]) > (_i6)> then\n    if <(_i4) = [0]> then\n        if <((_i7) + ((_i5) - (cspace))) > (width)> then\n            insert [1] at (1) of [_ww0 v] \n            add [0] to [_ww1 v]\n            add [0] to [_ww2 v]\n            set [_i6 v] to [1]\n        end\n        change [_i7 v] by ((_i5) - (cspace))\n    else\n        if <((_i7) + ((spacewidth) + (_i5))) > (width)> then\n            if <(_i4) > (_i6)> then\n                add (_i7) to [_ww1 v]\n                add (((_i4) - (_i6)) - (1)) to [_ww2 v]\n            end\n            set [_i6 v] to (_i4)\n            set [_i7 v] to ((_i5) - (cspace))\n        else\n            change [_i7 v] by ((spacewidth) + (_i5))\n        end\n    end\n    add (_i7) to [_ww1 v]\n    add ((length of [_ww0 v]) - (_i6)) to [_ww2 v]\nend\n\nwhen flag clicked\nwait (12) seconds\npen up\nhide\nswitch costume to (blank v)\nset size to (100000) %\nswitch costume to ( _ v)\ngo to x: (0) y: (0)\npoint in direction (90)\nset rotation style [don't rotate v]\n\ndefine Clear | Character Data\nswitch costume to (blank v)\nswitch costume to ((costume [number v]) - (1))\nif <((costume [number v]) - (1)) > (length of [_chindex v])> then\n    set [_i0 v] to ((costume [number v]) - (1))\nelse\n    set [_i0 v] to (length of [_chindex v])\nend\ndelete all of [_chindex v]\ndelete all of [_chwidth v]\ndelete all of [_chdata0 v]\ndelete all of [_chdata1 v]\ndelete all of [_chdata2 v]\ndelete all of [_chdata3 v]\nrepeat (_i0)\n    add [__] to [_chdata0 v]\n    add [none] to [_chdata1 v]\n    add [] to [_chdata2 v]\n    add [] to [_chdata3 v]\n    add ((length of [_chdata0 v]) + (1)) to [_chindex v]\n    add ((1) * (0)) to [_chwidth v]\n    repeat (25)\n        add [] to [_chdata0 v]\n        add [] to [_chdata1 v]\n        add [] to [_chdata2 v]\n        add [] to [_chdata3 v]\n    end\nend\nadd [__] to [_chdata0 v]\nadd [none] to [_chdata1 v]\nadd [] to [_chdata2 v]\nadd [] to [_chdata3 v]\n\ndefine Load | Font (fontname)\nset [_i0 v] to (item # of (fontname) in [_fontname v])\nif <(_i0) < [1]> then\n    stop [this script v]\nend\nset [_i0 v] to (item (_i0) of [_fontindex v])\nset [_i1 v] to (item (_i0) of [_fontdata v])\nchange [_i0 v] by (2)\nrepeat (item ((_i0) - (1)) of [_fontdata v])\n    set [_i2 v] to (item (_i0) of [_fontdata v])\n    replace item (_i2) of [_chwidth v] with (item ((_i0) + (1)) of [_fontdata v])\n    set [_i3 v] to (item (_i2) of [_chindex v])\n    if <not <(item ((_i3) - (1)) of [_chdata1 v]) = (_i1)>> then\n        replace item ((_i3) - (1)) of [_chdata1 v] with (_i1)\n        replace item ((_i3) - (1)) of [_chdata2 v] with []\n        replace item ((_i3) - (1)) of [_chdata3 v] with []\n        _unpackDef (_i2) (_i3) (item ((_i0) + (2)) of [_fontdata v])\n    end\n    change [_i0 v] by (3)\nend\n\ndefine Set Pen Color | RGBA (r) (g) (b) (a)\nset pen color to ((round (b)) + ((256) * ((round (g)) + ((256) * ((round (r)) + ((256) * (round (a))))))))\n\ndefine _unpackDef (id) (idx) (d)\nset [_i5 v] to (length of (d))\nset [_i6 v] to (idx)\nset [_i7 v] to [1]\nset [_i8 v] to [0]\nrepeat until <(_i7) > (_i5)>\n    if <(item (_i6) of [_chdata0 v]) = [__]> then\n        insert [] at (_i6) of [_chdata0 v] \n        insert [] at (_i6) of [_chdata1 v] \n        insert [] at (_i6) of [_chdata2 v] \n        insert [] at (_i6) of [_chdata3 v] \n        change [_i8 v] by (1)\n    end\n    set [_i9 v] to []\n    repeat until < [;] contains (letter (_i7) of (d))?>\n        set [_i9 v] to (join (_i9) (letter (_i7) of (d)))\n        change [_i7 v] by (1)\n    end\n    change [_i7 v] by (1)\n    if <(_i9) = ((1) * (_i9))> then\n        replace item (_i6) of [_chdata0 v] with ((1) * (_i9))\n    else\n        replace item (_i6) of [_chdata0 v] with (_i9)\n    end\n    set [_i9 v] to []\n    repeat until < [;] contains (letter (_i7) of (d))?>\n        set [_i9 v] to (join (_i9) (letter (_i7) of (d)))\n        change [_i7 v] by (1)\n    end\n    change [_i7 v] by (1)\n    if <(_i9) = ((1) * (_i9))> then\n        replace item (_i6) of [_chdata1 v] with ((1) * (_i9))\n    else\n        replace item (_i6) of [_chdata1 v] with (_i9)\n    end\n    set [_i9 v] to []\n    repeat until < [;] contains (letter (_i7) of (d))?>\n        set [_i9 v] to (join (_i9) (letter (_i7) of (d)))\n        change [_i7 v] by (1)\n    end\n    change [_i7 v] by (1)\n    if <(_i9) = ((1) * (_i9))> then\n        replace item (_i6) of [_chdata2 v] with ((1) * (_i9))\n    else\n        replace item (_i6) of [_chdata2 v] with (_i9)\n    end\n    set [_i9 v] to []\n    repeat until < [;] contains (letter (_i7) of (d))?>\n        set [_i9 v] to (join (_i9) (letter (_i7) of (d)))\n        change [_i7 v] by (1)\n    end\n    change [_i7 v] by (1)\n    if <(_i9) = ((1) * (_i9))> then\n        replace item (_i6) of [_chdata3 v] with ((1) * (_i9))\n    else\n        replace item (_i6) of [_chdata3 v] with (_i9)\n    end\n    change [_i6 v] by (1)\nend\nif <(_i8) > [0]> then\n    set [_i5 v] to (id)\n    repeat ((length of [_chindex v]) - (_i5))\n        change [_i5 v] by (1)\n        replace item (_i5) of [_chindex v] with ((item (_i5) of [_chindex v]) + (_i8))\n    end\nend\n\ndefine _getWidth (text) (size) (cspace)\nset [_width v] to [0]\nset [_i0 v] to [1]\nset [_i1 v] to [0]\nrepeat (length of (text))\n    switch costume to (blank v)\n    switch costume to (join (letter (_i0) of (text)) [_])\n    set [_i2 v] to ((costume [number v]) - (1))\n    if <(_i2) > [0]> then\n        change [_width v] by (((size) * (item (_i2) of [_chwidth v])) + (cspace))\n        change [_i1 v] by (1)\n    end\n    change [_i0 v] by (1)\nend\nif <(_i1) > [0]> then\n    change [_width v] by ((-1) * (cspace))\nend\n\ndefine New Lines | Number (lines) Size (size) Space (lspace)\nchange [_y v] by (((lines) + <(lines) = []>) * (((size) + ((12) * <(size) = []>)) * ((-1) - ((0.7) * ((lspace) + <(lspace) = []>)))))\n\ndefine Print | Pos (x) (y) Size (size) (width) Bounds (xmin) (xmax) Space (cspace) Style (weight) (slant) Underline (ul.height) (ul.weight) Align (al.x) (al.y) Text (text)\npen up\nset [_i8 v] to ((size) + ((12) * <(size) = []>))\nif <not <(_i8) > [0]>> then\n    set [_x v] to ((1) * (x))\n    set [_y v] to ((1) * (y))\n    switch costume to ( _ v)\n    stop [this script v]\nend\nset [_i7 v] to (((width) + <(width) = []>) * (_i8))\nset [_i9 v] to (([tan v] of (slant) ) * (_i8))\nset [_i2 v] to ((al.x) + (((0.5) * <(al.x) = [c]>) + <(al.x) = [r]>))\nset [_i3 v] to ((al.y) + (((0.5) * <(al.y) = [c]>) + <(al.y) = [t]>))\nset [_i4 v] to (((cspace) + <(cspace) = []>) * ((0.27) * (_i8)))\nset pen size to ((0.125) * (((weight) + <(weight) = []>) * (_i8)))\n_printText (text) ((1) * (x)) ((y) - ((_i3) * (_i8))) ((xmin) + (<(xmin) = []> * ((-1) / (0)))) ((xmax) + (<(xmax) = []> * ((1) / (0)))) (_i4) (ul.height) (((weight) + <(weight) = []>) * ((ul.weight) + <(ul.weight) = []>)) ((-1) * (_i2))\n\ndefine Get Width | Size (size) (width) Space (cspace) Text (text)\n_getWidth (text) (((size) + ((12) * <(size) = []>)) * ((width) + <(width) = []>)) (((cspace) + <(cspace) = []>) * ((0.27) * ((size) + ((12) * <(size) = []>))))\n\ndefine Print WW | Pos (x) (y) Size (size) (width) Bounds (xmin) (xmax) (ymax) (ymin) Space (cspace) (lspace) Style (weight) (slant) Underline (ul.height) (ul.weight) Align (al.x) (al.y) Text (text)\npen up\nset [_i0 v] to ((size) + ((12) * <(size) = []>))\nif <not <(_i0) > [0]>> then\n    set [_x v] to ((1) * (x))\n    set [_y v] to ((1) * (y))\n    switch costume to ( _ v)\n    stop [this script v]\nend\nset [_i0 v] to (((width) + <(width) = []>) * (_i0))\nset [_i1 v] to ((xmin) + ((-230) * <(xmin) = []>))\nset [_i2 v] to ((xmax) + ((230) * <(xmax) = []>))\nset [_i3 v] to (item (1) of [_chwidth v])\nset [_i4 v] to (((0.27) * ((cspace) + <(cspace) = []>)) / ((width) + <(width) = []>))\n_calcWW (text) (((_i2) - (_i1)) / (_i0)) (<not <(x) = []>> * (((x) - (_i1)) / (_i0))) (_i4) ((_i4) + (_i3))\nset [_i7 v] to (_i0)\nset [_i8 v] to ((size) + ((12) * <(size) = []>))\nset [_i3 v] to ((al.x) + (((0.5) * <(al.x) = [c]>) + <(al.x) = [r]>))\nset [_i0 v] to ((lspace) + <(lspace) = []>)\nif <(al.y) = []> then\n    set [_i4 v] to [1]\nelse\n    if <(al.y) = ((1) * (al.y))> then\n        set [_i4 v] to (al.y)\n    else\n        if <(al.y) = [b]> then\n            set [_i4 v] to ((length of [_ww1 v]) - <<(item (1) of [_ww2 v]) = [0]> and <(x) = []>>)\n        else\n            if <(al.y) = [c]> then\n                set [_i4 v] to ((0.5) * ((((0.7) * (_i0)) / (((0.7) * (_i0)) + (1))) + ((length of [_ww1 v]) - <<(item (1) of [_ww2 v]) = [0]> and <(x) = []>>)))\n            else\n                set [_i4 v] to (((0.7) * (_i0)) / (((0.7) * (_i0)) + (1)))\n            end\n        end\n    end\nend\nset [_i5 v] to ((0.1) * ((((ul.weight) + <(ul.weight) = []>) * ((weight) + <(weight) = []>)) * (_i8)))\nif <(ymax) = []> then\n    set [_i6 v] to ((1) / (0))\nelse\n    set [_i6 v] to ((ymax) - (_i0))\nend\nset [_i9 v] to (([tan v] of (slant) ) * (_i8))\n_printWW ((((1) - (_i3)) * (_i1)) + ((_i3) * (_i2))) (x) ((1) - <(x) = []>) ((1) * (y)) (_i6) ((ymin) + (<(ymin) = []> * ((-1) / (0)))) (((cspace) + <(cspace) = []>) * ((0.27) * (_i8))) ((_i8) * ((-1) - ((0.7) * (_i0)))) ((0.125) * (((weight) + <(weight) = []>) * (_i8))) ((ul.height) * (_i8)) (_i5) ((ul.height) * (_i9)) <not <(ul.height) = []>> ((-1) * ((_i3) * (_i7))) (_i4)\n\ndefine _printText (text) (x) (y) (xmin) (xmax) (cspace) (ul.height) (ul.weight) (al.x)\nset [_x v] to (x)\nset [_y v] to (y)\nif <not <(al.x) = [0]>> then\n    set [_width v] to [0]\n    _getWidth (text) (_i7) (cspace)\n    change [_x v] by ((al.x) * (_width))\nend\nset [_bq v] to ([ceiling v] of (((0.075) * ([sqrt v] of ((_i7) * (_i8)) )) + (0.5)) )\nset [_bq2 v] to ((4) * ((_bq) * (_bq)))\nset [_i0 v] to [1]\nif <<(xmin) = ((-1) / (0))> and <(xmax) = ((1) / (0))>> then\n    if <(_i9) = [0]> then\n        repeat (length of (text))\n            switch costume to (blank v)\n            switch costume to (join (letter (_i0) of (text)) [_])\n            if <(costume [number v]) > [1]> then\n                _printCh ((costume [number v]) - (1))\n                change [_x v] by (cspace)\n            end\n            change [_i0 v] by (1)\n        end\n    else\n        repeat (length of (text))\n            switch costume to (blank v)\n            switch costume to (join (letter (_i0) of (text)) [_])\n            if <(costume [number v]) > [1]> then\n                _printChSl ((costume [number v]) - (1))\n                change [_x v] by (cspace)\n            end\n            change [_i0 v] by (1)\n        end\n    end\nelse\n    repeat (length of (text))\n        switch costume to (blank v)\n        switch costume to (join (letter (_i0) of (text)) [_])\n        if <(costume [number v]) > [1]> then\n            if <not <<(_x) < (xmin)> or <((_x) + ((_i7) * (item ((costume [number v]) - (1)) of [_chwidth v]))) > (xmax)>>> then\n                _printChSl ((costume [number v]) - (1))\n            else\n                change [_x v] by ((_i7) * (item ((costume [number v]) - (1)) of [_chwidth v]))\n            end\n            change [_x v] by (cspace)\n        end\n        change [_i0 v] by (1)\n    end\nend\nswitch costume to ( _ v)\nif <not <(ul.height) = []>> then\n    set pen size to ((0.1) * (((ul.weight) + <(ul.weight) = []>) * (_i8)))\n    set [_i1 v] to ((x) + ((al.x) * (_width)))\n    if <(_i1) < (xmin)> then\n        set [_i1 v] to (xmin)\n    end\n    go to x: (((_i1) + ((_i9) * (ul.height))) - ((0.13) * (_i7))) y: ((y) + ((ul.height) * (_i8)))\n    pen down\n    set [_i2 v] to ((_x) - (cspace))\n    if <(_i2) > (xmax)> then\n        set [_i2 v] to (xmax)\n    end\n    set x to (((_i2) + ((_i9) * (ul.height))) + ((0.13) * (_i7)))\n    pen up\nend\n\ndefine _printWW (x) (firstx) (firstline) (y) (ymax) (ymin) (cspace) (lspace) (wt) (ul.height) (ul.weight) (ul.offset) <undl> (al.x) (al.y)\nswitch costume to ( _ v)\nset [_x v] to (x)\nset [_y v] to ((y) - (((al.y) - (1)) * (lspace)))\nset [_i0 v] to [1]\nset [_i1 v] to [1]\nif <(item (1) of [_ww2 v]) = [0]> then\n    change [_i0 v] by (1)\n    change [_i1 v] by (1)\n    if <(firstline) = [1]> then\n        change [_y v] by (lspace)\n    end\nend\nrepeat until <<not <(_y) > (ymax)>> or <(_i0) > (length of [_ww1 v])>>\n    change [_i1 v] by ((item (_i0) of [_ww2 v]) + (1))\n    change [_i0 v] by (1)\n    change [_y v] by (lspace)\nend\nset [_bq v] to ([ceiling v] of (((0.075) * ([sqrt v] of ((_i7) * (_i8)) )) + (0.5)) )\nset [_bq2 v] to ((4) * ((_bq) * (_bq)))\nrepeat until <<(_y) < (ymin)> or <(_i0) > (length of [_ww1 v])>>\n    if <(_i0) = (firstline)> then\n        set [_x v] to (firstx)\n    else\n        set [_x v] to ((x) + ((al.x) * (item (_i0) of [_ww1 v])))\n    end\n    set pen size to (wt)\n    if <(_i9) = [0]> then\n        repeat (item (_i0) of [_ww2 v])\n            _printCh (item (_i1) of [_ww0 v])\n            change [_x v] by (cspace)\n            change [_i1 v] by (1)\n        end\n    else\n        repeat (item (_i0) of [_ww2 v])\n            _printChSl (item (_i1) of [_ww0 v])\n            change [_x v] by (cspace)\n            change [_i1 v] by (1)\n        end\n    end\n    if <undl> then\n        set pen size to (ul.weight)\n        if <(_i0) = (firstline)> then\n            go to x: (((firstx) + (ul.offset)) - ((0.13) * (_i7))) y: ((_y) + (ul.height))\n        else\n            go to x: ((((x) + ((al.x) * (item (_i0) of [_ww1 v]))) + (ul.offset)) - ((0.13) * (_i7))) y: ((_y) + (ul.height))\n        end\n        pen down\n        set x to ((((_x) - (cspace)) + (ul.offset)) + ((0.13) * (_i7)))\n        pen up\n    end\n    change [_i0 v] by (1)\n    change [_i1 v] by (1)\n    change [_y v] by (lspace)\nend\nif <((length of [_ww1 v]) - <(item (1) of [_ww2 v]) = [0]>) > [0]> then\n    change [_y v] by ((-1) * (lspace))\nend\ndelete all of [_ww0 v]\ndelete all of [_ww1 v]\ndelete all of [_ww2 v]\n\ndefine _printCh (id)\nset [_i2 v] to (item (id) of [_chindex v])\nif <(item (_i2) of [_chdata1 v]) = [Q]> then\n    repeat (item (_i2) of [_chdata0 v])\n        change [_i2 v] by (1)\n        go to x: ((_x) + ((_i7) * (item (_i2) of [_chdata0 v]))) y: ((_y) + ((_i8) * (item (_i2) of [_chdata1 v])))\n        pen down\n        repeat (item (_i2) of [_chdata2 v])\n            change [_i2 v] by (1)\n            if <(item (_i2) of [_chdata0 v]) = [L]> then\n                go to x: ((x position) + ((_i7) * (item (_i2) of [_chdata1 v]))) y: ((y position) + ((_i8) * (item (_i2) of [_chdata2 v])))\n            else\n                set [_i3 v] to (((_i7) * (item (_i2) of [_chdata0 v])) / (_bq2))\n                set [_i4 v] to ((((_i7) * (item (_i2) of [_chdata1 v])) / (_bq)) + ((_i3) / (2)))\n                set [_i5 v] to (((_i8) * (item (_i2) of [_chdata2 v])) / (_bq2))\n                set [_i6 v] to ((((_i8) * (item (_i2) of [_chdata3 v])) / (_bq)) + ((_i5) / (2)))\n                repeat (_bq)\n                    go to x: ((x position) + (_i4)) y: ((y position) + (_i6))\n                    change [_i4 v] by (_i3)\n                    change [_i6 v] by (_i5)\n                    go to x: ((x position) + (_i4)) y: ((y position) + (_i6))\n                    change [_i4 v] by (_i3)\n                    change [_i6 v] by (_i5)\n                end\n            end\n        end\n        pen up\n    end\nelse\n    repeat (item (_i2) of [_chdata0 v])\n        change [_i2 v] by (1)\n        go to x: ((_x) + ((_i7) * (item (_i2) of [_chdata0 v]))) y: ((_y) + ((_i8) * (item (_i2) of [_chdata1 v])))\n        pen down\n        repeat (item (_i2) of [_chdata2 v])\n            change [_i2 v] by (1)\n            go to x: ((x position) + ((_i7) * (item (_i2) of [_chdata0 v]))) y: ((y position) + ((_i8) * (item (_i2) of [_chdata1 v])))\n        end\n        pen up\n    end\nend\nchange [_i2 v] by (1)\nchange pen size by (1)\nrepeat (item (_i2) of [_chdata0 v])\n    change [_i2 v] by (1)\n    go to x: ((_x) + ((_i7) * (item (_i2) of [_chdata0 v]))) y: ((_y) + ((_i8) * (item (_i2) of [_chdata1 v])))\n    pen down\n    pen up\nend\nchange pen size by (-1)\nchange [_x v] by ((_i7) * (item (id) of [_chwidth v]))\n\ndefine _printChSl (id)\nset [_i2 v] to (item (id) of [_chindex v])\nif <(item (_i2) of [_chdata1 v]) = [Q]> then\n    repeat (item (_i2) of [_chdata0 v])\n        change [_i2 v] by (1)\n        go to x: ((_x) + (((_i7) * (item (_i2) of [_chdata0 v])) + ((_i9) * (item (_i2) of [_chdata1 v])))) y: ((_y) + ((_i8) * (item (_i2) of [_chdata1 v])))\n        pen down\n        repeat (item (_i2) of [_chdata2 v])\n            change [_i2 v] by (1)\n            if <(item (_i2) of [_chdata0 v]) = [L]> then\n                go to x: ((x position) + (((_i7) * (item (_i2) of [_chdata1 v])) + ((_i9) * (item (_i2) of [_chdata2 v])))) y: ((y position) + ((_i8) * (item (_i2) of [_chdata2 v])))\n            else\n                set [_i3 v] to ((((_i7) * (item (_i2) of [_chdata0 v])) + ((_i9) * (item (_i2) of [_chdata2 v]))) / (_bq2))\n                set [_i4 v] to (((((_i7) * (item (_i2) of [_chdata1 v])) + ((_i9) * (item (_i2) of [_chdata3 v]))) / (_bq)) + ((_i3) / (2)))\n                set [_i5 v] to (((_i8) * (item (_i2) of [_chdata2 v])) / (_bq2))\n                set [_i6 v] to ((((_i8) * (item (_i2) of [_chdata3 v])) / (_bq)) + ((_i5) / (2)))\n                repeat (_bq)\n                    go to x: ((x position) + (_i4)) y: ((y position) + (_i6))\n                    change [_i4 v] by (_i3)\n                    change [_i6 v] by (_i5)\n                    go to x: ((x position) + (_i4)) y: ((y position) + (_i6))\n                    change [_i4 v] by (_i3)\n                    change [_i6 v] by (_i5)\n                end\n            end\n        end\n        pen up\n    end\nelse\n    repeat (item (_i2) of [_chdata0 v])\n        change [_i2 v] by (1)\n        go to x: ((_x) + (((_i7) * (item (_i2) of [_chdata0 v])) + ((_i9) * (item (_i2) of [_chdata1 v])))) y: ((_y) + ((_i8) * (item (_i2) of [_chdata1 v])))\n        pen down\n        repeat (item (_i2) of [_chdata2 v])\n            change [_i2 v] by (1)\n            go to x: ((x position) + (((_i7) * (item (_i2) of [_chdata0 v])) + ((_i9) * (item (_i2) of [_chdata1 v])))) y: ((y position) + ((_i8) * (item (_i2) of [_chdata1 v])))\n        end\n        pen up\n    end\nend\nchange [_i2 v] by (1)\nchange pen size by (1)\nrepeat (item (_i2) of [_chdata0 v])\n    change [_i2 v] by (1)\n    go to x: ((_x) + (((_i7) * (item (_i2) of [_chdata0 v])) + ((_i9) * (item (_i2) of [_chdata1 v])))) y: ((_y) + ((_i8) * (item (_i2) of [_chdata1 v])))\n    pen down\n    pen up\nend\nchange pen size by (-1)\nchange [_x v] by ((_i7) * (item (id) of [_chwidth v]))\n\nwhen I receive [win v]\nerase all\nset pen color to (#ffffff)\nPrint | Pos [-195] [-20] Size [60] [] Bounds [] [] Space [1.5] Style [2] [] Underline [] [] Align [] [] Text (win text)\n\nwhen I receive [tn v]\nset pen color to (#ffffff)\nPrint | Pos [-170] [140] Size [20] [] Bounds [] [] Space [1.5] Style [2] [] Underline [] [] Align [] [] Text [.]\nPrint | Pos [-50] [110] Size [20] [] Bounds [] [] Space [1.5] Style [2] [] Underline [] [] Align [] [] Text [.]\n\n@PTE\n\nwhen flag clicked\nwait (12) seconds\nhide\nswitch costume to (  v)\nset size to (108000) %\nswitch costume to (a v)\n\ndefine INTERNAL | printChar (index) (x) (y) (i.x) (i.y) (j.x) (j.y)\nchange [_x v] by ((i.x) * (item (index) of [_char_width v]))\nchange [_y v] by ((i.y) * (item (index) of [_char_width v]))\nset [_i3 v] to (item (index) of [_char_index v])\nrepeat (item ((_i3) - (1)) of [_font_data v])\n    go to x: ((x) + (((i.x) * (item (_i3) of [_font_data v])) + ((j.x) * (item ((_i3) + (1)) of [_font_data v])))) y: ((y) + (((i.y) * (item (_i3) of [_font_data v])) + ((j.y) * (item ((_i3) + (1)) of [_font_data v]))))\n    pen down\n    change [_i3 v] by (3)\n    repeat (item ((_i3) - (1)) of [_font_data v])\n        go to x: ((x) + (((i.x) * (item (_i3) of [_font_data v])) + ((j.x) * (item ((_i3) + (1)) of [_font_data v])))) y: ((y) + (((i.y) * (item (_i3) of [_font_data v])) + ((j.y) * (item ((_i3) + (1)) of [_font_data v]))))\n        change [_i3 v] by (2)\n    end\n    pen up\nend\nchange [_i3 v] by (1)\nchange pen size by (1)\nrepeat (item ((_i3) - (1)) of [_font_data v])\n    go to x: ((x) + (((i.x) * (item (_i3) of [_font_data v])) + ((j.x) * (item ((_i3) + (1)) of [_font_data v])))) y: ((y) + (((i.y) * (item (_i3) of [_font_data v])) + ((j.y) * (item ((_i3) + (1)) of [_font_data v]))))\n    pen down\n    pen up\n    change [_i3 v] by (2)\nend\nchange pen size by (-1)\n\ndefine Set Pen Color to RGBA (r) (g) (b) (a)\nset pen color to ((round (b)) + ((256) * ((round (g)) + ((256) * ((round (r)) + ((256) * (round (a))))))))\n\ndefine Print | Pos (x) (y) Size (size) Transform (i.x) (i.y) (j.x) (j.y) Spacing (cspace) Weight (weight) Underline (ul.left) (ul.right) (ul.weight) Align (al.x) (al.y) Text (text)\npen up\nset [_i0 v] to (((<(size) = []> * (12)) + (size)) / (100))\nset pen size to ((0.125) * ((<(weight) = []> + (weight)) * ((100) * (_i0))))\nset [_i1 v] to ((_i0) * (<(i.x) = []> + (i.x)))\nset [_i2 v] to ((_i0) * ((1) * (i.y)))\nset [_i3 v] to (<(cspace) = []> + (cspace))\nset [_i4 v] to ((-1) * ((<(al.x) = [r]> + (<(al.x) = [c]> * (0.5))) + (al.x)))\nset [_i5 v] to ((-1) * ((<(al.y) = [t]> + (<(al.y) = [c]> * (0.5))) + (al.y)))\nINTERNAL | printText (text) ((1) * (x)) ((1) * (y)) (_i1) (_i2) ((_i0) * ((1) * (j.x))) ((_i0) * (<(j.y) = []> + (j.y))) ((30) * ((_i3) * (_i1))) ((30) * ((_i3) * (_i2))) (ul.left) (ul.right) ((0.125) * ((<(ul.weight) = []> + (ul.weight)) * ((100) * (_i0)))) (_i4) (_i5)\n\ndefine INTERNAL | printText (text) (x) (y) (i.x) (i.y) (j.x) (j.y) (cs.x) (cs.y) (ul.left) (ul.right) (ul.weight) (al.x) (al.y)\nset [_x v] to ((x) + ((100) * ((al.y) * (j.x))))\nset [_y v] to ((y) + ((100) * ((al.y) * (j.y))))\nif <not <(al.x) = [0]>> then\n    set [_i0 v] to [1]\n    set [_i1 v] to [0]\n    set [_i2 v] to [0]\n    repeat (length of (text))\n        switch costume to (  v)\n        switch costume to (letter (_i0) of (text))\n        change [_i1 v] by (((i.x) * (item (costume [number v]) of [_char_width v])) + (cs.x))\n        change [_i2 v] by (((i.y) * (item (costume [number v]) of [_char_width v])) + (cs.y))\n        change [_i0 v] by (1)\n    end\n    change [_x v] by ((al.x) * ((_i1) - (cs.x)))\n    change [_y v] by ((al.x) * ((_i2) - (cs.y)))\nend\nset [_i1 v] to ((_x) + (((100) * ((ul.left) * (j.x))) - ((0.3) * (cs.x))))\nset [_i2 v] to ((_y) + (((100) * ((ul.left) * (j.y))) - ((0.3) * (cs.y))))\nset [_i0 v] to [1]\nrepeat (length of (text))\n    switch costume to (  v)\n    switch costume to (letter (_i0) of (text))\n    INTERNAL | printChar (costume [number v]) (_x) (_y) (i.x) (i.y) (j.x) (j.y)\n    change [_x v] by (cs.x)\n    change [_y v] by (cs.y)\n    change [_i0 v] by (1)\nend\nif <not <<(ul.left) = []> or <(ul.right) = []>>> then\n    set pen size to (ul.weight)\n    go to x: ((_x) + (((100) * ((ul.right) * (j.x))) - ((0.7) * (cs.x)))) y: ((_y) + (((100) * ((ul.right) * (j.y))) - ((0.7) * (cs.y))))\n    pen down\n    go to x: (_i1) y: (_i2)\n    pen up\nend\n\ndefine INTERNAL | printWW (x) (y) (i.x) (i.y) (j.x) (j.y) (cs.x) (cs.y) (ls.x) (ls.y) (ul.left) (ul.right) (ul.weight) (al.x) (al.y)\nswitch costume to (a v)\nset [_i0 v] to [1]\nset [_i1 v] to [1]\nrepeat (length of [_tmp1 v])\n    set [_x v] to (((x) + ((ls.x) * ((_i0) - (al.y)))) - ((al.x) * ((i.x) * (item (_i0) of [_tmp1 v]))))\n    set [_y v] to (((y) + ((ls.y) * ((_i0) - (al.y)))) - ((al.x) * ((i.y) * (item (_i0) of [_tmp1 v]))))\n    repeat (item (_i0) of [_tmp2 v])\n        INTERNAL | printChar (item (_i1) of [_tmp0 v]) (_x) (_y) (i.x) (i.y) (j.x) (j.y)\n        change [_x v] by (cs.x)\n        change [_y v] by (cs.y)\n        change [_i1 v] by (1)\n    end\n    change [_i0 v] by (1)\n    change [_i1 v] by (1)\nend\nif <not <<(ul.left) = []> or <(ul.right) = []>>> then\n    set pen size to (ul.weight)\n    set [_i0 v] to [1]\n    repeat (length of [_tmp1 v])\n        set [_x v] to ((x) + ((ls.x) * ((_i0) - (al.y))))\n        set [_y v] to ((y) + ((ls.y) * ((_i0) - (al.y))))\n        set [_i1 v] to (item (_i0) of [_tmp1 v])\n        go to x: (((_x) - ((al.x) * ((i.x) * (_i1)))) + (((100) * ((ul.left) * (j.x))) - ((0.3) * (cs.x)))) y: (((_y) - ((al.x) * ((i.y) * (_i1)))) + (((100) * ((ul.left) * (j.y))) - ((0.3) * (cs.y))))\n        pen down\n        go to x: (((_x) - (((al.x) - (1)) * ((i.x) * (_i1)))) + (((100) * ((ul.right) * (j.x))) + ((0.3) * (cs.x)))) y: (((_y) - (((al.x) - (1)) * ((i.y) * (_i1)))) + (((100) * ((ul.right) * (j.y))) + ((0.3) * (cs.y))))\n        pen up\n        change [_i0 v] by (1)\n    end\nend\nset [_x v] to ((x) + ((ls.x) * ((_i0) - (al.y))))\nset [_y v] to ((y) + ((ls.y) * ((_i0) - (al.y))))\n\ndefine INTERNAL | calcWW (text) (length) (extlen) (cspace) (emptyline) (emptyword)\ndelete all of [_tmp0 v]\ndelete all of [_tmp1 v]\ndelete all of [_tmp2 v]\nset [_i0 v] to [1]\nset [_i1 v] to (emptyword)\nset [_i2 v] to [0]\nset [_i3 v] to (emptyline)\nset [_i4 v] to [0]\nrepeat (length of (text))\n    if <(letter (_i0) of (text)) = [ ]> then\n        if <((_i3) + (_i1)) > (length)> then\n            if <(((_i2) - (1)) - (_i4)) > [0]> then\n                add (_i3) to [_tmp1 v]\n                add (((_i2) - (1)) - (_i4)) to [_tmp2 v]\n                set [_i3 v] to ((_i1) + (emptyline))\n                set [_i4 v] to (_i2)\n            end\n        else\n            change [_i3 v] by (_i1)\n        end\n        set [_i1 v] to (emptyword)\n        add [1] to [_tmp0 v]\n        set [_i2 v] to (length of [_tmp0 v])\n    else\n        switch costume to (  v)\n        switch costume to (letter (_i0) of (text))\n        set [_i5 v] to ((item (costume [number v]) of [_char_width v]) + (cspace))\n        if <((_i1) + (_i5)) > (extlen)> then\n            if <((_i2) - (_i4)) > [0]> then\n                add (_i3) to [_tmp1 v]\n                add (((_i2) - (1)) - (_i4)) to [_tmp2 v]\n            end\n            add ((emptyline) + (_i1)) to [_tmp1 v]\n            add ((length of [_tmp0 v]) - (_i2)) to [_tmp2 v]\n            add [1] to [_tmp0 v]\n            set [_i3 v] to (emptyline)\n            set [_i1 v] to ((emptyword) + (_i5))\n            set [_i2 v] to (length of [_tmp0 v])\n            set [_i4 v] to (_i2)\n        else\n            change [_i1 v] by (_i5)\n        end\n        add (costume [number v]) to [_tmp0 v]\n    end\n    change [_i0 v] by (1)\nend\nif <not <(_i4) = (length of [_tmp0 v])>> then\n    if <(_i2) = (length of [_tmp0 v])> then\n        add (_i3) to [_tmp1 v]\n        add ((length of [_tmp0 v]) - (_i4)) to [_tmp2 v]\n    else\n        if <((_i3) + (_i1)) > (length)> then\n            if <(((_i2) - (1)) - (_i4)) > [0]> then\n                add (_i3) to [_tmp1 v]\n                add (((_i2) - (1)) - (_i4)) to [_tmp2 v]\n            end\n            add ((emptyline) + (_i1)) to [_tmp1 v]\n            add ((length of [_tmp0 v]) - (_i2)) to [_tmp2 v]\n        else\n            add ((_i3) + (_i1)) to [_tmp1 v]\n            add ((length of [_tmp0 v]) - (_i4)) to [_tmp2 v]\n        end\n    end\nend\n\ndefine WW Print | Pos (x) (y) Size (size) Length (length) Transform (i.x) (i.y) (j.x) (j.y) Spacing (cspace) (lspace.y) (lspace.x) Weight (weight) Underline (ul.left) (ul.right) (ul.weight) Align (al.x) (al.y) Text (text)\npen up\nset [_i0 v] to ((<(size) = []> * (12)) + (size))\nset pen size to ((0.125) * ((<(weight) = []> + (weight)) * (_i0)))\nset [_i1 v] to (<(cspace) = []> + (cspace))\nset [_i2 v] to ((((100) / (_i0)) * ((<(length) = []> * (460)) + (length))) / ([sqrt v] of (((<(i.x) = []> + (i.x)) * (<(i.x) = []> + (i.x))) + ((i.y) * (i.y))) ))\nINTERNAL | calcWW (text) (_i2) ((_i2) + (((30) * (_i1)) + (20))) ((30) * (_i1)) ((-1) * (((60) * (_i1)) + (20))) (((30) * (_i1)) + (20))\nset [_i0 v] to (((<(size) = []> * (12)) + (size)) / (100))\nset [_i1 v] to ((_i0) * (<(i.x) = []> + (i.x)))\nset [_i2 v] to ((_i0) * ((1) * (i.y)))\nset [_i3 v] to ((_i0) * ((1) * (j.x)))\nset [_i4 v] to ((_i0) * (<(j.y) = []> + (j.y)))\nset [_i5 v] to (<(cspace) = []> + (cspace))\nset [_i6 v] to (<(lspace.y) = []> + (lspace.y))\nset [_i0 v] to (((<(al.y) = [b]> * (length of [_tmp1 v])) + ((<(al.y) = [c]> * (((length of [_tmp1 v]) + (((0.7) * (_i6)) / ((1) + ((0.7) * (_i6))))) / (2))) + (<(al.y) = [t]> * (((0.7) * (_i6)) / ((1) + ((0.7) * (_i6))))))) + (<(al.y) = []> + (al.y)))\nset [_i6 v] to ((-100) - ((70) * (_i6)))\nINTERNAL | printWW ((1) * (x)) ((1) * (y)) (_i1) (_i2) (_i3) (_i4) ((30) * ((_i5) * (_i1))) ((30) * ((_i5) * (_i2))) (((_i3) * (_i6)) - ((_i6) * ((_i1) * (lspace.x)))) (((_i4) * (_i6)) - ((_i6) * ((_i2) * (lspace.x)))) (ul.left) (ul.right) ((0.125) * ((<(ul.weight) = []> + (ul.weight)) * ((<(size) = []> * (12)) + (size)))) ((<(al.x) = [r]> + (<(al.x) = [c]> * (0.5))) + (al.x)) (_i0)\ndelete all of [_tmp0 v]\n\ndefine Move Down | Lines (lines) Size (size) Transform (i.x) (i.y) (j.x) (j.y) Spacing (lspace.y) (lspace.x)\nset [_i0 v] to (((<(size) = []> * (12)) + (size)) / (100))\nset [_i1 v] to ((_i0) * (<(i.x) = []> + (i.x)))\nset [_i2 v] to ((_i0) * ((1) * (i.y)))\nset [_i3 v] to ((_i0) * ((1) * (j.x)))\nset [_i4 v] to ((_i0) * (<(j.y) = []> + (j.y)))\nset [_i5 v] to ((-100) - ((70) * (<(lspace.y) = []> + (lspace.y))))\nset [_i6 v] to (<(lines) = []> + (lines))\nchange [_x v] by ((_i6) * (((_i3) * (_i5)) - ((_i5) * ((_i1) * (lspace.x)))))\nchange [_y v] by ((_i6) * (((_i4) * (_i5)) - ((_i5) * ((_i2) * (lspace.x)))))\n\nwhen I receive [tn v]\nset pen color to (#ffffff)\nPrint | Pos [-170] [140] Size [20] Transform [] [] [] [] Spacing [1.5] Weight [] Underline [] [] [] Align [] [] Text [.]\nPrint | Pos [-50] [110] Size [20] Transform [] [] [] [] Spacing [1.5] Weight [] Underline [] [] [] Align [] [] Text [.]\n\nwhen I receive [win v]\nerase all\nset pen color to (#ffffff)\nPrint | Pos [-200] [-20] Size [60] Transform [] [] [] [] Spacing [1.5] Weight [] Underline [] [] [] Align [] [] Text (win text)\n\n@Sprite1\n\nwhen flag clicked\nhide\nwait (11) seconds\nshow\ngo to [front v] layer\nrepeat (10)\n    wait () seconds\n    change [ghost v] effect by (10)\nend\n\n@SnowDist\n\nwhen flag clicked\n\nwait (14) seconds\nhide\nset [ghost v] effect to (100)\nset size to (15) %\nforever\n    change [ghost v] effect by (-1)\n    set size to (pick random (3) to (85)) %\n    go to (random position v)\n    create clone of (_myself_ v)\n    turn right (pick random (0) to (360)) degrees\n    wait (.015) seconds\n    next costume\nend\n\nwhen I start as a clone\nsize (pick random (1) to (100))\n\ndefine size (sz)\nset size to ((size) * ((sz) / (55))) %\ngo to [front v] layer\nset [ghost v] effect to (((y position) / (6)) * (-1))\nshow\nrepeat (50)\n    change [ghost v] effect by (2)\n    change x by ((.6) + ((1) * ((sz) / (75))))\n    change y by ((1.3) + ((1) * ((sz) / (65))))\n    move ((1) * ((sz) / (45))) steps\n    turn left ((-.2) + ((-1) * ((sz) / (75)))) degrees\nend\ndelete this clone\n\n@Blank2\n\n@Pen intro\n\ndefine draw line (x) (y) to (ex) (ey) pensize (pen)\ngoto (x) (y)\nset pen (transparency v) to (ghost)\nset pen size to ((pen) / (z))\npen down\ngoto (ex) (ey)\npen up\n\nwhen flag clicked\nerase all\ndelete all of [list v]\nrepeat (30)\n    add (pick random (-500) to (500)) to [list v]\n    add (pick random (-250) to (250)) to [list v]\n    add (pick random (-500) to (500)) to [list v]\n    add (pick random (-250) to (250)) to [list v]\n    add (pick random (-500) to (500)) to [list v]\n    add (pick random (-250) to (250)) to [list v]\n    add (pick random (-500) to (500)) to [list v]\n    add (pick random (-250) to (250)) to [list v]\nend\nforever\n    erase all\n    stars (ghost)\n    set pen color to (#ffffff)\n    draw line [0] [100] to [-75] [-75] pensize [40]\n    draw line [0] [100] to [75] [-75] pensize [40]\n    draw line [-50] [-40] to [50] [-40] pensize [40]\n    set pen color to (#ff7e1c)\n    draw line [0] [100] to [-75] [-75] pensize [18]\n    draw line [0] [100] to [75] [-75] pensize [18]\n    draw line [-50] [-40] to [50] [-40] pensize [18]\nend\n\ndefine goto (x) (y)\ngo to x: ((((x) + (xshift)) * (Xrotation)) / (z)) y: (((y) * (yrotation)) / (z))\n\nwhen flag clicked\nset [xshift v] to [0]\nset [yrotation v] to [1]\nset [xrotation v] to [1]\nset [z v] to [1000]\nset [ghost v] to [0]\nwait (1) seconds\nset volume to (5) %\nstart sound [Jim Yosef - Link \[NCS Release\] v]\nrepeat (60)\n    change [z v] by (((0.9) - (z)) / (4))\nend\nset [1 v] to [0]\nrepeat until <(xshift) > [235]>\n    change [1 v] by (1)\n    change [xshift v] by (1)\nend\nset [xshift v] to [-300]\nrepeat (45)\n    change [xshift v] by (((0) - (xshift)) / (9))\nend\nwait (0.5) seconds\nrepeat (20)\n    change [yrotation v] by (((-1) - (yrotation)) / (6))\nend\nrepeat (35)\n    change [yrotation v] by (((1) - (yrotation)) / (6))\nend\nset [1 v] to [0]\nrepeat until <(xshift) > [235]>\n    change [1 v] by (1)\n    change [xshift v] by (1)\n    change [ghost v] by (5)\n    change volume by (-5)\nend\nstop [other scripts in sprite v]\nerase all\nbroadcast (start game v)\n\nrepeat (35)\n    change [xrotation v] by (((1) - (Xrotation)) / (6))\nend\n\nrepeat (20)\n    change [z v] by (((10) - (z)) / (12))\n    change [ghost v] by (5)\nend\n\ndefine stars (ghost)\nset [i v] to [1]\nset pen color to (#ff7b00)\nchange [ghost v] by (50)\nrepeat (120)\n    draw line (item (i) of [list v]) (item ((1) + (i)) of [list v]) to (item (i) of [list v]) (item ((1) + (i)) of [list v]) pensize [12]\n    change [i v] by (2)\nend\nset [ghost v] to (ghost)\n\n@Blank3\n\n@Transition\n\nwhen flag clicked\nhide\n\ndefine Change X by (x)\nswitch costume to (pos v)\nset size to (Infinity) %\nchange x by (x)\nset size to (100) %\nswitch costume to (transition v)\n\nwhen flag clicked\nwait (12) seconds\nshow\ngo to [front v] layer\nswitch costume to (pos v)\nset size to (Infinity) %\ngo to x: (-660) y: (0)\nset size to (100) %\nswitch costume to (transition v)\nrepeat (23)\n    Change X by (((0) - (x position)) / (6))\nend\nset [var 1 v] to [1]\nbroadcast (-Transition Type)\ngo to [front v] layer\nrepeat (24)\n    Change X by (Var 1)\n    change [var 1 v] by ((Var 1) / (4))\nend\nhide\n\n@SnowDist2\n\nwhen flag clicked\nwait (14) seconds\nhide\nset [ghost v] effect to (100)\nset size to (15) %\nforever\n    change [ghost v] effect by (-1)\n    set size to (pick random (3) to (85)) %\n    go to (random position v)\n    create clone of (_myself_ v)\n    turn right (pick random (0) to (360)) degrees\n    wait (.015) seconds\n    next costume\nend\n\nwhen I start as a clone\nsize (pick random (1) to (100))\n\ndefine size (sz)\nset size to ((size) * ((sz) / (55))) %\ngo to [front v] layer\nset [ghost v] effect to (((y position) / (6)) * (-1))\nshow\nrepeat (50)\n    change [ghost v] effect by (2)\n    change x by ((.6) + ((1) * ((sz) / (75))))\n    change y by ((1.3) + ((1) * ((sz) / (65))))\n    move ((1) * ((sz) / (45))) steps\n    turn left ((-.2) + ((-1) * ((sz) / (75)))) degrees\nend\ndelete this clone\n\n