Draw: The Platformer Level Editor

Instructions: Low-end Hardware not Recommended!\nPost your long level codes here: scratch.mit.edu/discuss/topic/415195\n\n~ INSTRUCTIONS ~\nPlease look at the tutorial for most of the information.\nPress Z to exit test mode\nPress V to reset test mode\nPress X to enable Performance Mode\nPress ` to toggle rectangle fill\n\nHow to use tools:\nPen Tool: Click and Drag to draw a straight line.\nRectangle Tool: Click and Drag to draw a rectangle.\nEnemy Tool: Click anywhere to spawn an enemy! (You can also drag them once they're spawned.)\nInk Tool: Click anywhere then type a number for the size, (1=Regular 2=Big 3=Infinite which is not infinite ink though) after that, the ink bubble will spawn!\nDelete Tool: Click on any ink bubble or enemy on the screen and they will be deleted!\nNoteblock Tool: Click anywhere to place a Noteblock! The project will ask you for the size of the hitbox, if you want to use instruments or in-game sounds.\nRefresh Tool: This tool is for debug purposes. The reason you can't find it is because only @Mrk20200 has it. If you hack it in, the only thing it will do is refresh the editor.\n\n~ MUSIC PLAYLIST & MUSIC CREDITS ~\n1 - 12: Draw: The Platformer Music (Edward Shallow)\n13: An Extremely Difficult Game 2 (1993 Star Fox Game)\nTags:\n#draw #platformer #mrk20200 #coolguybug #leveleditor\n\n\n20720

@Stage\n\nwhen stage clicked\nif <(EDIT_MODE) = [1]> then\n    set [loadedlevel? v] to [0]\n    if <not <(TOOL) = [debug.refresh]>> then\n        if <not <(TOOL) = [delete]>> then\n            if <not <(TOOL) = [sound]>> then\n                if <not <(TOOL) = [enemy]>> then\n                    if <not <(TOOL) = [ink]>> then\n                        if <not <[0.1] < ((timer) - (DRAW_TimerOffset))>> then\n                            Auto Fix <>\n                        end\n                        set [draw_timeroffset v] to (timer)\n                        add (mouse x) to [penx v]\n                        add (mouse y) to [peny v]\n                        wait until <[0.1] < ((timer) - (DRAW_TimerOffset))>\n                        if <mouse down?> then\n                            add [draw] to [actionhistory v]\n                            add (mouse x) to [penx v]\n                            add (mouse y) to [peny v]\n                            add (letter (1) of (TOOL)) to [pentype v]\n                            add (Pen_Color) to [penink v]\n                            if <(Performance Mode) = [1]> then\n                                wait until <not <mouse down?>>\n                                replace item (length of [penx v]) of [penx v] with (mouse x)\n                                replace item (length of [peny v]) of [peny v] with (mouse y)\n                                broadcast (redraw_level v)\n                            else\n                                repeat until <not <mouse down?>>\n                                    replace item (length of [penx v]) of [penx v] with (mouse x)\n                                    replace item (length of [peny v]) of [peny v] with (mouse y)\n                                end\n                            end\n                        else\n                            Auto Fix <>\n                            broadcast (redraw_level v)\n                        end\n                    else\n                        if <(length of [inksize v]) < [20]> then\n                            add (mouse x) to [inkx v]\n                            add (mouse y) to [inky v]\n                            ask [Please set the ink size. \(1=Regular, 2=Big, 3=Infinite\)] and wait\n                            add ((answer) + (0)) to [inksize v]\n                            add [ink] to [actionhistory v]\n                            start sound [ink v]\n                        end\n                    end\n                else\n                    if <(length of [enemyx v]) < [3]> then\n                        add (mouse x) to [enemyx v]\n                        add (mouse y) to [enemyy v]\n                        add [enemy] to [actionhistory v]\n                        start sound (pick random (1) to (2))\n                    end\n                end\n            else\n                if <((length of [noteblocks v]) / (8)) < [10]> then\n                    add (mouse x) to [noteblocks v]\n                    add (mouse y) to [noteblocks v]\n                    ask [Enter the Hitbox Size] and wait\n                    add (answer) to [noteblocks v]\n                    ask [Select Amount of uses \(1 = 1x, 2 = Infinite\)] and wait\n                    add (answer) to [noteblocks v]\n                    ask [Select Type \(1 = Sound Effect, 2 = Instrument\)] and wait\n                    add (answer) to [noteblocks v]\n                    if <(answer) = [1]> then\n                        ask [Enter Sound Number] and wait\n                        add (answer) to [noteblocks v]\n                        add [] to [noteblocks v]\n                        add [] to [noteblocks v]\n                    else\n                        ask [Enter Note] and wait\n                        add (answer) to [noteblocks v]\n                        ask [Choose Instrument] and wait\n                        add (answer) to [noteblocks v]\n                        ask [Choose Length in Beats \(Tempo = 60\)] and wait\n                        add (answer) to [noteblocks v]\n                    end\n                    add [sound] to [actionhistory v]\n                end\n            end\n        end\n    else\n        stop [other scripts in sprite v]\n        broadcast (close_editor v) and wait\n        switch backdrop to (debug.refreshing v)\n        erase all\n        wait (1) seconds\n        broadcast (level_editor v)\n    end\nend\n\nwhen stage clicked\nif <(EDIT_MODE) = [1]> then\n    if <not <(TOOL) = [sound]>> then\n        if <mouse down?> then\n            wait (0.1) seconds\n            repeat until <not <mouse down?>>\n                play sound (pick random (1) to (2)) until done\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset [hard mode v] to [0]\nset [playtestorloaded? v] to [0]\nset [edit_mode v] to [0]\nswitch backdrop to (paper v)\nshow list [here is your level code v]\ndelete all of [actionhistory v]\n\nwhen I receive [level_editor v]\nstop [other scripts in sprite v]\nset [edit_mode v] to [1]\nforever\n    set bg (Background) (Hard Mode)\nend\n\nwhen I receive [close_editor v]\nset [edit_mode v] to [0]\nhide variable [hard mode v]\n\nwhen I receive [new_level v]\nset [music v] to [1]\nset [pens v] to [1]\nset [starting ink v] to [100]\nset [background v] to [1]\nset [boss battle v] to [0]\nset [no ink restart bonus v] to [25]\nset [hard mode v] to [0]\ndelete all of [enemyx v]\ndelete all of [enemyy v]\ndelete all of [inksize v]\ndelete all of [inkx v]\ndelete all of [inky v]\ndelete all of [penx v]\ndelete all of [peny v]\ndelete all of [pentype v]\ndelete all of [penink v]\n\nwhen [x v] key pressed\nwait until <not <key (x v) pressed?>>\nif <(Performance Mode) = [1]> then\n    set [performance mode v] to [0]\nelse\n    set [performance mode v] to [1]\nend\n\nwhen I receive [game start v]\nset bg (Background) (Hard Mode)\n\nwhen [v v] key pressed\nwait until <not <key (v v) pressed?>>\nif <(PlayTesting?) = [1]> then\n    broadcast (stopgame v) and wait\n    broadcast (testlevel v)\nend\n\nwhen [any v] key pressed\nif <key ((join [`] []) v) pressed?> then\n    wait until <not <key ((join [`] []) v) pressed?>>\n    if <(Rectangle Fill?) = [1]> then\n        set [rectangle fill? v] to [0]\n    else\n        set [rectangle fill? v] to [1]\n    end\nend\n\ndefine Auto Fix <do ink + type?>\nif <((length of [penx v]) mod (2)) = [1]> then\n    delete (last) of [penx v]\nend\nif <((length of [peny v]) mod (2)) = [1]> then\n    delete (last) of [peny v]\nend\nif <do ink + type?> then\n    if <((length of [penink v]) mod (2)) = [1]> then\n        delete (last) of [penink v]\n    end\n    if <((length of [pentype v]) mod (2)) = [1]> then\n        delete (last) of [pentype v]\n    end\nend\n\nwhen I receive [level_editor v]\nset [render_offsetx v] to [0]\nset [render_offsety v] to [0]\n\nwhen I receive [testlevel v]\nclear graphic effects\n\nwhen I receive [fadeout v]\n\ndefine set bg (bg) (hard?)\nif <(hard?) = [1]> then\n    if <(bg) = [1]> then\n        switch backdrop to (paper4 v)\n    else\n        if <(bg) = [2]> then\n            switch backdrop to (paper5 v)\n        else\n            switch backdrop to (paper6 v)\n        end\n    end\nelse\n    if <(bg) = [1]> then\n        switch backdrop to (paper v)\n    else\n        if <(bg) = [2]> then\n            switch backdrop to (paper2 v)\n        else\n            if <(bg) = [3]> then\n                switch backdrop to (paper3 v)\n            else\n                switch backdrop to (paper7 v)\n            end\n        end\n    end\nend\n\n@blank\n\n@player\n\ndefine start (start) end (end)\nadd (start) to [start v]\nadd (end) to [end v]\n\ndefine gravity\nswitch costume to (hitbox v)\nif <<([costume # v] of [level v]) > [43]> and <(inkless) = [false]>> then\n    if <(move right?) = [true]> then\n        change [x v] by (0.6)\n        turn right (4) degrees\n    end\nelse\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [x v] by (1)\n        turn right (6) degrees\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [x v] by (-1)\n        turn left (6) degrees\n    end\nend\nset [x v] to ((x) * (0.9))\nchange x by (x)\nif <touching color (#000000)?> then\n    change y by (1)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change x by ((x) * (-1))\n                        change y by (-5)\n                        if <key (up arrow v) pressed?> then\n                            set [x v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange [y v] by (-1)\nchange y by (y)\nif <touching color (#000000)?> then\n    change y by ((y) * (-1))\n    set [y v] to [0]\nend\nchange y by (-1)\nif <touching color (#000000)?> then\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        set [y v] to [12]\n        start sound [jump v]\n    end\nend\nchange y by (1)\nif <<([costume # v] of [level v]) > [43]> and <(inkless) = [false]>> then\n    switch costume to (join (costume) [a])\nelse\n    switch costume to (costume)\nend\n\nwhen I receive [level start v]\nif <<([costume # v] of [level v]) = [48]> or <([costume # v] of [level v]) = [49]>> then\n    set [move right? v] to [true]\n    wait (0.4) seconds\n    set [move right? v] to [false]\n    wait until <mouse down?>\n    wait until <not <mouse down?>>\n    set [move right? v] to [true]\nend\nif <([costume # v] of [level v]) = [50]> then\n    set [move right? v] to [true]\n    wait (0.4) seconds\n    set [move right? v] to [false]\n    wait until <([enemies v] of [pen v]) = [3]>\n    set [move right? v] to [true]\nend\nif <([costume # v] of [level v]) = [51]> then\n    set [move right? v] to [true]\n    wait (0.4) seconds\n    set [move right? v] to [false]\n    wait until <([scribble v] of [pen v]) > [220]>\n    repeat (10)\n        change size by (10)\n        change [ghost v] effect by (10)\n        change [brightness v] effect by (10)\n    end\n    go to x: (0) y: (-15)\n    broadcast (drain v)\n    repeat (10)\n        change size by (-10)\n        change [ghost v] effect by (-10)\n        change [brightness v] effect by (-10)\n    end\n    set size to (100) %\n    clear graphic effects\nend\nif <([costume # v] of [level v]) > [63]> then\n    go to x: (-215) y: (-50)\n    set [y v] to [0]\n    stop [other scripts in sprite v]\n    reset\nend\n\nwhen I receive [dust v]\nchange [y v] by (8)\n\nwhen I receive [game start v]\nreset timer\nset [inkless v] to [false]\nset [continue v] to [false]\nset [y v] to [-25]\nset [paused? v] to [false]\ngo to (spawnpoint v)\nreset\n\nwhen I receive ["the platformer" v]\ngo to x: (-240) y: (-50)\nshow\nglide (0.1) secs to x: (-130) y: (-50)\nglide (0.5) secs to x: (110) y: (-50)\nglide (0.35) secs to x: (160) y: (-50)\nglide (0.35) secs to x: (165) y: (-50)\nif <not <(Performance Mode) = [1]>> then\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\nend\nhide\n\nwait (1) seconds\nstart sound [fall v]\nglide (0.1) secs to x: (165) y: (-115)\nglide (0.05) secs to x: (165) y: (-190)\nbroadcast (game start v)\n\ndefine make lists\ndelete (all) of [start v]\ndelete (all) of [end v]\nstart (0) end (10)\nstart (10) end (90)\nstart (90) end (-50)\nstart (-50) end (-50)\nstart (-130) end (25)\nstart (-130) end (-130)\nstart (-100) end (-100)\nstart (-100) end (80)\nstart (-130) end (-130)\nstart (75) end (75)\nstart (0) end (0)\nstart (0) end (120)\nstart (-76) end (-76)\nrepeat (3)\n    start (0) end (0)\nend\nstart (-120) end (-120)\nstart (-50) end (-50)\nstart (0) end (-50)\nstart (-40) end (-40)\nstart (-40) end (25)\nstart (-120) end (-120)\nstart (-50) end (-50)\nstart (-50) end (-50)\nstart (-50) end (-50)\nstart (-45) end (35)\nstart (-50) end (-50)\nstart (80) end (80)\nstart (-100) end (40)\nstart (-50) end (-50)\nstart (-140) end (50)\nstart (0) end (0)\nstart (0) end (50)\nstart (-50) end (-50)\nstart (-50) end (-50)\nstart (0) end (100)\nstart (-80) end (-80)\nstart (125) end (-115)\nstart (55) end (80)\nstart (-90) end (0)\nstart (120) end (0)\nstart (0) end (10)\nstart (10) end (90)\nstart (-20) end (-20)\nstart (-60) end (-60)\nstart (-60) end (100)\nstart (-10) end (-10)\nrepeat (7)\n    start (-60) end (-60)\nend\nstart (-60) end (100)\nrepeat (3)\n    start (-60) end (-60)\nend\nstart (-20) end (-20)\nstart (100) end (-60)\nstart (-90) end (-90)\nrepeat (2)\n    start (-80) end (-80)\nend\nstart (-50) end (-50)\nstart (-50) end (-50)\n\nwhen [p v] key pressed\nif <([mode v] of [paused v]) = []> then\n    if <(paused?) = [false]> then\n        set [paused? v] to [true]\n    else\n        set [paused? v] to [false]\n    end\nend\n\nwhen I receive [red v]\nrepeat (5)\n    show\n    wait (0.03) seconds\n    hide\n    wait (0.03) seconds\nend\nshow\nset [invincible? v] to [false]\n\nwhen I receive [eraser gone v]\nset [continue v] to [true]\n\nwhen I receive [epilogue v]\nstop [other scripts in sprite v]\n\ndefine reset\nset [won? v] to [0]\nset [x v] to [0]\nset [invincible? v] to [false]\nset [move right? v] to [true]\nforever\n    if <(paused?) = [false]> then\n        gravity\n        if <(x position) > [240]> then\n            if <not <<([costume # v] of [level v]) = [40]> or <<([costume # v] of [level v]) = [64]> and <(continue) = [false]>>>> then\n                if <<([costume # v] of [level v]) = [57]> and <(y position) > [40]>> then\n                    set [won? v] to [1]\n                    broadcast (next level v) and wait\n                end\n                if <not <([eraser_gone? v] of [the eraser v]) = [0]>> then\n                    hide\n                    set [won? v] to [1]\n                    broadcast (next level v) and wait\n                    set [y v] to [0]\n                    set [paused? v] to [won]\n                end\n            end\n        end\n        if <(y position) < [-175]> then\n            if <([costume # v] of [level v]) = [40]> then\n                start sound [page v]\n                set [won? v] to [1]\n                broadcast (next level v) and wait\n                set [y v] to [0]\n                go to x: (0) y: ([y position v] of [spawnpoint v])\n            else\n                broadcast (level start v)\n                broadcast (red v)\n                start sound [hurt v]\n                set [y v] to [0]\n                go to (spawnpoint v)\n            end\n        end\n        if <<<<touching color (#ff0000)?> or <<touching color (#e50000)?> or <touching color (#ff3f3f)?>>> and <not <([costume # v] of [level v]) = [50]>>> and <(invincible?) = [false]>> then\n            wait (0.1) seconds\n            broadcast (red v)\n            broadcast (restartlevel v)\n            start sound [hurt v]\n            set [invincible? v] to [true]\n            set [y v] to [0]\n            go to (spawnpoint v)\n        end\n        if <touching color (#000000)?> then\n            set [on ground x v] to (x position)\n            set [on ground y v] to (y position)\n        end\n        if <<touching color (#00c205)?> and <not <([eraser_gone? v] of [the eraser v]) = [0]>>> then\n            hide\n            set [won? v] to [1]\n            broadcast (next level v) and wait\n            set [y v] to [0]\n            set [paused? v] to [won]\n        end\n    end\nend\n\nstart sound [page v]\nbroadcast (next level v) and wait\nset [y v] to [0]\ngo to x: (-215) y: (item ([costume # v] of [level v]) of [start v])\nbroadcast (skip v)\nwait until <not <key (z v) pressed?>>\n\nwhen I receive [game start v]\nmake lists\nset [costume v] to [1]\nforever\n    change [costume v] by (1)\n    if <(costume) = [5]> then\n        set [costume v] to [1]\n    end\n    wait (0.1) seconds\nend\n\nwhen [c v] key pressed\nif <<([mode v] of [paused v]) = []> and <(PlayTesting?) = [1]>> then\n    if <(paused?) = [help]> then\n        set [paused? v] to [false]\n    else\n        set [paused? v] to [help]\n    end\nend\n\nwhen I receive [drain v]\nrepeat until <key (r v) pressed?>\n    go to x: (0) y: (-15)\nend\nset [inkless v] to [true]\n\nwhen I receive [initalize v]\nset [ghost v] effect to (0)\nshow\n\nwhen I receive [level_editor v]\nrepeat until <(PlayTesting?) = [1]>\n    hide\n    stop [other scripts in sprite v]\nend\n\nwhen flag clicked\nset [playtesting? v] to [0]\nhide\nswitch costume to (1 v)\nset [paused? v] to [false]\npoint in direction (90)\n\nwhen I receive [stopgame v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [game start v]\nforever\n    if <key (r v) pressed?> then\n        if <(PlayTesting?) = [1]> then\n            set [x v] to [0]\n            set size to (100) %\n            clear graphic effects\n            show\n            start sound [restart v]\n            go to (spawnpoint v)\n            erase all\n            broadcast (level start v)\n            broadcast (redraw_level v)\n            broadcast (restartlevel v)\n            wait until <not <key (r v) pressed?>>\n        end\n    end\nend\n\nwhen I receive [lost v]\nstop [other scripts in sprite v]\nhide\nset [y v] to [0]\nset [paused? v] to [won]\n\n@level\n\nwhen I receive [game start v]\nset volume to (100) %\nforever\n    if <not <(Music) = [0]>> then\n        play sound (Music) until done\n    end\nend\n\nwhen I receive [previous level v]\nvisited\nswitch costume to ((costume [number v]) - (1))\nstamp\n\nwhen I receive [next level v]\nset [paused? v] to [true]\nvisited\nbroadcast (win v)\n\nwhen [r v] key pressed\nif <(opening) = [false]> then\n    stamp\nend\n\nwhen I receive [dust v]\nrepeat (3)\n    go to x: (pick random (-5) to (5)) y: (pick random (-5) to (5))\n    set [render_offsetx v] to (x position)\n    set [render_offsety v] to (y position)\n    broadcast (redraw_level v)\nend\nrepeat (2)\n    go to x: (pick random (-2) to (2)) y: (pick random (-2) to (2))\n    set [render_offsetx v] to (x position)\n    set [render_offsety v] to (y position)\n    broadcast (redraw_level v)\nend\ngo to x: (0) y: (0)\nbroadcast (redraw_level v)\n\nwhen I receive [game start v]\nset [opening v] to [false]\ngo to x: (0) y: (0)\nswitch costume to (1 v)\ngo to [back v] layer\nrepeat until <(EDIT_MODE) = [1]>\n    switch costume to ((Boss Battle) + (1))\n    stamp\nend\n\nwhen flag clicked\nset [opening v] to [true]\nswitch costume to (1 v)\nhide\nset [pitch v] effect to (0)\n\ndefine play (#) from (level 1) to (level 2)\nif <<((level 1) - (1)) < (costume [number v])> and <(costume [number v]) < (level 2)>> then\n    stop all sounds\n    set [music v] to (#)\n    wait until <not <<((level 1) - (1)) < (costume [number v])> and <(costume [number v]) < (level 2)>>>\nend\n\nwhen I receive [red v]\nerase all\nbroadcast (redraw_level v)\nstamp\n\ndefine visited\nif <not <[levels visited v] contains (costume [number v])?>> then\n    add (costume [number v]) to [levels visited v]\nend\nbroadcast (level start v)\n\nwhen I receive ["the platformer" v]\nwait (1.7) seconds\nset volume to (100) %\nforever\n    play sound [12 v] until done\nend\n\nwhen I receive [level_editor v]\nrepeat (10)\n    change volume by (-5)\nend\nstop [other scripts in sprite v]\nbroadcast (startMusicScripts v)\nstop all sounds\nset volume to (50) %\nforever\n    if <not <(Music) = [0]>> then\n        play sound (Music) until done\n    end\nend\n\ndefine stamp\nclear graphic effects\nstamp\n\nwhen I receive [close_editor v]\nstop [other scripts in sprite v]\nstop all sounds\n\nwhen I receive [stopgame v]\nstop [other scripts in sprite v]\nstop all sounds\n\nwhen I receive [stamp bossbar v]\nclear graphic effects\nstamp\nset [ghost v] effect to (99.99)\n\nforever\n    go to x: (pick random (-5) to (5)) y: (pick random (-5) to (5))\n    set [render_offsetx v] to (x position)\n    set [render_offsety v] to (y position)\n    broadcast (redraw_level v)\nend\n\nwhen I receive [fadeout v]\nrepeat (10)\n    change volume by (-10)\nend\n\nwhen I receive [startmusicscripts v]\nforever\n    if <(Hard Mode) = [1]> then\n        set [pitch v] effect to (pick random (55) to (65))\n    else\n        set [pitch v] effect to (0)\n    end\nend\n\nwhen I receive [game start v]\nforever\n    if <(Hard Mode) = [1]> then\n        set [pitch v] effect to (pick random (55) to (65))\n    else\n        set [pitch v] effect to (0)\n    end\nend\n\nwhen I receive [startmusicscripts v]\nforever\n    set [mus_oldid v] to (Music)\n    wait until <not <((Music) + (1)) = ((MUS_OLDID) + (1))>>\n    stop all sounds\nend\n\n@ink bar\n\nwhen I receive [stopgame v]\nstop [other scripts in sprite v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [game start v]\nswitch costume to (1 v)\nif <not <(fade?) = [0]>> then\n    set [ghost v] effect to (100)\n    show\n    repeat (100)\n        change [ghost v] effect by (-1)\n    end\nelse\n    show\nend\nforever\n    switch costume to ([color v] of [pen v])\nend\n\nwhen I receive [next level v]\nstop [other scripts in sprite v]\n\nwhen I receive [level_editor v]\nhide\n\n@ink bar black\n\nwhen I receive [stopgame v]\nstop [other scripts in sprite v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [game start v]\ngo to x: (-463) y: (0)\nset x to (((-311) + ((3.11) * (((100) - (Starting Ink)) + (4)))) * (1.6))\ngo to [front v] layer\nif <not <(fade?) = [0]>> then\n    set [ghost v] effect to (100)\n    show\n    repeat (100)\n        change [ghost v] effect by (-0.5)\n    end\nelse\n    set [ghost v] effect to (50)\n    show\nend\nforever\n    set x to (((-311) + ((3.11) * ((([ink v] of [percentage v]) + (1)) + (4)))) * (1.6))\n    if <(x position) > [10]> then\n        set x to (10)\n    end\nend\n\nwhen I receive [next level v]\nstop [other scripts in sprite v]\n\nwhen I receive [level_editor v]\nhide\n\n@red\n\nwhen I receive [stopgame v]\nstop [other scripts in sprite v]\nhide\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [game start v]\nforever\n    if <<([costume # v] of [percentage v]) > [80]> and <([costume # v] of [percentage v]) < [100]>> then\n        set [ghost v] effect to (100)\n        show\n        repeat (8)\n            change [ghost v] effect by (-2)\n        end\n        repeat (8)\n            change [ghost v] effect by (2)\n        end\n    end\nend\n\nwhen I receive [next level v]\nstop [other scripts in sprite v]\n\nwhen I receive [level_editor v]\nstop [other scripts in sprite v]\nhide\n\n@percentage\n\nwhen I receive [stopgame v]\nstop [other scripts in sprite v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [ink bubble v]\nrepeat (15)\n    if <not <(costume [number v]) = [1]>> then\n        change [ink v] by (-1)\n    end\nend\n\nwhen I receive [big bubble v]\nrepeat until <(costume [number v]) = [1]>\n    change [ink v] by (-1)\nend\n\nwhen [r v] key pressed\nwait (0.1) seconds\nif <(Hard Mode) = [0]> then\n    if <<(costume [number v]) = [101]> and <<([inkless v] of [player v]) = [false]> or <([costume # v] of [level v]) > [59]>>> then\n        repeat (No Ink Restart Bonus)\n            change [ink v] by (-1)\n        end\n    end\nend\n\nwhen I receive [red v]\nrepeat (5)\n    if <<(costume [number v]) < [101]> and <([mode v] of [paused v]) = []>> then\n        change [ink v] by (1)\n    end\nend\n\nwhen I receive [skip v]\nrepeat (15)\n    if <<(costume [number v]) < [101]> and <([mode v] of [paused v]) = []>> then\n        change [ink v] by (1)\n    end\nend\n\nwhen I receive [drain v]\nif <([mode v] of [paused v]) = []> then\n    repeat until <(costume [number v]) = [101]>\n        change [ink v] by (1)\n    end\nend\n\nwhen I receive [game start v]\ngo to x: (-15) y: (0)\nset [ink v] to ((100) - (Starting Ink))\nswitch costume to ((101) - (Starting Ink))\nif <not <(fade?) = [0]>> then\n    set [ghost v] effect to (100)\n    show\n    repeat (100)\n        change [ghost v] effect by (-1)\n    end\nelse\n    show\nend\nforever\n    if <([mode v] of [paused v]) = []> then\n        change [ink v] by ((Hard Mode) * (0.025))\n        if <(ink) > ((101) - (Hard Mode))> then\n            switch costume to (100 v)\n            start sound [hurt v]\n            broadcast (lost v)\n            broadcast (next level v)\n            stop [this script v]\n        end\n        switch costume to ((round (ink)) + (1))\n        go to [front v] layer\n        go [backward v] (1) layers\n        if <<<mouse down?> and <<(mouse y) < [180]> and <(mouse y) > [-180]>>> and <<(mouse x) < [240]> and <(costume [number v]) < [101]>>> then\n            set [x v] to (mouse x)\n            set [y v] to (mouse y)\n            set [difference v] to [0]\n            change [ink v] by (0.5)\n            wait (0.05) seconds\n            calculate difference\n            if <[100] > (ink)> then\n                if <([color v] of [pen v]) = [1]> then\n                    change [ink v] by ((difference) / (80))\n                else\n                    change [ink v] by ((difference) / (40))\n                end\n            else\n                set [ink v] to [100]\n            end\n        end\n    else\n        wait (0.05) seconds\n        calculate difference\n    end\n    if <([color v] of [pen v]) = [2]> then\n        set [brightness v] effect to (40)\n    else\n        if <([color v] of [pen v]) = [3]> then\n            set [brightness v] effect to (-10)\n        else\n            clear graphic effects\n        end\n    end\nend\n\nwhen I receive [epilogue v]\nstop [other scripts in sprite v]\n\ndefine calculate difference\nset [difference v] to (([abs v] of ((x) - (mouse x)) ) + ([abs v] of ((y) - (mouse y)) ))\n\nif <[0] > ((x) - (mouse x))> then\n    set [difference v] to (((x) - (mouse x)) * (-1))\nelse\n    set [difference v] to ((x) - (mouse x))\nend\nif <[0] > ((y) - (mouse y))> then\n    set [difference v] to ((difference) + (((y) - (mouse y)) * (-1)))\nelse\n    set [difference v] to ((difference) + ((y) - (mouse y)))\nend\n\nwhen I receive [next level v]\nstop [other scripts in sprite v]\n\nwhen I receive [level_editor v]\nhide\n\n@pen\n\nwhen I receive [stopgame v]\nstop [other scripts in sprite v]\nhide\n\nwhen flag clicked\nerase all\nhide\nerase all\n\nwhen [space v] key pressed\nchange [color v] by (1)\nif <(Hard Mode) = [0]> then\n    if <(Pens) > [2]> then\n        if <(color) > [3]> then\n            set [color v] to [1]\n        end\n    else\n        if <(Pens) > [1]> then\n            if <(color) > [2]> then\n                set [color v] to [1]\n            end\n        else\n            if <(color) > [1]> then\n                set [color v] to [1]\n            end\n        end\n    end\nelse\n    if <(color) > [3]> then\n        set [color v] to [1]\n    end\nend\nif <(color) = [1]> then\n    set pen color to (#000000)\n    set pen size to (4)\nend\nif <(color) = [2]> then\n    set pen color to (#ff3f3f)\n    set pen size to (4)\nend\nif <(color) = [3]> then\n    set pen color to (#e6e6e6)\n    set pen size to (12)\nend\n\nwhen I receive [level start v]\nset [scribble v] to [0]\nif <([costume # v] of [level v]) = [50]> then\n    set [draw enemies v] to [0]\n    set [enemies v] to [0]\n    repeat until <not <([costume # v] of [level v]) = [50]>>\n        if <<mouse down?> and <(color) = [2]>> then\n            change [draw enemies v] by ([difference v] of [percentage v])\n            if <<(draw enemies) > [100]> and <(enemies) < [3]>> then\n                change [enemies v] by (1)\n                set [draw enemies v] to [0]\n                erase all\n                broadcast (draw enemy v)\n            end\n        end\n    end\nend\n\nwhen I receive [game start v]\nshow\nset [color v] to [1]\nset pen color to (#000000)\nset pen size to (4)\nforever\n    go to (mouse-pointer v)\n    if <([paused? v] of [player v]) = [false]> then\n        if <<<mouse down?> and <<(mouse y) < [180]> and <(mouse y) > [-180]>>> and <<(mouse x) < [240]> and <([costume # v] of [percentage v]) < [100]>>> then\n            if <(color) = [1]> then\n                if <<([costume # v] of [level v]) = [51]> and <<(x position) > [-46]> and <<[46] > (x position)> and <<(y position) > [-55]> and <[25] > (y position)>>>>> then\n                    set pen size to (12)\n                    change [scribble v] by ([difference v] of [percentage v])\n                else\n                    set pen size to (4)\n                end\n            end\n            pen down\n        else\n            pen up\n        end\n    end\nend\n\nwhen I receive [next level v]\nstop [other scripts in sprite v]\n\nwhen I receive [level_editor v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [game start v]\nforever\n    repeat until <not <<<mouse down?> and <<(mouse y) < [180]> and <(mouse y) > [-180]>>> and <<(mouse x) < [240]> and <([costume # v] of [percentage v]) < [100]>>>>\n        if <<<mouse down?> and <<(mouse y) < [180]> and <(mouse y) > [-180]>>> and <<(mouse x) < [240]> and <([costume # v] of [percentage v]) < [100]>>> then\n            start sound (pick random (1) to (2))\n            if <<<mouse down?> and <<(mouse y) < [180]> and <(mouse y) > [-180]>>> and <<(mouse x) < [240]> and <([costume # v] of [percentage v]) < [100]>>> then\n                wait (0.4) seconds\n            end\n        end\n    end\nend\n\n@ink\n\nwhen I receive [stopgame v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\ngo to x: (x) y: (y)\npoint in direction (pick random (0) to (359))\nwait (pick random (0.1) to (0.9)) seconds\nswitch costume to (6 v)\nshow\nrepeat (5)\n    switch costume to ((costume [number v]) - (1))\n    wait (0.01) seconds\nend\nforever\n    repeat (5)\n        change y by (0.25)\n    end\n    repeat (10)\n        change y by (0.5)\n    end\n    repeat (5)\n        change y by (0.25)\n    end\n    repeat (5)\n        change y by (-0.25)\n    end\n    repeat (10)\n        change y by (-0.5)\n    end\n    repeat (5)\n        change y by (-0.25)\n    end\nend\n\ndefine level (level) x: (x) y: (y) size: (size)\nif <<([costume # v] of [level v]) = (level)> and <not <[levels visited v] contains (level)?>>> then\n    set [x v] to (x)\n    set [y v] to (y)\n    if <(size) = [1]> then\n        set size to (75) %\n        set [size v] to [75]\n    else\n        if <(size) = [2]> then\n            set size to (175) %\n            set [size v] to [175]\n        else\n            set size to (500) %\n            set [size v] to [500]\n        end\n    end\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        start sound [get v]\n        if <(size) = [75]> then\n            start sound [1 v]\n            broadcast (ink bubble v)\n        else\n            start sound [2 v]\n            broadcast (big bubble v)\n        end\n        repeat (5)\n            next costume\n            change size by (5)\n            change [ghost v] effect by (10)\n        end\n        if <(Boss Battle) = [1]> then\n            hide\n            set size to (size) %\n            clear graphic effects\n            wait (pick random (40) to (60)) seconds\n            switch costume to (6 v)\n            show\n            repeat (5)\n                switch costume to ((costume [number v]) - (1))\n                wait (0.01) seconds\n            end\n        else\n            if <([costume # v] of [level v]) = [65]> then\n                broadcast (epilogue v)\n            end\n            delete this clone\n        end\n    end\nend\n\nwhen I receive [next level v]\nwait (0.1) seconds\n\nwhen I receive [previous level v]\ndelete this clone\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I start as a clone\nwait (pick random (0.1) to (0.9)) seconds\nforever\n    repeat (5)\n        change [brightness v] effect by (0.25)\n    end\n    repeat (10)\n        change [brightness v] effect by (1)\n    end\n    repeat (5)\n        change [brightness v] effect by (0.25)\n    end\n    repeat (5)\n        change [brightness v] effect by (-0.25)\n    end\n    repeat (10)\n        change [brightness v] effect by (-1)\n    end\n    repeat (5)\n        change [brightness v] effect by (-0.25)\n    end\n    clear graphic effects\nend\n\nwhen I receive [game start v]\ndelete (all) of [levels visited v]\ndelete this clone\n\nwhen I receive [game start v]\nset [i v] to [0]\nrepeat (length of [inksize v])\n    change [i v] by (1)\n    level ((1) + (Boss Battle)) x: (item (i) of [inkx v]) y: (item (i) of [inky v]) size: (item (i) of [inksize v])\nend\nchange [i v] by (1)\n\nwhen I receive [level_editor v]\nhide\ndelete this clone\n\nwhen I receive [next level v]\nstop [other scripts in sprite v]\nif <((i) + (1)) = (length of [inksize v])> then\n    show\nend\ngo to x: (x) y: (y)\n\n@enemy\n\nwhen I receive [stopgame v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [draw enemy v]\nif <([enemies v] of [pen v]) = [1]> then\n    go to x: (mouse x) y: (mouse y)\nend\n\nwhen I receive [enemy beam v]\nif <([enemies v] of [the eraser v]) = [1]> then\n    go to x: ([x position v] of [the eraser v]) y: (([y position v] of [the eraser v]) - (50))\nend\n\nwhen I receive [dust v]\nchange [y v] by (8)\n\nwhen [r v] key pressed\ngo to x: (item (1) of [enemyx v]) y: (item (1) of [enemyy v])\n\nwhen I receive [level start v]\nswitch costume to (1 v)\n\nwhen I receive [game start v]\nif <[0] < (length of [enemyx v])> then\n    set [costume v] to [1]\n    switch costume to (1 v)\n    forever\n        change [costume v] by (1)\n        if <(costume) = [5]> then\n            set [costume v] to [1]\n        end\n        wait (0.1) seconds\n        if <(y position) < [-160]> then\n            set [x v] to [0]\n            set [y v] to [0]\n            go to x: (item ([costume # v] of [level v]) of [level x v]) y: (item ([costume # v] of [level v]) of [level y v])\n        end\n        if <<<touching color (#ff3f3f)?> and <not <([costume # v] of [level v]) = [50]>>> and <(costume [number v]) < [6]>> then\n            start sound [hurt v]\n            switch costume to (pop v)\n            wait (0.05) seconds\n            switch costume to (pop2 v)\n            wait (0.05) seconds\n            hide\n            set [current level v] to [0]\n            replace item (1) of [enemies v] with []\n        end\n    end\nend\n\nwhen I receive [game start v]\nif <[0] < (length of [enemyx v])> then\n    forever\n        if <<([paused? v] of [player v]) = [false]> and <[6] > (costume [number v])>> then\n            if <<<([costume # v] of [level v]) = (current level)> and <<not <<(current level) = [50]> or <(current level) = [64]>>> or <<(current level) = [50]> and <([enemies v] of [pen v]) > [0]>>>> or <<([costume # v] of [level v]) = [64]> and <(item (1) of [enemies v]) = [!]>>> then\n                show\n                switch costume to (hitbox v)\n                if <touching (_edge_ v)?> then\n                    set [movement v] to (pick random (1) to (2))\n                end\n                if <(movement) = [1]> then\n                    change [x v] by (0.5)\n                    turn right (4) degrees\n                end\n                if <(movement) = [2]> then\n                    change [x v] by (-0.5)\n                    turn left (4) degrees\n                end\n                set [x v] to ((x) * (0.9))\n                change x by (x)\n                if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                    change y by (1)\n                    if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                        change y by (1)\n                        if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                            change y by (1)\n                            if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                                change y by (1)\n                                if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                                    change y by (1)\n                                    if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                                        change x by ((x) * (-1))\n                                        change y by (-5)\n                                        if <(jump) = [1]> then\n                                            set [x v] to [0]\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n                change [y v] by (-1)\n                change y by (y)\n                if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                    change y by ((y) * (-1))\n                    set [y v] to [0]\n                end\n                change y by (-1)\n                if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                    if <(jump) = [1]> then\n                        set [y v] to [10]\n                    end\n                end\n                change y by (1)\n                switch costume to (costume)\n            else\n                hide\n            end\n        end\n    end\nend\n\nlevel [16] x: [0] y: [0]\nlevel [17] x: [-200] y: [0]\nlevel [18] x: [0] y: [0]\nlevel [19] x: [60] y: [0]\nlevel [20] x: [0] y: [0]\nlevel [21] x: [60] y: [50]\nlevel [22] x: [-75] y: [-60]\nlevel [23] x: [50] y: [0]\nlevel [23] x: [50] y: [0]\nlevel [24] x: [100] y: [0]\nlevel [28] x: [0] y: [15]\nlevel [30] x: [0] y: [0]\nlevel [31] x: [0] y: [30]\nlevel [33] x: [0] y: [0]\nlevel [50] x: [0] y: [0]\nlevel [53] x: [0] y: [0]\nlevel [61] x: [0] y: [0]\nlevel [64] x: [0] y: [0]\n\nwhen I receive [game start v]\nif <[0] < (length of [enemyx v])> then\n    level ((Boss Battle) + (1)) x: (item (1) of [enemyx v]) y: (item (1) of [enemyy v])\n    go to x: (item (1) of [enemyx v]) y: (item (1) of [enemyy v])\nend\n\nwhen I receive [level_editor v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [game start v]\nforever\n    if <([paused? v] of [player v]) = [false]> then\n        set [movement v] to (pick random (1) to (3))\n        if <(pick random (1) to (2)) = [1]> then\n            set [jump v] to [1]\n        end\n        wait (pick random (1) to (3)) seconds\n        set [jump v] to [0]\n    end\nend\n\nwhen I receive [red v]\nif <not <([costume # v] of [level v]) = [2]>> then\n    go to x: (item ([costume # v] of [level v]) of [level x v]) y: (item ([costume # v] of [level v]) of [level y v])\nend\n\nwhen I receive [next level v]\nstop [other scripts in sprite v]\n\ndefine level (#) x: (x) y: (y)\nreplace item (#) of [level x v] with (x)\nreplace item (#) of [level y v] with (y)\nif <([costume # v] of [level v]) = (#)> then\n    go to x: (x) y: (y)\n    show\nend\nset [current level v] to (#)\nwait until <not <([costume # v] of [level v]) = (#)>>\nhide\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\npoint in direction (90)\nset [x v] to [0]\nset [y v] to [0]\ndelete all of [level x v]\ndelete all of [level y v]\nrepeat (75)\n    add [] to [level x v]\n    add [] to [level y v]\nend\n\n@enemy2\n\nwhen I receive [stopgame v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [draw enemy v]\nif <([enemies v] of [pen v]) = [2]> then\n    go to x: (mouse x) y: (mouse y)\nend\n\nwhen I receive [enemy beam v]\nif <([enemies v] of [the eraser v]) = [2]> then\n    go to x: ([x position v] of [the eraser v]) y: (([y position v] of [the eraser v]) - (50))\nend\n\nwhen I receive [dust v]\nchange [y v] by (8)\n\nwhen [r v] key pressed\ngo to x: (item ([costume # v] of [level v]) of [level x v]) y: (item ([costume # v] of [level v]) of [level y v])\n\nwhen flag clicked\n\nwhen I receive [level start v]\nswitch costume to (1 v)\n\nwhen I receive [game start v]\nif <[1] < (length of [enemyx v])> then\n    level ((Boss Battle) + (1)) x: (item (2) of [enemyx v]) y: (item (2) of [enemyy v])\n    go to x: (item (2) of [enemyx v]) y: (item (2) of [enemyy v])\nend\n\nwhen I receive [game start v]\nif <[1] < (length of [enemyx v])> then\n    set [costume v] to [1]\n    switch costume to (1 v)\n    forever\n        change [costume v] by (1)\n        if <(costume) = [5]> then\n            set [costume v] to [1]\n        end\n        wait (0.1) seconds\n        if <(y position) < [-160]> then\n            set [x v] to [0]\n            set [y v] to [0]\n            go to x: (item ([costume # v] of [level v]) of [level x v]) y: (item ([costume # v] of [level v]) of [level y v])\n        end\n        if <<<touching color (#ff3f3f)?> and <not <([costume # v] of [level v]) = [50]>>> and <(costume [number v]) < [6]>> then\n            start sound [hurt v]\n            switch costume to (pop v)\n            wait (0.05) seconds\n            switch costume to (pop2 v)\n            wait (0.05) seconds\n            hide\n            set [current level v] to [0]\n            replace item (2) of [enemies v] with []\n        end\n    end\nend\n\nwhen I receive [game start v]\nif <[1] < (length of [enemyx v])> then\n    forever\n        if <<([paused? v] of [player v]) = [false]> and <[6] > (costume [number v])>> then\n            if <<<([costume # v] of [level v]) = (current level)> and <<not <<(current level) = [50]> or <(current level) = [64]>>> or <<(current level) = [50]> and <([enemies v] of [pen v]) > [1]>>>> or <<([costume # v] of [level v]) = [64]> and <(item (2) of [enemies v]) = [!]>>> then\n                show\n                switch costume to (costume1 v)\n                if <touching (_edge_ v)?> then\n                    set [movement v] to (pick random (1) to (2))\n                end\n                if <(movement) = [1]> then\n                    change [x v] by (0.5)\n                    turn right (4) degrees\n                end\n                if <(movement) = [2]> then\n                    change [x v] by (-0.5)\n                    turn left (4) degrees\n                end\n                set [x v] to ((x) * (0.9))\n                change x by (x)\n                if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                    change y by (1)\n                    if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                        change y by (1)\n                        if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                            change y by (1)\n                            if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                                change y by (1)\n                                if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                                    change y by (1)\n                                    if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                                        change x by ((x) * (-1))\n                                        change y by (-5)\n                                        if <(jump) = [1]> then\n                                            set [x v] to [0]\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n                change [y v] by (-1)\n                change y by (y)\n                if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                    change y by ((y) * (-1))\n                    set [y v] to [0]\n                end\n                change y by (-1)\n                if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                    if <(jump) = [1]> then\n                        set [y v] to [10]\n                    end\n                end\n                change y by (1)\n                switch costume to (costume)\n            else\n                hide\n            end\n        end\n    end\nend\n\nwhen I receive [level_editor v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [game start v]\nforever\n    if <([paused? v] of [player v]) = [false]> then\n        set [movement v] to (pick random (1) to (3))\n        if <(pick random (1) to (2)) = [1]> then\n            set [jump v] to [1]\n        end\n        wait (pick random (1) to (3)) seconds\n        set [jump v] to [0]\n    end\nend\n\nwhen I receive [next level v]\nstop [other scripts in sprite v]\n\nforever\n    level [16] x: [-45] y: [0]\n    level [17] x: [-200] y: [30]\n    level [18] x: [-50] y: [30]\n    level [19] x: [-130] y: [-10]\n    level [21] x: [-130] y: [-10]\n    level [22] x: [75] y: [-100]\n    level [23] x: [0] y: [0]\n    level [24] x: [-100] y: [0]\n    level [31] x: [0] y: [-30]\n    level [50] x: [0] y: [-30]\n    level [53] x: [0] y: [30]\n    level [61] x: [0] y: [30]\n    level [64] x: [0] y: [30]\nend\n\nwhen I receive [red v]\nif <not <([costume # v] of [level v]) = [2]>> then\n    go to x: (item ([costume # v] of [level v]) of [level x v]) y: (item ([costume # v] of [level v]) of [level y v])\nend\n\ndefine level (#) x: (x) y: (y)\nreplace item (#) of [level x v] with (x)\nreplace item (#) of [level y v] with (y)\nif <([costume # v] of [level v]) = (#)> then\n    go to x: (x) y: (y)\n    show\nend\nset [current level v] to (#)\nwait until <not <([costume # v] of [level v]) = (#)>>\nhide\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\npoint in direction (90)\nset [x v] to [0]\nset [y v] to [0]\ndelete all of [level x v]\ndelete all of [level y v]\nrepeat (40)\n    add [] to [level x v]\n    add [] to [level y v]\nend\n\n@enemy3\n\nwhen I receive [draw enemy v]\nif <([enemies v] of [pen v]) = [3]> then\n    go to x: (mouse x) y: (mouse y)\nend\n\nwhen I receive [enemy beam v]\nif <([enemies v] of [the eraser v]) = [3]> then\n    go to x: ([x position v] of [the eraser v]) y: (([y position v] of [the eraser v]) - (50))\nend\n\nwhen I receive [dust v]\nchange [y v] by (8)\n\nwhen [r v] key pressed\ngo to x: (item ([costume # v] of [level v]) of [level x v]) y: (item ([costume # v] of [level v]) of [level y v])\n\nwhen I receive [level start v]\nswitch costume to (1 v)\n\nwhen I receive [game start v]\nif <[2] < (length of [enemyx v])> then\n    level ((Boss Battle) + (1)) x: (item (3) of [enemyx v]) y: (item (3) of [enemyy v])\n    go to x: (item (3) of [enemyx v]) y: (item (3) of [enemyy v])\nend\n\nwhen I receive [game start v]\nif <[2] < (length of [enemyx v])> then\n    set [costume v] to [1]\n    switch costume to (1 v)\n    forever\n        change [costume v] by (1)\n        if <(costume) = [5]> then\n            set [costume v] to [1]\n        end\n        wait (0.1) seconds\n        if <(y position) < [-160]> then\n            set [x v] to [0]\n            set [y v] to [0]\n            go to x: (item ([costume # v] of [level v]) of [level x v]) y: (item ([costume # v] of [level v]) of [level y v])\n        end\n        if <<<touching color (#ff3f3f)?> and <not <([costume # v] of [level v]) = [50]>>> and <(costume [number v]) < [6]>> then\n            start sound [hurt v]\n            switch costume to (pop v)\n            wait (0.05) seconds\n            switch costume to (pop2 v)\n            wait (0.05) seconds\n            hide\n            set [current level v] to [0]\n            replace item (3) of [enemies v] with []\n        end\n    end\nend\n\nwhen I receive [game start v]\nif <[2] < (length of [enemyx v])> then\n    forever\n        if <<([paused? v] of [player v]) = [false]> and <[6] > (costume [number v])>> then\n            if <<<([costume # v] of [level v]) = (current level)> and <<not <<(current level) = [50]> or <(current level) = [64]>>> or <<(current level) = [50]> and <([enemies v] of [pen v]) > [2]>>>> or <<([costume # v] of [level v]) = [64]> and <(item (3) of [enemies v]) = [!]>>> then\n                show\n                switch costume to (costume1 v)\n                if <touching (_edge_ v)?> then\n                    set [movement v] to (pick random (1) to (2))\n                end\n                if <(movement) = [1]> then\n                    change [x v] by (0.5)\n                    turn right (4) degrees\n                end\n                if <(movement) = [2]> then\n                    change [x v] by (-0.5)\n                    turn left (4) degrees\n                end\n                set [x v] to ((x) * (0.9))\n                change x by (x)\n                if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                    change y by (1)\n                    if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                        change y by (1)\n                        if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                            change y by (1)\n                            if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                                change y by (1)\n                                if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                                    change y by (1)\n                                    if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                                        change x by ((x) * (-1))\n                                        change y by (-5)\n                                        if <(jump) = [1]> then\n                                            set [x v] to [0]\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n                change [y v] by (-1)\n                change y by (y)\n                if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                    change y by ((y) * (-1))\n                    set [y v] to [0]\n                end\n                change y by (-1)\n                if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                    if <(jump) = [1]> then\n                        set [y v] to [10]\n                    end\n                end\n                change y by (1)\n                switch costume to (costume)\n            else\n                hide\n            end\n        end\n    end\nend\n\ngo to x: (item (3) of [end v]) y: (item (3) of [end v])\n\nwhen I receive [level_editor v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [game start v]\nforever\n    if <([paused? v] of [player v]) = [false]> then\n        set [movement v] to (pick random (1) to (3))\n        if <(pick random (1) to (2)) = [1]> then\n            set [jump v] to [1]\n        end\n        wait (pick random (1) to (3)) seconds\n        set [jump v] to [0]\n    end\nend\n\nwhen I receive [stopgame v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [next level v]\nstop [other scripts in sprite v]\n\nforever\n    level [16] x: [45] y: [0]\n    level [18] x: [50] y: [0]\n    level [23] x: [-50] y: [0]\n    level [31] x: [190] y: [0]\n    level [50] x: [0] y: [0]\n    level [61] x: [15] y: [15]\n    level [64] x: [15] y: [15]\nend\n\nwhen I receive [red v]\nif <not <([costume # v] of [level v]) = [2]>> then\n    go to x: (item ([costume # v] of [level v]) of [level x v]) y: (item ([costume # v] of [level v]) of [level y v])\nend\n\ndefine level (#) x: (x) y: (y)\nreplace item (#) of [level x v] with (x)\nreplace item (#) of [level y v] with (y)\nif <([costume # v] of [level v]) = (#)> then\n    go to x: (x) y: (y)\n    show\nend\nset [current level v] to (#)\nwait until <not <([costume # v] of [level v]) = (#)>>\nhide\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\npoint in direction (90)\nset [x v] to [0]\nset [y v] to [0]\ndelete all of [level x v]\ndelete all of [level y v]\nrepeat (40)\n    add [] to [level x v]\n    add [] to [level y v]\nend\n\n@text\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [drain v]\ncreate clone of (_myself_ v)\nnext []\nwait (5) seconds\nnext []\nwait (5) seconds\nnext []\n\ndefine next (#)\nwait until <([paused? v] of [player v]) = [false]>\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nif <(#) = []> then\n    next costume\nelse\n    switch costume to (#)\nend\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nclear graphic effects\n\nwhen I receive [drain v]\nwait until <key (r v) pressed?>\nstop [other scripts in sprite v]\nnext [5]\n\nwhen I receive [next level v]\nwait (0.1) seconds\nif <([costume # v] of [level v]) = [51]> then\n    switch costume to (1 v)\n    go to [front v] layer\n    show\nelse\n    if <([costume # v] of [level v]) = [64]> then\n        switch costume to (eraser v)\n        go to [front v] layer\n        show\n    else\n        hide\n    end\nend\n\nwhen I start as a clone\nswitch costume to (glow v)\nset [ghost v] effect to (25)\nrepeat until <<([costume # v] of [percentage v]) = [101]> or <([mode v] of [paused v]) = [speedrun]>>\n    repeat (10)\n        change [ghost v] effect by (5)\n        change [ghost v] effect by (pick random (-20) to (20))\n    end\n    repeat (10)\n        change [ghost v] effect by (-5)\n        change [ghost v] effect by (pick random (-20) to (20))\n    end\nend\nhide\ndelete this clone\n\nwhen I receive [eraser gone v]\nnext [eraser gone]\n\n@the eraser\n\nwhen flag clicked\ndelete all of [enemies v]\nhide\nswitch costume to (still v)\n\nwhen I receive [start boss pattern v]\ngo to [front v] layer\nshow\nrepeat (pick random (1) to (4))\n    switch costume to (fly right v)\n    repeat until <(x position) > [155]>\n        change x by (10)\n    end\n    switch costume to (still v)\n    repeat until <(x position) > [185]>\n        change x by (5)\n    end\n    switch costume to (fly left v)\n    repeat until <[-155] > (x position)>\n        change x by (-10)\n    end\n    switch costume to (still v)\n    repeat until <[-185] > (x position)>\n        change x by (-5)\n    end\nend\nswitch costume to (fly right v)\nset [player x v] to ([on ground x v] of [player v])\nset [player y v] to ([on ground y v] of [player v])\nrepeat until <(x position) > (player x)>\n    change x by (10)\nend\nswitch costume to (still v)\nif <(pick random (1) to (3)) = [1]> then\n    stomp\nelse\n    if <<(pick random (1) to (2)) = [1]> or <<(item (1) of [enemies v]) = [!]> and <<(item (2) of [enemies v]) = [!]> and <(item (3) of [enemies v]) = [!]>>>> then\n        repeat (3)\n            shake\n        end\n        repeat (4)\n            create clone of (mini-erasers v)\n            repeat (5)\n                change x by (10)\n            end\n        end\n        if <(pick random (1) to (2)) = [1]> then\n            repeat until <(player x) > (x position)>\n                change x by (-10)\n            end\n            stomp\n        end\n    else\n        repeat (5)\n            shake\n        end\n        switch costume to (laser1 v)\n        wait (0.05) seconds\n        if <(item (1) of [enemies v]) = []> then\n            replace item (1) of [enemies v] with [!]\n        else\n            if <(item (2) of [enemies v]) = []> then\n                replace item (2) of [enemies v] with [!]\n            else\n                replace item (3) of [enemies v] with [!]\n            end\n        end\n        broadcast (enemy beam v)\n        repeat (3)\n            switch costume to (laser2 v)\n            wait (0.05) seconds\n            switch costume to (laser3 v)\n            wait (0.05) seconds\n            switch costume to (laser4 v)\n            wait (0.05) seconds\n        end\n        switch costume to (laser5 v)\n        wait (0.05) seconds\n        if <(pick random (1) to (2)) = [1]> then\n            stomp\n        end\n    end\nend\nbroadcast (start boss pattern v)\n\ndefine shake\nset [shake x v] to (x position)\nset [shake y v] to (y position)\nrepeat (2)\n    go to x: ((shake x) + (pick random (-15) to (15))) y: ((shake y) + (pick random (-15) to (15)))\nend\nrepeat (3)\n    go to x: ((shake x) + (pick random (-5) to (5))) y: ((shake y) + (pick random (-5) to (5)))\nend\nrepeat (2)\n    go to x: ((shake x) + (pick random (-2) to (2))) y: ((shake y) + (pick random (-2) to (2)))\nend\n\ndefine stomp\nswitch costume to (still field going v)\nwait (0.05) seconds\nswitch costume to (still no field v)\nrepeat (5)\n    shake\nend\nswitch costume to (stomp v)\nstart sound [whoosh v]\nrepeat until <(player y) > (y position)>\n    change y by (-10)\nend\nstart sound [stomp v]\nbroadcast (dust v)\nshake\nswitch costume to (still no field v)\nglide (1) secs to x: (x position) y: (85)\n\nwhen I receive [game start v]\nwait (0.1) seconds\nset [eraser_gone? v] to [1]\nif <(Boss Battle) = [1]> then\n    set [eraser_gone? v] to [0]\n    set [health v] to [0]\n    go to x: (0) y: (85)\n    set size to (75) %\n    clear graphic effects\n    show\n    broadcast (start boss pattern v)\nend\n\nrepeat (3)\n    add [] to [enemies v]\nend\n\nwhen I receive [game start v]\nhide\n\nwhen I receive [epilogue v]\nstop [other scripts in sprite v]\n\nwhen I receive [start boss pattern v]\nforever\n    if <not <([paused? v] of [player v]) = [false]>> then\n        stop [other scripts in sprite v]\n        wait until <([paused? v] of [player v]) = [false]>\n        broadcast (start boss pattern v)\n    end\nend\n\nwhen I receive [start boss pattern v]\nforever\n    wait until <<touching color (#ff3d3d)?> and <<(costume [number v]) = [5]> or <(costume [number v]) = [6]>>>\n    stop [other scripts in sprite v]\n    switch costume to (hurt v)\n    create clone of (dust v)\n    erase all\n    broadcast (redraw_level v)\n    broadcast (stamp v)\n    if <[100] > (health)> then\n        start sound [hurt v]\n        repeat (20)\n            change [health v] by (0.5)\n            change [ghost v] effect by (5)\n            change size by (2)\n        end\n        wait (2) seconds\n        go to x: (0) y: (85)\n        switch costume to (still v)\n        repeat (20)\n            change [ghost v] effect by (-5)\n            change size by (-2)\n        end\n        broadcast (start boss pattern v)\n    else\n        switch costume to (hurt2 v)\n        start sound [hurt2 v]\n        repeat (6)\n            wait (0.1) seconds\n            change [brightness v] effect by (3)\n            next costume\n        end\n        start sound [boom v]\n        repeat (6)\n            wait (0.03) seconds\n            change [brightness v] effect by (4)\n            change [ghost v] effect by (15)\n            next costume\n        end\n        wait (0.1) seconds\n        hide\n        broadcast (eraser gone v)\n        set [eraser_gone? v] to [1]\n    end\nend\n\nwhen I receive [return_editor v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [level_editor v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [stopgame v]\nstop [other scripts in sprite v]\nhide\n\n@dust\n\nwhen flag clicked\nhide\n\nwhen I receive [dust v]\ncreate clone of (_myself_ v)\ngo to (the eraser v)\nchange y by (-50)\nswitch costume to (costume1 v)\nshow\nwait (0.05) seconds\nrepeat (5)\n    next costume\n    wait (0.05) seconds\nend\nhide\n\nwhen I start as a clone\ngo to (the eraser v)\nswitch costume to (costume7 v)\ngo to [back v] layer\nset size to (1) %\nshow\nrepeat (30)\n    change size by (3)\n    change [ghost v] effect by (3)\nend\ndelete this clone\n\n@health bar\n\nwhen flag clicked\nhide\n\nwhen I receive [game start v]\nwait (0.1) seconds\nif <(Boss Battle) = [1]> then\n    show\n    go to [front v] layer\n    set [ghost v] effect to (50)\n    go to x: (0) y: (0)\n    forever\n        set x to (((-311) + ((3.11) * (([health v] of [the eraser v]) + (4)))) * (1.6))\n        if <(x position) > [10]> then\n            set x to (10)\n        end\n        if <([health v] of [the eraser v]) > [99]> then\n            set x to (15)\n        end\n    end\nelse\n    hide\nend\n\nwhen I receive [level_editor v]\nhide\nstop [other scripts in sprite v]\n\n@mini-erasers\n\nwhen I start as a clone\ngo to (the eraser v)\nswitch costume to (eraser v)\nshow\nrepeat until <<<touching (player v)?> or <touching color (#ff3f3f)?>> or <(timer) > [20]>>\n    if <([paused? v] of [player v]) = [false]> then\n        point towards (player v)\n        move (3) steps\n    end\nend\npoint towards (player v)\nmove (3) steps\nwait (0.2) seconds\nswitch costume to (pop v)\nwait (0.1) seconds\nswitch costume to (pop2 v)\nwait (0.1) seconds\ndelete this clone\n\nwhen I start as a clone\nset [timer v] to [0]\nforever\n    if <([paused? v] of [player v]) = [false]> then\n        wait (1) seconds\n        change [timer v] by (1)\n    end\nend\n\nwhen I receive [level_editor v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [return_editor v]\nstop [other scripts in sprite v]\nhide\n\n@title\n\nwhen flag clicked\nset [devmode? v] to [0]\nset [clicks: v] to [0]\ngo to x: (0) y: (0)\nhide\nbroadcast (EOS Continue v)\n\nwhen I receive [game start v]\nhide\n\ndefine change costume (#) times\nchange [i v] by (1)\nif <not <(Performance Mode) = [1]>> then\n    start sound (pick random (2) to (3))\n    repeat (#)\n        switch costume to ((costume [number v]) - (1))\n    end\n    stop all sounds\n    wait (0.05) seconds\nelse\n    start sound (pick random (2) to (3))\n    switch costume to ((costume [number v]) - (#))\n    wait (item (i) of [timer v]) seconds\n    stop all sounds\nend\n\nwhen I receive [level_editor v]\nif <not <(Performance Mode) = [1]>> then\n    set [speed v] to [0]\n    repeat until <(speed) = [9]>\n        change y by (speed)\n        change [ghost v] effect by ((speed) * (3))\n        change [speed v] by (1)\n    end\n    hide\nelse\n    hide\nend\n\nwhen this sprite clicked\nchange [clicks: v] by (1)\nif <[9] < (clicks:)> then\n    set [devmode? v] to [1]\nend\n\nwhen backdrop switches to [white v]\nhide\n\nwhen I receive [eos continue v]\nset [i v] to [0]\nwait (0.1) seconds\nswitch costume to (80 v)\nshow\nchange costume [16] times\nchange costume [11] times\nchange costume [18] times\nchange costume [8] times\nchange costume [11] times\nbroadcast ("the platformer" v)\nwait (0.15) seconds\nchange costume [15] times\nwait (1) seconds\nbroadcast (startmove v)\nif <not <(Performance Mode) = [1]>> then\n    set [speed v] to [0]\n    repeat until <(speed) = [9]>\n        change y by (speed)\n        change [speed v] by (1)\n    end\n    broadcast (buttons v)\n    repeat until <(speed) = [0]>\n        change y by (speed)\n        change [speed v] by (-1)\n    end\nelse\n    broadcast (buttons v)\n    go to x: (0) y: (81)\nend\n\n@paused\n\nwhen flag clicked\nset [ghost v] effect to (35)\nhide variable [time v]\nhide variable [hurt v]\nset [hurt v] to [0]\nset [mode v] to []\nforever\n    if <([paused? v] of [player v]) = [help]> then\n        show\n        switch costume to (white v)\n        go to [front v] layer\n        set [costume v] to (([costume # v] of [level v]) + (9))\n        create clone of (_myself_ v)\n        wait until <not <([paused? v] of [player v]) = [help]>>\n    else\n        if <([paused? v] of [player v]) = [true]> then\n            show\n            switch costume to (paused v)\n            go to [front v] layer\n        else\n            hide\n            go to [back v] layer\n        end\n    end\nend\n\nwhen I receive [epilogue v]\nstop [other scripts in sprite v]\ntime\nset [hurt v] to (join (hurt) [ times])\nif <(mode) = []> then\n    if <(☁ fastest time) > (timer)> then\n        set [☁ fastest time v] to (timer)\n    end\nelse\n    if <(☁ fastest time \(speedrun\)) > (timer)> then\n        set [☁ fastest time \(speedrun\) v] to (timer)\n    end\nend\nset [ghost v] effect to (100)\nswitch costume to (white v)\ngo to [front v] layer\nshow\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\nif <(mode) = []> then\n    set [costume v] to [3]\n    repeat (7)\n        create clone of (_myself_ v)\n        change [costume v] by (1)\n        wait (3) seconds\n    end\nelse\n    set [costume v] to [3]\n    create clone of (_myself_ v)\n    if <(time) = [15:00]> then\n        set [costume v] to [11]\n        create clone of (_myself_ v)\n    else\n        set [costume v] to [12]\n        create clone of (_myself_ v)\n    end\nend\nwait until <mouse down?>\nwait until <not <mouse down?>>\nbroadcast (game start v)\nset [mode v] to [speedrun]\nswitch costume to (speedrun v)\nshow\nwait (3) seconds\nhide\n\nwhen I start as a clone\nswitch costume to (costume)\ngo to [front v] layer\nif <(costume) = [3]> then\n    show variable [time v]\n    show variable [hurt v]\nelse\n    if <(costume) < [10]> then\n        set [ghost v] effect to (100)\n        repeat (50)\n            change [ghost v] effect by (-0.5)\n        end\n        repeat (50)\n            change [ghost v] effect by (-1.5)\n        end\n    else\n        clear graphic effects\n        wait until <not <([paused? v] of [player v]) = [help]>>\n        delete this clone\n    end\nend\n\nwhen I receive [red v]\nchange [hurt v] by (1)\n\nwhen I receive [game start v]\nhide variable [hurt v]\ndelete this clone\n\nwhen I receive [game start v]\nif <(mode) = [speedrun]> then\n    forever\n        time\n        if <(time) = [15:00]> then\n            stop [other scripts in sprite v]\n            broadcast (epilogue v)\n        end\n    end\nend\n\ndefine time\nif <(length of (round ((timer) - (([floor v] of ((timer) / (60)) ) * (60))))) = [1]> then\n    set [time v] to (join ([floor v] of ((timer) / (60)) ) (join [:] (join [0] (round ((timer) - (([floor v] of ((timer) / (60)) ) * (60)))))))\nelse\n    set [time v] to (join ([floor v] of ((timer) / (60)) ) (join [:] (round ((timer) - (([floor v] of ((timer) / (60)) ) * (60))))))\nend\n\nwhen [p v] key pressed\nif <(mode) = [speedrun]> then\n    broadcast (game start v)\nend\n\n@buttons\n\nwhen I receive [buttons v]\ngo to x: (0) y: (-50)\nset [id v] to [1]\nset [type v] to [hitbox]\nswitch costume to (hitbox v)\ncreate clone of (_myself_ v)\nset [type v] to [label]\nswitch costume to (new v)\ncreate clone of (_myself_ v)\ngo to x: (0) y: (-115)\nset [id v] to [2]\nset [type v] to [hitbox]\nswitch costume to (hitbox v)\ncreate clone of (_myself_ v)\nset [type v] to [label]\nswitch costume to (load v)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nif <(type) = [hitbox]> then\n    set [ghost v] effect to (99.9)\n    show\n    go to [front v] layer\nelse\n    show\n    if <not <(Performance Mode) = [1]>> then\n        set [ghost v] effect to (100)\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n    end\nend\n\nwhen this sprite clicked\nif <(type) = [hitbox]> then\n    if <(id) = [1]> then\n        hide\n        broadcast (new_level v)\n        if <([toggle? v] of [tutorial v]) = [1]> then\n            broadcast (editor.tutorial v)\n        else\n            broadcast (level_editor v)\n        end\n    else\n        hide\n        broadcast (new_level v)\n        ask [Input the Level Code.] and wait\n        set [save code v] to (answer)\n        if <not <<[29] < (length of (answer))> and < (answer) contains [_]?>>> then\n            show\n            say [Loading aborted, invalid level!] for (3) seconds\n            stop [this script v]\n        end\n        ask [Do you want to \(e\)dit the level or \(p\)lay the level?] and wait\n        if <not <<(answer) = [e]> or <(answer) = [p]>>> then\n            repeat until <<(answer) = [e]> or <(answer) = [p]>>\n                ask [Invalid answer! Do you want to \(e\)dit or \(p\)lay the level?] and wait\n            end\n        end\n        broadcast (Load Save Code v) and wait\n        BeginDumpSaveData\n        RefreshSettingsDisplay\n        if <(answer) = [e]> then\n            broadcast (level_editor v)\n        else\n            set [playtestorloaded? v] to [2]\n            broadcast (fadeOUT v)\n        end\n    end\nend\n\nwhen I receive [level_editor v]\nif <not <(Performance Mode) = [1]>> then\n    set [speed v] to [0]\n    repeat until <(speed) = [-9]>\n        change y by (speed)\n        change [ghost v] effect by ((speed) * (-2))\n        change [speed v] by (-1)\n    end\n    hide\nelse\n    hide\nend\ndelete this clone\n\nwhen I receive [game start v]\nhide\n\nwhen flag clicked\nset [loadedlevel? v] to [0]\n\ndefine RefreshSettingsDisplay\nset [music v] to (Music)\nset [pens v] to (Pens)\nset [starting ink v] to (Starting Ink)\nset [background v] to (Background)\nset [boss battle v] to (Boss Battle)\n\ndefine BeginDumpSaveData\nif <not <(letter (1) of (Save Code Data)) = [v]>> then\n    DumpDataInCompatibiliityMode [1]\nelse\n    if <(letter (2) of (Save Code Data)) = [3]> then\n        DumpDataInCompatibiliityMode [2]\n    else\n        if <(letter (2) of (Save Code Data)) = [5]> then\n            DumpDataInCompatibiliityMode [0]\n        else\n            if <not <(letter (2) of (Save Code Data)) = [4]>> then\n                DumpDataInCompatibiliityMode [3]\n            else\n                DumpDataInCompatibiliityMode [4]\n            end\n        end\n    end\nend\n\ndefine DumpDataInCompatibiliityMode (mode)\nset [hard mode v] to [0]\nif <(mode) = [0]> then\n    set [j v] to [10]\n    set [i v] to ((j) + (10))\n    set [music v] to (item (2) of [save code data v])\n    set [pens v] to (item (3) of [save code data v])\n    set [starting ink v] to (item (4) of [save code data v])\n    set [background v] to (item (5) of [save code data v])\n    set [boss battle v] to (item (6) of [save code data v])\n    broadcast (updateSavePosits v)\n    set [details_basket v] to (item (8) of [save code data v])\n    broadcast (LoadDetailsCode v)\n    set [no ink restart bonus v] to (item (9) of [save code data v])\n    set [hard mode v] to (item (10) of [save code data v])\n    repeat (item ((j) + (1)) of [save code data v])\n        change [i v] by (1)\n        add (item (i) of [save code data v]) to [penx v]\n    end\n    repeat (item ((j) + (2)) of [save code data v])\n        change [i v] by (1)\n        add (item (i) of [save code data v]) to [peny v]\n    end\n    repeat (item ((j) + (3)) of [save code data v])\n        change [i v] by (1)\n        add (item (i) of [save code data v]) to [pentype v]\n    end\n    repeat (item ((j) + (4)) of [save code data v])\n        change [i v] by (1)\n        add (item (i) of [save code data v]) to [penink v]\n    end\n    repeat (item ((j) + (5)) of [save code data v])\n        change [i v] by (1)\n        add (item (i) of [save code data v]) to [enemyx v]\n    end\n    repeat (item ((j) + (6)) of [save code data v])\n        change [i v] by (1)\n        add (item (i) of [save code data v]) to [enemyy v]\n    end\n    repeat (item ((j) + (7)) of [save code data v])\n        change [i v] by (1)\n        add (item (i) of [save code data v]) to [inkx v]\n    end\n    repeat (item ((j) + (8)) of [save code data v])\n        change [i v] by (1)\n        add (item (i) of [save code data v]) to [inky v]\n    end\n    repeat (item ((j) + (9)) of [save code data v])\n        change [i v] by (1)\n        add (item (i) of [save code data v]) to [inksize v]\n    end\n    repeat (item ((j) + (10)) of [save code data v])\n        change [i v] by (1)\n        add (item (i) of [save code data v]) to [noteblocks v]\n    end\n    set [loadedlevel? v] to [1]\nelse\n    if <(mode) = [1]> then\n        set [i v] to [15]\n        set [music v] to (item (1) of [save code data v])\n        set [pens v] to (item (2) of [save code data v])\n        set [starting ink v] to (item (3) of [save code data v])\n        set [background v] to (item (4) of [save code data v])\n        set [boss battle v] to (item (5) of [save code data v])\n        set [no ink restart bonus v] to [25]\n        broadcast (updateSavePosits v)\n        repeat (item (7) of [save code data v])\n            change [i v] by (1)\n            add (item (i) of [save code data v]) to [penx v]\n        end\n        repeat (item (8) of [save code data v])\n            change [i v] by (1)\n            add (item (i) of [save code data v]) to [peny v]\n        end\n        repeat (item (9) of [save code data v])\n            change [i v] by (1)\n            add (item (i) of [save code data v]) to [pentype v]\n        end\n        repeat (item (10) of [save code data v])\n            change [i v] by (1)\n            add (item (i) of [save code data v]) to [penink v]\n        end\n        repeat (item (11) of [save code data v])\n            change [i v] by (1)\n            add (item (i) of [save code data v]) to [enemyx v]\n        end\n        repeat (item (12) of [save code data v])\n            change [i v] by (1)\n            add (item (i) of [save code data v]) to [enemyy v]\n        end\n        repeat (item (13) of [save code data v])\n            change [i v] by (1)\n            add (item (i) of [save code data v]) to [inkx v]\n        end\n        repeat (item (14) of [save code data v])\n            change [i v] by (1)\n            add (item (i) of [save code data v]) to [inky v]\n        end\n        repeat (item (15) of [save code data v])\n            change [i v] by (1)\n            add (item (i) of [save code data v]) to [inksize v]\n        end\n        set [loadedlevel? v] to [1]\n        delete all of [level details v]\n        add [Legacy Level] to [level details v]\n        add [Unknown User] to [level details v]\n        add [before 5/29/2020] to [level details v]\n    else\n        if <(mode) = [2]> then\n            set [i v] to [18]\n            set [music v] to (item (2) of [save code data v])\n            set [pens v] to (item (3) of [save code data v])\n            set [starting ink v] to (item (4) of [save code data v])\n            set [background v] to (item (5) of [save code data v])\n            set [boss battle v] to (item (6) of [save code data v])\n            set [no ink restart bonus v] to [25]\n            broadcast (updateSavePosits v)\n            repeat (item (8) of [save code data v])\n                change [i v] by (1)\n                add (item (i) of [save code data v]) to [penx v]\n            end\n            repeat (item (9) of [save code data v])\n                change [i v] by (1)\n                add (item (i) of [save code data v]) to [peny v]\n            end\n            repeat (item (10) of [save code data v])\n                change [i v] by (1)\n                add (item (i) of [save code data v]) to [pentype v]\n            end\n            repeat (item (11) of [save code data v])\n                change [i v] by (1)\n                add (item (i) of [save code data v]) to [penink v]\n            end\n            repeat (item (12) of [save code data v])\n                change [i v] by (1)\n                add (item (i) of [save code data v]) to [enemyx v]\n            end\n            repeat (item (13) of [save code data v])\n                change [i v] by (1)\n                add (item (i) of [save code data v]) to [enemyy v]\n            end\n            repeat (item (14) of [save code data v])\n                change [i v] by (1)\n                add (item (i) of [save code data v]) to [inkx v]\n            end\n            repeat (item (15) of [save code data v])\n                change [i v] by (1)\n                add (item (i) of [save code data v]) to [inky v]\n            end\n            repeat (item (16) of [save code data v])\n                change [i v] by (1)\n                add (item (i) of [save code data v]) to [inksize v]\n            end\n            repeat (item (17) of [save code data v])\n                change [i v] by (1)\n                add (item (i) of [save code data v]) to [noteblocks v]\n            end\n            set [loadedlevel? v] to [1]\n            delete all of [level details v]\n            add [Legacy Level] to [level details v]\n            add [Unknown User] to [level details v]\n            add [before 6/24/2020] to [level details v]\n        else\n            if <(mode) = [3]> then\n                set [i v] to [18]\n                set [music v] to (item (2) of [save code data v])\n                set [pens v] to (item (3) of [save code data v])\n                set [starting ink v] to (item (4) of [save code data v])\n                set [background v] to (item (5) of [save code data v])\n                set [boss battle v] to (item (6) of [save code data v])\n                set [no ink restart bonus v] to [25]\n                broadcast (updateSavePosits v)\n                set [details_basket v] to (item (8) of [save code data v])\n                broadcast (LoadDetailsCode v) and wait\n                repeat (item (9) of [save code data v])\n                    change [i v] by (1)\n                    add (item (i) of [save code data v]) to [penx v]\n                end\n                repeat (item (10) of [save code data v])\n                    change [i v] by (1)\n                    add (item (i) of [save code data v]) to [peny v]\n                end\n                repeat (item (11) of [save code data v])\n                    change [i v] by (1)\n                    add (item (i) of [save code data v]) to [pentype v]\n                end\n                repeat (item (12) of [save code data v])\n                    change [i v] by (1)\n                    add (item (i) of [save code data v]) to [penink v]\n                end\n                repeat (item (13) of [save code data v])\n                    change [i v] by (1)\n                    add (item (i) of [save code data v]) to [enemyx v]\n                end\n                repeat (item (14) of [save code data v])\n                    change [i v] by (1)\n                    add (item (i) of [save code data v]) to [enemyy v]\n                end\n                repeat (item (15) of [save code data v])\n                    change [i v] by (1)\n                    add (item (i) of [save code data v]) to [inkx v]\n                end\n                repeat (item (16) of [save code data v])\n                    change [i v] by (1)\n                    add (item (i) of [save code data v]) to [inky v]\n                end\n                repeat (item (17) of [save code data v])\n                    change [i v] by (1)\n                    add (item (i) of [save code data v]) to [inksize v]\n                end\n                repeat (item (18) of [save code data v])\n                    change [i v] by (1)\n                    add (item (i) of [save code data v]) to [noteblocks v]\n                end\n                replace item (3) of [level details v] with (join (item (3) of [level details v]) [ \(V3\)])\n                set [loadedlevel? v] to [1]\n            else\n                if <(mode) = [4]> then\n                    set [i v] to [19]\n                    set [music v] to (item (2) of [save code data v])\n                    set [pens v] to (item (3) of [save code data v])\n                    set [starting ink v] to (item (4) of [save code data v])\n                    set [background v] to (item (5) of [save code data v])\n                    set [boss battle v] to (item (6) of [save code data v])\n                    broadcast (updateSavePosits v)\n                    set [details_basket v] to (item (8) of [save code data v])\n                    set [no ink restart bonus v] to (item (9) of [save code data v])\n                    broadcast (LoadDetailsCode v)\n                    repeat (item (10) of [save code data v])\n                        change [i v] by (1)\n                        add (item (i) of [save code data v]) to [penx v]\n                    end\n                    repeat (item (11) of [save code data v])\n                        change [i v] by (1)\n                        add (item (i) of [save code data v]) to [peny v]\n                    end\n                    repeat (item (12) of [save code data v])\n                        change [i v] by (1)\n                        add (item (i) of [save code data v]) to [pentype v]\n                    end\n                    repeat (item (13) of [save code data v])\n                        change [i v] by (1)\n                        add (item (i) of [save code data v]) to [penink v]\n                    end\n                    repeat (item (14) of [save code data v])\n                        change [i v] by (1)\n                        add (item (i) of [save code data v]) to [enemyx v]\n                    end\n                    repeat (item (15) of [save code data v])\n                        change [i v] by (1)\n                        add (item (i) of [save code data v]) to [enemyy v]\n                    end\n                    repeat (item (16) of [save code data v])\n                        change [i v] by (1)\n                        add (item (i) of [save code data v]) to [inkx v]\n                    end\n                    repeat (item (17) of [save code data v])\n                        change [i v] by (1)\n                        add (item (i) of [save code data v]) to [inky v]\n                    end\n                    repeat (item (18) of [save code data v])\n                        change [i v] by (1)\n                        add (item (i) of [save code data v]) to [inksize v]\n                    end\n                    repeat (item (19) of [save code data v])\n                        change [i v] by (1)\n                        add (item (i) of [save code data v]) to [noteblocks v]\n                    end\n                    set [loadedlevel? v] to [1]\n                end\n            end\n        end\n    end\nend\nif <(item (1) of [level details v]) = [Untitled]> then\n    replace item (1) of [level details v] with [Untitled Level]\nend\n\nwhen backdrop switches to [white v]\ndelete this clone\n\nwhen I receive [fadeout v]\nif <(type) = [hitbox]> then\n    delete this clone\nend\n\n@level_pen\n\ndefine circle (width) (height) (x) (y) (number of points) <anchored on middle?>\ngo to x: ((x) + ((((width) / (2)) * ((1) - <anchored on middle?>)) + (([sin v] of (direction) ) * ((width) / (2))))) y: ((y) + ((((height) / (2)) * ((1) - <anchored on middle?>)) + (([cos v] of (direction) ) * ((height) / (2)))))\npen down\nif <[360] < (number of points)> then\n    set [pramcircle v] to [360]\nelse\n    if <(number of points) < [0]> then\n        set [pramcircle v] to [0]\n    else\n        set [pramcircle v] to (number of points)\n    end\nend\nrepeat (pramCIRCLE)\n    turn right ((360) / (pramCIRCLE)) degrees\n    go to x: ((x) + ((((width) / (2)) * ((1) - <anchored on middle?>)) + (([sin v] of (direction) ) * ((width) / (2))))) y: ((y) + ((((height) / (2)) * ((1) - <anchored on middle?>)) + (([cos v] of (direction) ) * ((height) / (2)))))\nend\npoint in direction (90)\npen up\n\nwhen I receive [close_editor v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\ndefine refresh\nswitch costume to (oof v)\nset size to ((1) / (0)) %\nswitch costume to (full v)\npen up\nset [i v] to [1]\nset [j v] to [2]\nset [h v] to [1]\nrepeat until <(j) > (length of [penx v])>\n    if <(item (h) of [penink v]) = [1]> then\n        set pen color to (#ff0000)\n    else\n        if <(item (h) of [penink v]) = [0]> then\n            set pen color to (#000000)\n        else\n            if <(letter (1) of (item (h) of [penink v])) = [r]> then\n                if <((join (letter (2) of (item (h) of [penink v])) (join (letter (3) of (item (h) of [penink v])) (join (letter (4) of (item (h) of [penink v])) (join (letter (5) of (item (h) of [penink v])) (join (letter (6) of (item (h) of [penink v])) (join (letter (8) of (item (h) of [penink v])) (join (letter (9) of (item (h) of [penink v])) (letter (10) of (item (h) of [penink v]))))))))) + (0)) = [0]> then\n                    set [r v] to (join ((item # of (letter (2) of (item (h) of [penink v])) in [encode_table v]) + (-1)) (join ((item # of (letter (3) of (item (h) of [penink v])) in [encode_table v]) + (-1)) ((item # of (letter (4) of (item (h) of [penink v])) in [encode_table v]) + (-1))))\n                    set [g v] to (join ((item # of (letter (5) of (item (h) of [penink v])) in [encode_table v]) + (-1)) (join ((item # of (letter (6) of (item (h) of [penink v])) in [encode_table v]) + (-1)) ((item # of (letter (7) of (item (h) of [penink v])) in [encode_table v]) + (-1))))\n                    set [b v] to (join ((item # of (letter (8) of (item (h) of [penink v])) in [encode_table v]) + (-1)) (join ((item # of (letter (9) of (item (h) of [penink v])) in [encode_table v]) + (-1)) ((item # of (letter (10) of (item (h) of [penink v])) in [encode_table v]) + (-1))))\n                else\n                    set [r v] to ((join (letter (2) of (item (h) of [penink v])) (join (letter (3) of (item (h) of [penink v])) (letter (4) of (item (h) of [penink v])))) + (0))\n                    set [g v] to ((join (letter (5) of (item (h) of [penink v])) (join (letter (7) of (item (h) of [penink v])) (letter (7) of (item (h) of [penink v])))) + (0))\n                    set [b v] to ((join (letter (8) of (item (h) of [penink v])) (join (letter (9) of (item (h) of [penink v])) (letter (10) of (item (h) of [penink v])))) + (0))\n                end\n                set pen color to ((((round (r)) * (65536)) + ((round (g)) * (256))) + (round (b)))\n            else\n                set pen color to (item (h) of [penink v])\n            end\n        end\n    end\n    if <<(item (h) of [pentype v]) = [l]> or <(item (h) of [pentype v]) = [line]>> then\n        set pen size to (2)\n        go to x: ((item (i) of [penx v]) + (RENDER_OffsetX)) y: ((item (i) of [peny v]) + (RENDER_OffsetY))\n        pen down\n        go to x: ((item (j) of [penx v]) + (RENDER_OffsetX)) y: ((item (j) of [peny v]) + (RENDER_OffsetY))\n        pen up\n    end\n    if <<(item (h) of [pentype v]) = [r]> or <(item (h) of [pentype v]) = [rectangle]>> then\n        set pen size to (1)\n        draw rectangle\n    end\n    if <(item (h) of [pentype v]) = [c]> then\n        set pen size to (2)\n        circle (((item (j) of [penx v]) + (RENDER_OffsetX)) - ((item (i) of [penx v]) + (RENDER_OffsetX))) (((item (j) of [peny v]) + (RENDER_OffsetY)) - ((item (i) of [peny v]) + (RENDER_OffsetY))) ((item (i) of [penx v]) + (RENDER_OffsetX)) ((item (i) of [peny v]) + (RENDER_OffsetY)) [36] <>\n    end\n    change [h v] by (1)\n    change [i v] by (2)\n    change [j v] by (2)\nend\n\nwhen I receive [level_editor v]\nerase all\nrefresh\nforever\n    if <not <(Performance Mode) = [1]>> then\n        erase all\n        refresh\n    end\nend\n\ndefine fill\ngo to x: ((item (i) of [penx v]) + (RENDER_OffsetX)) y: ((item (i) of [peny v]) + (RENDER_OffsetY))\nif <(letter (1) of (((item (i) of [penx v]) + (RENDER_OffsetX)) - ((item (j) of [penx v]) + (RENDER_OffsetX)))) = [-]> then\n    repeat (([abs v] of ((item (j) of [penx v]) - (item (i) of [penx v])) ) + (1))\n        set y to ((item (j) of [peny v]) + (RENDER_OffsetY))\n        change x by (0.5)\n        set y to ((item (i) of [peny v]) + (RENDER_OffsetY))\n        change x by (0.5)\n    end\nelse\n    repeat (([abs v] of ((item (j) of [penx v]) - (item (i) of [penx v])) ) + (1))\n        set y to ((item (j) of [peny v]) + (RENDER_OffsetY))\n        change x by (-0.5)\n        set y to ((item (i) of [peny v]) + (RENDER_OffsetY))\n        change x by (-0.5)\n    end\nend\n\nwhen I receive [redraw_level v]\nerase all\nrefresh\nbroadcast (stamp bossbar v)\n\ndefine draw rectangle\nif <(Rectangle Fill?) = [1]> then\n    set pen size to (1)\nelse\n    if <(PlayTesting?) = [1]> then\n        set pen size to (1)\n    else\n        set pen size to (3)\n    end\nend\ngo to x: ((item (i) of [penx v]) + (RENDER_OffsetX)) y: ((item (i) of [peny v]) + (RENDER_OffsetY))\npen down\ngo to x: ((item (j) of [penx v]) + (RENDER_OffsetX)) y: ((item (i) of [peny v]) + (RENDER_OffsetY))\ngo to x: ((item (j) of [penx v]) + (RENDER_OffsetX)) y: ((item (j) of [peny v]) + (RENDER_OffsetY))\ngo to x: ((item (i) of [penx v]) + (RENDER_OffsetX)) y: ((item (j) of [peny v]) + (RENDER_OffsetY))\ngo to x: ((item (i) of [penx v]) + (RENDER_OffsetX)) y: ((item (i) of [peny v]) + (RENDER_OffsetY))\nif <(Rectangle Fill?) = [1]> then\n    fill\nelse\n    if <(PlayTesting?) = [1]> then\n        fill\n    else\n        pen up\n        go to x: ((item (i) of [penx v]) + (RENDER_OffsetX)) y: ((item (i) of [peny v]) + (RENDER_OffsetY))\n        pen down\n        go to x: ((item (j) of [penx v]) + (RENDER_OffsetX)) y: ((item (j) of [peny v]) + (RENDER_OffsetY))\n        pen up\n        go to x: ((item (i) of [penx v]) + (RENDER_OffsetX)) y: ((item (j) of [peny v]) + (RENDER_OffsetY))\n        pen down\n        go to x: ((item (j) of [penx v]) + (RENDER_OffsetX)) y: ((item (i) of [peny v]) + (RENDER_OffsetY))\n    end\nend\npen up\n\ndefine go to x: (x) y: (y) with offset\ngo to x: ((x) + (RENDER_OffsetX)) y: ((y) + (RENDER_OffsetY))\n\ndefine refresh with offset\nerase all\npen up\nset [i v] to [1]\nset [j v] to [2]\nset [h v] to [1]\nrepeat until <(j) > (length of [penx v])>\n    if <(item (h) of [penink v]) = [1]> then\n        set pen color to (#ff3d3d)\n    else\n        set pen color to (#000000)\n    end\n    if <(item (h) of [pentype v]) = [line]> then\n        set pen size to (2)\n        go to x: (item (i) of [penx v]) y: (item (i) of [peny v]) with offset\n        pen down\n        go to x: (item (j) of [penx v]) y: (item (j) of [peny v]) with offset\n        pen up\n    end\n    if <(item (h) of [pentype v]) = [rectangle]> then\n        set pen size to (1)\n        go to x: (item (i) of [penx v]) y: (item (i) of [peny v]) with offset\n        pen down\n        go to x: (item (j) of [penx v]) y: (item (i) of [peny v]) with offset\n        go to x: (item (j) of [penx v]) y: (item (j) of [peny v]) with offset\n        go to x: (item (i) of [penx v]) y: (item (j) of [peny v]) with offset\n        go to x: (item (i) of [penx v]) y: (item (i) of [peny v]) with offset\n        fill with offset\n        pen up\n    end\n    change [h v] by (1)\n    change [i v] by (2)\n    change [j v] by (2)\nend\n\ndefine fill with offset\ngo to x: (item (i) of [penx v]) y: (item (i) of [peny v]) with offset\nif <(letter (1) of (((item (i) of [penx v]) + (RENDER_OffsetX)) - ((item (j) of [penx v]) + (RENDER_OffsetX)))) = [-]> then\n    repeat until <(x position) = ((item (j) of [penx v]) + (RENDER_OffsetX))>\n        set y to (item (j) of [peny v]) with offset\n        change x by (0.5)\n        set y to (item (i) of [peny v]) with offset\n        change x by (0.5)\n    end\nelse\n    repeat until <(x position) = (item (j) of [penx v])>\n        set y to (item (j) of [peny v]) with offset\n        change x by (-0.5)\n        set y to (item (i) of [peny v]) with offset\n        change x by (-0.5)\n    end\nend\n\ndefine set y to (y) with offset\nset y to ((y) + (RENDER_OffsetY))\n\n@toolbar\n\nwhen flag clicked\nset [_first? v] to [1]\nhide variable [music v]\nhide variable [pens v]\nhide variable [starting ink v]\nhide variable [background v]\nhide variable [boss battle v]\nhide variable [no ink restart bonus v]\nhide variable [hard mode v]\nhide\n\nwhen I receive [level_editor v]\nswitch costume to (1 v)\nshow\nif <not <[1] < (_first?)>> then\n    if <not <(Performance Mode) = [1]>> then\n        set [ghost v] effect to (100)\n        set size to (50) %\n        go to x: (0) y: (50)\n        set size to (100) %\n        repeat (10)\n            set size to (50) %\n            change y by (-5)\n            set size to (100) %\n            change [ghost v] effect by (-10)\n        end\n    end\nend\ngo to x: (0) y: (0)\n\nwhen I receive [level_editor v]\nwait (1) seconds\nwait until <(settings_shown?) = [true]>\nforever\n    if <(settings_shown?) = [true]> then\n        set [donewithsettings? v] to [0]\n        create clone of (_myself_ v)\n        switch costume to (2 v)\n        if <not <(Performance Mode) = [1]>> then\n            set [ghost v] effect to (100)\n            go to x: (0) y: (50)\n            repeat (10)\n                change y by (-5)\n                change [ghost v] effect by (-5)\n            end\n        end\n        set [ghost v] effect to (50)\n        show variable [music v]\n        show variable [pens v]\n        show variable [starting ink v]\n        show variable [background v]\n        show variable [boss battle v]\n        show variable [no ink restart bonus v]\n        show variable [hard mode v]\n        wait until <(settings_shown?) = [false]>\n    else\n        if <(Performance Mode) = [0]> then\n            set [ghost v] effect to (50)\n            hide variable [music v]\n            hide variable [pens v]\n            hide variable [starting ink v]\n            hide variable [background v]\n            hide variable [boss battle v]\n            hide variable [no ink restart bonus v]\n            hide variable [hard mode v]\n            go to x: (0) y: (0)\n            repeat (10)\n                change y by (5)\n                change [ghost v] effect by (5)\n            end\n        end\n        set [donewithsettings? v] to [1]\n        hide variable [music v]\n        hide variable [pens v]\n        hide variable [starting ink v]\n        hide variable [background v]\n        hide variable [boss battle v]\n        hide variable [no ink restart bonus v]\n        hide variable [hard mode v]\n        switch costume to (1 v)\n        set [ghost v] effect to (0)\n        go to x: (0) y: (0)\n        wait until <(settings_shown?) = [true]>\n    end\nend\n\nwhen I start as a clone\nwait until <(settings_shown?) = [0]>\nwait until <(doneWithSettings?) = [1]>\nwait (0.1) seconds\ndelete this clone\n\nwhen I receive [close_editor v]\nchange [_first? v] by (1)\nhide\nclear graphic effects\nstop [other scripts in sprite v]\ndelete this clone\n\n@spawnpoint\n\nwhen this sprite clicked\nset [_dragoffsety v] to ((mouse y) - (y position))\nrepeat until <not <mouse down?>>\n    set y to ((mouse y) - (_DRAGoffsetY))\nend\n\nwhen flag clicked\nhide\nset y to (0)\nforever\n    set x to (-215)\n    go to [back v] layer\nend\n\nwhen I receive [level_editor v]\nshow\nif <not <(Performance Mode) = [1]>> then\n    set [ghost v] effect to (100)\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\n\nwhen I receive [close_editor v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [updatesaveposits v]\nset y to (item (7) of [save code data v])\n\n@editGUI\n\nwhen I receive [level_editor v]\nset [settings_shown? v] to [0]\ngo to x: (220) y: (164)\nset [type v] to [tool]\nset [tool v] to [line]\nswitch costume to (line v)\ncreate clone of (_myself_ v)\ngo to x: (190) y: (164)\nset [type v] to [color]\nswitch costume to (color.red v)\ncreate clone of (_myself_ v)\ngo to x: (168) y: (164)\nset [type v] to [color]\nswitch costume to (color.black v)\ncreate clone of (_myself_ v)\ngo to x: (146) y: (164)\nset [type v] to [color]\nswitch costume to (color.picker v)\ncreate clone of (_myself_ v)\ngo to x: (-220) y: (164)\nset [type v] to [settings]\nswitch costume to (advanced v)\ncreate clone of (_myself_ v)\ngo to x: (-187) y: (164)\nset [type v] to [test]\nswitch costume to (play v)\ncreate clone of (_myself_ v)\ngo to x: (-154) y: (164)\nset [type v] to [save]\nswitch costume to (save v)\ncreate clone of (_myself_ v)\ngo to x: (-121) y: (164)\nset [type v] to [undo]\nswitch costume to (undo v)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <not <[1] < ([_first? v] of [toolbar v])>> then\n    wait (0.3) seconds\nend\nshow\ngo to [front v] layer\nif <not <(Performance Mode) = [1]>> then\n    change y by (10)\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    repeat (10)\n        set size to (1) %\n        change y by (-1)\n        set size to (100) %\n        change [ghost v] effect by (-10)\n    end\nend\nforever\n    if <(type) = [color]> then\n        if <<<(TOOL) = [rectangle]> or <(TOOL) = [line]>> or <<(TOOL) = [freehand]> or <(TOOL) = [circle]>>> then\n            show\n            set [loops v] to [0]\n            change [ghost v] effect by (-10)\n        else\n            change [loops v] by (1)\n            if <[9] < (loops)> then\n                hide\n            end\n            change [ghost v] effect by (10)\n        end\n        if <(Pen_Color) = ((costume [number v]) - (3))> then\n            set size to (125) %\n        else\n            set size to (100) %\n        end\n        if <<not <(Pen_Color) = [0]>> and <not <(Pen_Color) = [1]>>> then\n            if <(costume [number v]) = [5]> then\n                set size to (125) %\n            else\n                set size to (100) %\n            end\n        end\n    else\n        if <(type) = [undo]> then\n            if <(length of [actionhistory v]) = [0]> then\n                set [brightness v] effect to (-50)\n            else\n                set [brightness v] effect to (0)\n            end\n        end\n    end\nend\n\nwhen this sprite clicked\nif <(type) = [tool]> then\n    Change Tool\nelse\n    if <(type) = [color]> then\n        if <(costume [number v]) = [3]> then\n            set [pen_color v] to [0]\n        else\n            if <(costume [number v]) = [4]> then\n                set [pen_color v] to [1]\n            else\n                set [pen_color v] to [-1]\n                ask [Do you want to enter a color using \(R\)GB or \(H\)ex? Find the color you want and enter which way it is written.] and wait\n                if <<(answer) = [rgb]> or <(answer) = [r]>> then\n                    ask [Enter the RED value.] and wait\n                    Shift Answer\n                    if <((answer) + (0)) = (answer)> then\n                        set [pen_color v] to (join [r] (temp))\n                        ask [Enter the GREEN value.] and wait\n                        Shift Answer\n                        if <((answer) + (0)) = (answer)> then\n                            set [pen_color v] to (join (Pen_Color) (temp))\n                            ask [Enter the BLUE value.] and wait\n                            Shift Answer\n                            if <((answer) + (0)) = (answer)> then\n                                set [pen_color v] to (join (Pen_Color) (temp))\n                            else\n                                ask [Invalid Answer! Press enter to exit] and wait\n                                stop [this script v]\n                            end\n                        else\n                            ask [Invalid Answer! Press enter to exit] and wait\n                            stop [this script v]\n                        end\n                    else\n                        ask [Invalid Answer! Press enter to exit] and wait\n                        stop [this script v]\n                    end\n                else\n                    if <<(answer) = [hex]> or <(answer) = [h]>> then\n                        ask [Enter the hex code.] and wait\n                        if <(letter (1) of (answer)) = [#]> then\n                            if <(length of (answer)) = [7]> then\n                                set [pen_color v] to (answer)\n                            else\n                                ask [Invalid Answer! Press enter to exit] and wait\n                                stop [this script v]\n                            end\n                        else\n                            if <(length of (answer)) = [6]> then\n                                set [pen_color v] to (join [#] (answer))\n                            else\n                                ask [Invalid Answer! Press enter to exit] and wait\n                                stop [this script v]\n                            end\n                        end\n                    else\n                        ask [Invalid Answer! Press enter to exit] and wait\n                    end\n                end\n            end\n        end\n    else\n        if <(type) = [settings]> then\n            set [settings_shown? v] to <(settings_shown?) = [0]>\n        else\n            if <(type) = [test]> then\n                set [playtestorloaded? v] to [1]\n                broadcast (testlevel v)\n            else\n                if <(type) = [save]> then\n                    set [savegenerated? v] to [0]\n                    ask [Enter the level name. \(Maximum: 25 Characters\)] and wait\n                    if <[25] < (length of (answer))> then\n                        repeat until <not <[25] < (length of (answer))>>\n                            ask [Enter the level name. \(Maximum: 25 Characters\)] and wait\n                        end\n                    end\n                    if <(answer) = []> then\n                        set [details_basket v] to [Untitled]\n                    else\n                        if <(answer) = [ ]> then\n                            set [details_basket v] to [Untitled]\n                        else\n                            set [details_basket v] to (answer)\n                        end\n                    end\n                    broadcast (MakeDetailsCode v) and wait\n                    MakeSave\n                    broadcast (Generate Save Code v) and wait\n                    set [savegenerated? v] to [1]\n                    add [Your Level Code is below:] to [here is your level code v]\n                    add (Save Code) to [here is your level code v]\n                    add [Triple-click the Level Code and press CTRL+C or ⌘+C on your keyboard.] to [here is your level code v]\n                    add [Paste it in the ask box below.] to [here is your level code v]\n                    hide list [here is your level code v]\n                    hide\n                    ask [Paste the level in here to verify the Level Code and hide the list] and wait\n                    repeat until <(answer) = (Save Code)>\n                        ask [Please try copying the Level Code again, then paste it again.] and wait\n                    end\n                    delete (3) of [here is your level code v]\n                    delete (3) of [here is your level code v]\n                    if <[500] < (length of (Save Code))> then\n                        add [Paste it in the forum in the instructions to share your level.] to [here is your level code v]\n                    else\n                        add [Paste it in the Comments Section to share your level.] to [here is your level code v]\n                    end\n                    ask [The Level Code was copied correctly! Follow the list's instructions if you want to share it, then press the checkmark.] and wait\n                    show\n                    show list [here is your level code v]\n                else\n                    if <(type) = [undo]> then\n                        UndoPrevAction\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [new_level v]\nset [pen_color v] to [0]\n\nwhen I receive [close_editor v]\nhide variable [music v]\nhide variable [pens v]\nhide variable [starting ink v]\nhide variable [background v]\nhide variable [boss battle v]\nhide variable [no ink restart bonus v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\ndefine MakeSave\ndelete all of [save code data v]\ndelete all of [here is your level code v]\nConvert V2.0 + Below to Current\nadd [v5] to [save code data v]\nadd (Music) to [save code data v]\nadd (Pens) to [save code data v]\nadd (Starting Ink) to [save code data v]\nadd (Background) to [save code data v]\nadd (Boss Battle) to [save code data v]\nadd ([y position v] of [spawnpoint v]) to [save code data v]\nadd (DETAILS_BASKET) to [save code data v]\nadd (No Ink Restart Bonus) to [save code data v]\nadd (Hard Mode) to [save code data v]\nadd (length of [penx v]) to [save code data v]\nadd (length of [peny v]) to [save code data v]\nadd (length of [pentype v]) to [save code data v]\nadd (length of [penink v]) to [save code data v]\nadd (length of [enemyx v]) to [save code data v]\nadd (length of [enemyy v]) to [save code data v]\nadd (length of [inkx v]) to [save code data v]\nadd (length of [inky v]) to [save code data v]\nadd (length of [inksize v]) to [save code data v]\nadd (length of [noteblocks v]) to [save code data v]\nset [i v] to [0]\nrepeat (length of [penx v])\n    change [i v] by (1)\n    add (item (i) of [penx v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [peny v])\n    change [i v] by (1)\n    add (item (i) of [peny v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [pentype v])\n    change [i v] by (1)\n    add (item (i) of [pentype v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [penink v])\n    change [i v] by (1)\n    add (item (i) of [penink v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [enemyx v])\n    change [i v] by (1)\n    add (item (i) of [enemyx v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [enemyy v])\n    change [i v] by (1)\n    add (item (i) of [enemyy v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [inkx v])\n    change [i v] by (1)\n    add (item (i) of [inkx v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [inky v])\n    change [i v] by (1)\n    add (item (i) of [inky v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [inksize v])\n    change [i v] by (1)\n    add (item (i) of [inksize v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [noteblocks v])\n    change [i v] by (1)\n    add (item (i) of [noteblocks v]) to [save code data v]\nend\n\nwhen flag clicked\nhide\nset [savegenerated? v] to [1]\n\ndefine Shift Answer\nif <[1] < (length of (answer))> then\n    if <[2] < (length of (answer))> then\n        set [temp v] to (answer)\n    else\n        set [temp v] to (join [0] (answer))\n    end\nelse\n    set [temp v] to (join [00] (answer))\nend\nset [i v] to [1]\nset [j v] to []\nrepeat (length of (temp))\n    set [j v] to (join (j) (item ((letter (i) of (temp)) + (1)) of [encode_table v]))\n    change [i v] by (1)\nend\nset [temp v] to (j)\n\ndefine Convert V2.0 + Below to Current\nset [i v] to [0]\nrepeat (length of [pentype v])\n    change [i v] by (1)\n    replace item (i) of [pentype v] with (letter (1) of (item (i) of [pentype v]))\nend\n\ndefine UndoPrevAction\nif <not <(length of [actionhistory v]) = [0]>> then\n    if <(item (length of [actionhistory v]) of [actionhistory v]) = [draw]> then\n        repeat (2)\n            delete (length of [penx v]) of [penx v]\n            delete (length of [peny v]) of [peny v]\n        end\n        delete (length of [penink v]) of [penink v]\n        delete (length of [pentype v]) of [pentype v]\n    else\n        if <(item (length of [actionhistory v]) of [actionhistory v]) = [ink]> then\n            delete (length of [inkx v]) of [inkx v]\n            delete (length of [inky v]) of [inky v]\n            delete (length of [inksize v]) of [inksize v]\n        else\n            if <(item (length of [actionhistory v]) of [actionhistory v]) = [enemy]> then\n                delete (length of [enemyx v]) of [enemyx v]\n                delete (length of [enemyy v]) of [enemyy v]\n            else\n                if <(item (length of [actionhistory v]) of [actionhistory v]) = [sound]> then\n                    delete (length of [noteblocks v]) of [noteblocks v]\n                    delete (length of [noteblocks v]) of [noteblocks v]\n                    delete (length of [noteblocks v]) of [noteblocks v]\n                    delete (length of [noteblocks v]) of [noteblocks v]\n                    delete (length of [noteblocks v]) of [noteblocks v]\n                    delete (length of [noteblocks v]) of [noteblocks v]\n                    delete (length of [noteblocks v]) of [noteblocks v]\n                    delete (length of [noteblocks v]) of [noteblocks v]\n                end\n            end\n        end\n    end\n    delete (length of [actionhistory v]) of [actionhistory v]\n    if <(Performance Mode) = [1]> then\n        broadcast (redraw_level v)\n    end\n    start sound [restart v]\nend\n\ndelete all of [save code data v]\ndelete all of [here is your level code v]\nConvert V2.0 + Below to Current\nadd (Music) to [save code data v]\nadd (Pens) to [save code data v]\nadd (Starting Ink) to [save code data v]\nadd (Background) to [save code data v]\nadd (Boss Battle) to [save code data v]\nadd ([y position v] of [spawnpoint v]) to [save code data v]\nadd (length of [penx v]) to [save code data v]\nadd (length of [peny v]) to [save code data v]\nadd (length of [pentype v]) to [save code data v]\nadd (length of [penink v]) to [save code data v]\nadd (length of [enemyx v]) to [save code data v]\nadd (length of [enemyy v]) to [save code data v]\nadd (length of [inkx v]) to [save code data v]\nadd (length of [inky v]) to [save code data v]\nadd (length of [inksize v]) to [save code data v]\nset [i v] to [0]\nrepeat (length of [penx v])\n    change [i v] by (1)\n    add (item (i) of [penx v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [peny v])\n    change [i v] by (1)\n    add (item (i) of [peny v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [pentype v])\n    change [i v] by (1)\n    add (item (i) of [pentype v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [penink v])\n    change [i v] by (1)\n    add (item (i) of [penink v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [enemyx v])\n    change [i v] by (1)\n    add (item (i) of [enemyx v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [enemyy v])\n    change [i v] by (1)\n    add (item (i) of [enemyy v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [inkx v])\n    change [i v] by (1)\n    add (item (i) of [inkx v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [inky v])\n    change [i v] by (1)\n    add (item (i) of [inky v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [inksize v])\n    change [i v] by (1)\n    add (item (i) of [inksize v]) to [save code data v]\nend\n\nif <(costume [number v]) = [10]> then\n    switch costume to (line v)\n    set [tool v] to [line]\nelse\n    if <(costume [number v]) = [9]> then\n        switch costume to (ink v)\n        set [tool v] to [ink]\n    else\n        if <(costume [number v]) = [2]> then\n            switch costume to (enemy v)\n            set [tool v] to [enemy]\n        else\n            switch costume to (rectange v)\n            set [tool v] to [rectangle]\n        end\n    end\nend\n\ndefine Change Tool\nchange [tool# v] by (1)\nif <(length of [tools v]) < (Tool#)> then\n    set [tool# v] to [1]\nend\nswitch costume to ((item (Tool#) of [toolslookup v]) + (0))\nset [tool v] to (item (Tool#) of [tools v])\n\ndelete all of [save code data v]\ndelete all of [here is your level code v]\nConvert V2.0 + Below to Current\nadd [v3] to [save code data v]\nadd (Music) to [save code data v]\nadd (Pens) to [save code data v]\nadd (Starting Ink) to [save code data v]\nadd (Background) to [save code data v]\nadd (Boss Battle) to [save code data v]\nadd ([y position v] of [spawnpoint v]) to [save code data v]\nadd (DETAILS_BASKET) to [save code data v]\nadd (length of [penx v]) to [save code data v]\nadd (length of [peny v]) to [save code data v]\nadd (length of [pentype v]) to [save code data v]\nadd (length of [penink v]) to [save code data v]\nadd (length of [enemyx v]) to [save code data v]\nadd (length of [enemyy v]) to [save code data v]\nadd (length of [inkx v]) to [save code data v]\nadd (length of [inky v]) to [save code data v]\nadd (length of [inksize v]) to [save code data v]\nadd (length of [noteblocks v]) to [save code data v]\nset [i v] to [0]\nrepeat (length of [penx v])\n    change [i v] by (1)\n    add (item (i) of [penx v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [peny v])\n    change [i v] by (1)\n    add (item (i) of [peny v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [pentype v])\n    change [i v] by (1)\n    add (item (i) of [pentype v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [penink v])\n    change [i v] by (1)\n    add (item (i) of [penink v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [enemyx v])\n    change [i v] by (1)\n    add (item (i) of [enemyx v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [enemyy v])\n    change [i v] by (1)\n    add (item (i) of [enemyy v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [inkx v])\n    change [i v] by (1)\n    add (item (i) of [inkx v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [inky v])\n    change [i v] by (1)\n    add (item (i) of [inky v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [inksize v])\n    change [i v] by (1)\n    add (item (i) of [inksize v]) to [save code data v]\nend\nset [i v] to [0]\nrepeat (length of [noteblocks v])\n    change [i v] by (1)\n    add (item (i) of [noteblocks v]) to [save code data v]\nend\n\nwhen flag clicked\ndelete all of [tools v]\ndelete all of [toolslookup v]\nadd tool [line] with costume # [1]\nadd tool [rectange] with costume # [2]\nadd tool [circle] with costume # [15]\nadd tool [enemy] with costume # [9]\nadd tool [ink] with costume # [10]\nadd tool [delete] with costume # [18]\nadd tool [sound] with costume # [13]\nif <(username) = [Mrk20200]> then\n    add tool [debug.refresh] with costume # [19]\nend\n\ndefine add tool (name) with costume # (#)\nadd (name) to [tools v]\nadd (#) to [toolslookup v]\n\n@editor_enemys\n\nwhen I receive [close_editor v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nforever\n    change [enemyanimation v] by (1)\n    if <<(enemyAnimation) = [5]> or <(Performance Mode) = [1]>> then\n        set [enemyanimation v] to [1]\n    end\n    wait (0.1) seconds\nend\n\nwhen I receive [level_editor v]\nclone\n\nwhen I start as a clone\nforever\n    go to x: (item (i) of [enemyx v]) y: (item (i) of [enemyy v])\n    if <((i) - (1)) < (length of [enemyx v])> then\n        show\n    else\n        hide\n    end\n    go to [back v] layer\nend\n\ndefine clone\nset [i v] to [1]\nrepeat (3)\n    create clone of (_myself_ v)\n    change [i v] by (1)\nend\n\nwhen I start as a clone\nforever\n    switch costume to (hitbox v)\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        if <(TOOL) = [delete]> then\n            start sound [restart v]\n            delete (item # of [enemy] in [actionhistory v]) of [actionhistory v]\n            delete (i) of [enemyx v]\n            delete (i) of [enemyy v]\n        end\n    end\n    switch costume to (enemyAnimation)\nend\n\nrepeat until <not <mouse down?>>\n    switch costume to (enemyAnimation)\nend\n\n@overlays\n\nwhen flag clicked\nhide\n\nwhen I receive [testlevel v]\nclear graphic effects\nset [playtesting? v] to [1]\nshow\nswitch costume to (load1 v)\nbroadcast (close_editor v) and wait\nswitch costume to (load2 v)\nbroadcast (redraw_level v) and wait\nswitch costume to (load3 v)\nbroadcast (initalize v) and wait\nhide\nbroadcast (game start v)\n\nwhen I receive [next level v]\nif <([won? v] of [player v]) = [1]> then\n    show\n    set [ghost v] effect to (35)\n    if <(LoadedLevel?) = [1]> then\n        switch costume to (winvariation2 v)\n    else\n        switch costume to (winvariation1 v)\n    end\n    set [loadedlevel? v] to [0]\n    wait until <not <key (space v) pressed?>>\n    wait until <key (space v) pressed?>\n    wait until <not <key (space v) pressed?>>\n    set [playtesting? v] to [0]\n    set [playtestorloaded? v] to [0]\n    broadcast (level_editor v)\n    hide\nelse\n    show\n    set [ghost v] effect to (35)\n    switch costume to (lose v)\n    wait until <not <<key (space v) pressed?> or <key (r v) pressed?>>>\n    wait until <<key (space v) pressed?> or <key (r v) pressed?>>\n    if <key (space v) pressed?> then\n        wait until <not <<key (space v) pressed?> or <key (r v) pressed?>>>\n        set [playtesting? v] to [0]\n        set [playtestorloaded? v] to [0]\n        broadcast (level_editor v)\n        hide\n    else\n        wait until <not <<key (space v) pressed?> or <key (r v) pressed?>>>\n        broadcast (testlevel v)\n    end\nend\n\nwhen I receive [return_editor v]\nset [playtesting? v] to [0]\nbroadcast (level_editor v)\n\nwhen I receive [game start v]\nforever\n    if <key (z v) pressed?> then\n        broadcast (return_editor v) and wait\n        stop [other scripts in sprite v]\n        stop [this script v]\n    end\nend\n\nwhen I receive [fadeout v]\nswitch costume to (white v)\ngo to [front v] layer\nshow\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nswitch backdrop to (white v)\nbroadcast (infocard v)\nwait (0.25) seconds\nstart sound [fall v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nwait (3) seconds\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nerase all\nwait (0.5) seconds\nbroadcast (testlevel v)\n\nclear graphic effects\nshow\ngo to [front v] layer\nswitch costume to ((1) + (0))\nswitch costume to ((costume [number v]) - (1))\n\n@editor_ink\n\nwhen I receive [level_editor v]\nset [i v] to [0]\nrepeat (20)\n    change [i v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\npoint in direction (pick random (0) to (359))\nforever\n    go to x: (item (i) of [inkx v]) y: (item (i) of [inky v])\n    if <((i) - (1)) < (length of [inksize v])> then\n        show\n    else\n        point in direction (pick random (0) to (359))\n        hide\n    end\n    if <(item (i) of [inksize v]) = [3]> then\n        set size to (500) %\n    else\n        if <(item (i) of [inksize v]) = [2]> then\n            set size to (175) %\n        else\n            set size to (75) %\n        end\n    end\n    go to [back v] layer\nend\n\nwhen I receive [close_editor v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        if <(TOOL) = [delete]> then\n            start sound [restart v]\n            delete (i) of [inkx v]\n            delete (i) of [inky v]\n            delete (i) of [inksize v]\n        end\n    end\nend\n\nbroadcast (level_editor v)\n\nbroadcast (close_editor v)\n\n@Save Code Utility\n\ndefine Load Save Code\nset [i v] to [1]\nset [output v] to []\ndelete all of [save code data v]\nrepeat until <(i) > (length of (Save Code))>\n    if <not <(letter (i) of (Save Code)) = []>> then\n        repeat until <(letter (i) of (Save Code)) = [_]>\n            set [output v] to (join (output) (letter (i) of (Save Code)))\n            change [i v] by (1)\n        end\n    end\n    change [i v] by (1)\n    add (output) to [save code data v]\n    set [output v] to []\nend\n\ndefine Generate Save Code\nset [i v] to [0]\nset [save code v] to []\nwait (0) seconds\nrepeat (length of [save code data v])\n    change [i v] by (1)\n    set [save code v] to (join (join (Save Code) (item (i) of [save code data v])) [_])\nend\ndelete all of [save code data v]\n\nwhen I receive [generate save code v]\nGenerate Save Code\n\nwhen I receive [load save code v]\nLoad Save Code\n\n@build_string\n\nwhen flag clicked\nhide\n\nwhen I receive [buttons v]\nshow\n\nwhen I receive [testlevel v]\nhide\n\nwhen I receive [level_editor v]\nhide\n\nwhen backdrop switches to [white v]\nhide\n\n@tutorial\n\nwhen I receive [editor.tutorial v]\nbroadcast (level_editor v)\ngo to x: (0) y: (0)\nhide\nset [ghost v] effect to (100)\nswitch costume to (bg.bg v)\nset [done? v] to [0]\ncreate clone of (_myself_ v)\nwait (0.7) seconds\nset [i v] to [0]\nset [slide v] to [1]\nrepeat until <(slide) = [9]>\n    Make Slide (slide)\n    change [slide v] by (Tutorial.WhichDir)\nend\nset [done? v] to [1]\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    show\n    repeat (12)\n        change [ghost v] effect by (-1.25)\n    end\n    go to [front v] layer\n    repeat (8)\n        change [ghost v] effect by (-1.25)\n    end\n    wait until <([done? v] of (join [tutorial] [])) = [1]>\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nelse\n    set [ghost v] effect to (100)\n    show\n    if <not <<(id) = [hitbox1]> or <(id) = [hitbox2]>>> then\n        if <(Performance Mode) = [0]> then\n            change y by (-10)\n            repeat (10)\n                change [ghost v] effect by (-10)\n                change y by (1)\n            end\n        else\n            clear graphic effects\n        end\n    else\n        switch costume to (button.hitbox v)\n        set [ghost v] effect to (99.9)\n        show\n        repeat until <([delete? v] of (join [tutorial] [])) = [1]>\n            go to [front v] layer\n        end\n    end\nend\nwait until <([delete? v] of (join [tutorial] [])) = [1]>\nif <(Performance Mode) = [0]> then\n    repeat (10)\n        change [ghost v] effect by (10)\n        change y by (-1)\n    end\nend\ndelete this clone\n\ndefine Make Slide (id)\nset [tutorial.whichdir v] to [0]\nset [delete? v] to [0]\nif <(id) = [1]> then\n    switch costume to (slide.1 v)\n    Buttons [10] [100] [0] [-75]\nelse\n    if <(id) = [2]> then\n        switch costume to (slide.2 v)\n        Buttons [11] [100] [50] [-100]\n    else\n        if <(id) = [3]> then\n            switch costume to (slide.3 v)\n            Buttons [11] [100] [35] [-50]\n        else\n            if <(id) = [4]> then\n                switch costume to (slide.4 v)\n                Buttons [11] [100] [50] [-160]\n                Spawn Decoration/Image [4] [variablesv3] [0] [0]\n            else\n                if <(id) = [5]> then\n                    switch costume to (slide.5 v)\n                    Buttons [11] [100] [20] [-50]\n                else\n                    if <(id) = [6]> then\n                        switch costume to (slide.6 v)\n                        Buttons [11] [100] [20] [-65]\n                    else\n                        if <(id) = [7]> then\n                            switch costume to (slide.7 v)\n                            Buttons [11] [100] [35] [-10]\n                        else\n                            if <(id) = [8]> then\n                                switch costume to (slide.8 v)\n                                Buttons [21] [100] [0] [-75]\n                            else\n                                set [slide v] to [8]\n                                switch costume to (slide.err v)\n                                Buttons [20] [100] [0] [-65]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\ngo to [front v] layer\nshow\nif <(Performance Mode) = [0]> then\n    go to x: (0) y: (10)\n    repeat (10)\n        change [ghost v] effect by (-10)\n        change y by (-1)\n    end\nelse\n    go to x: (0) y: (0)\n    clear graphic effects\nend\nwait until <not <(Tutorial.WhichDir) = [0]>>\nDelete Current Slide\n\ndefine Buttons (button type) (distance apart) (x offset) (y)\nadd (x position) to [olddata v]\nadd (y position) to [olddata v]\nadd (costume [number v]) to [olddata v]\nif <(letter (1) of (button type)) = [1]> then\n    go to x: (x offset) y: (y)\n    if <(letter (2) of (button type)) = [1]> then\n        change x by ((distance apart) / (2))\n    end\n    switch costume to (button.next v)\n    set [id v] to [button]\n    go to [front v] layer\n    set [clone? v] to [1]\n    create clone of (_myself_ v)\n    switch costume to (button.hitbox v)\n    set [id v] to [hitbox1]\n    go to [front v] layer\n    create clone of (_myself_ v)\n    set [clone? v] to [0]\nend\nif <(letter (1) of (button type)) = [2]> then\n    go to x: (x offset) y: (y)\n    if <(letter (2) of (button type)) = [1]> then\n        change x by ((distance apart) / (2))\n    end\n    switch costume to (button.finish v)\n    set [id v] to [button]\n    go to [front v] layer\n    set [clone? v] to [1]\n    create clone of (_myself_ v)\n    switch costume to (button.hitbox v)\n    set [id v] to [hitbox1]\n    go to [front v] layer\n    create clone of (_myself_ v)\n    set [clone? v] to [0]\nend\nif <(letter (2) of (button type)) = [1]> then\n    go to x: (x offset) y: (y)\n    if <<(letter (1) of (button type)) = [1]> or <(letter (1) of (button type)) = [2]>> then\n        change x by (((distance apart) / (2)) * (-1))\n    end\n    switch costume to (button.previous v)\n    set [id v] to [button]\n    go to [front v] layer\n    set [clone? v] to [1]\n    create clone of (_myself_ v)\n    switch costume to (button.hitbox v)\n    set [id v] to [hitbox2]\n    go to [front v] layer\n    create clone of (_myself_ v)\n    set [clone? v] to [0]\nend\ngo to x: (item (1) of [olddata v]) y: (item (2) of [olddata v])\nswitch costume to (item (3) of [olddata v])\ndelete all of [olddata v]\n\ndefine Delete Current Slide\nset [delete? v] to [1]\nif <(Performance Mode) = [0]> then\n    repeat (10)\n        change [ghost v] effect by (10)\n        change y by (1)\n    end\nend\nhide\n\ndefine Spawn Decoration/Image (slide) (name) (x) (y)\ngo to x: (0) y: (0)\ndelete all of [olddata v]\nadd (x position) to [olddata v]\nadd (y position) to [olddata v]\nadd (costume [number v]) to [olddata v]\nset [id v] to [decor]\nswitch costume to (join [slide] (join (slide) (join [.] (name))))\nset [clone? v] to [1]\ncreate clone of (_myself_ v)\nset [clone? v] to [0]\ngo to x: (item (1) of [olddata v]) y: (item (2) of [olddata v])\nswitch costume to (item (3) of [olddata v])\ndelete all of [olddata v]\n\nwhen this sprite clicked\nif <(costume [number v]) = [5]> then\n    if <(id) = [hitbox1]> then\n        set [tutorial.whichdir v] to [1]\n    else\n        if <(id) = [hitbox2]> then\n            set [tutorial.whichdir v] to [-1]\n        end\n    end\nend\n\nwhen I receive [buttons v]\nset [maingone? v] to [0]\nshow\ngo to x: (0) y: (0)\nset [toggle? v] to [0]\nrepeat until <(MAINGONE?) = [1]>\n    switch costume to (checkhitbox v)\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        if <(toggle?) = [1]> then\n            set [toggle? v] to [0]\n        else\n            set [toggle? v] to [1]\n        end\n    end\n    repeat until <not <mouse down?>>\n        switch costume to ((17) + (toggle?))\n    end\n    switch costume to ((17) + (toggle?))\nend\nhide\n\nwhen I receive [level_editor v]\nhide\nset [maingone? v] to [1]\n\nwhen I receive [testlevel v]\nhide\nset [maingone? v] to [1]\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [white v]\nhide\nset [maingone? v] to [1]\n\n@LevelStatsController\n\ndefine time calculation (timer)\nif <(letter (2) of ([floor v] of ((timer) mod (60)) )) = []> then\n    set [time v] to (join ([floor v] of ((timer) / (60)) ) (join [:0] ([floor v] of ((timer) mod (60)) )))\nelse\n    set [time v] to (join ([floor v] of ((timer) / (60)) ) (join [:] ([floor v] of ((timer) mod (60)) )))\nend\n\ndefine timeloop\nrepeat until <(lvldone?) = [1]>\n    time calculation (timer)\n    set [leveltrust v] to (((timer) - (Deaths)) / (2))\nend\n\nwhen flag clicked\nset [lvldone? v] to [1]\nhide variable [deaths v]\nhide variable [time v]\n\nwhen I receive [game start v]\nset [deaths v] to [0]\nset [lvldone? v] to [0]\nreset timer\ntimeloop\n\nwhen I receive [next level v]\nif <([won? v] of [player v]) = [1]> then\n    set [lvldone? v] to [1]\n    show variable [time v]\n    show variable [deaths v]\nend\n\nwhen I receive [red v]\nchange [deaths v] by (1)\n\nwhen I receive [level_editor v]\nhide variable [deaths v]\nhide variable [time v]\n\nwhen I receive [stopgame v]\nhide variable [deaths v]\nhide variable [time v]\n\n@titleLeveleditortag\n\nwhen I receive [game start v]\nhide\n\nwhen I receive [level_editor v]\nif <not <(Performance Mode) = [1]>> then\n    set [speed v] to [0]\n    repeat until <(speed) = [9]>\n        change y by (speed)\n        change [ghost v] effect by ((speed) * (3))\n        change [speed v] by (1)\n    end\n    hide\nelse\n    hide\nend\n\nwhen I receive ["the platformer" v]\ngo to x: (0) y: (-82)\nswitch costume to (costume1 v)\nwait (0.095) seconds\nshow\nrepeat (10)\n    next costume\nend\n\nwhen I receive [startmove v]\nif <not <(Performance Mode) = [1]>> then\n    set [speed v] to [0]\n    repeat until <(speed) = [9]>\n        change y by (speed)\n        change [speed v] by (1)\n    end\n    broadcast (buttons v)\n    repeat until <(speed) = [0]>\n        change y by (speed)\n        change [speed v] by (-1)\n    end\nelse\n    broadcast (buttons v)\n    go to x: (0) y: (-1)\nend\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [white v]\nhide\n\n@noteblocks\n\nwhen I start as a clone\nif <(_TYPE) = [1]> then\n\nwhen I start as a clone\nset [clone? v] to [1]\nif <(_TYPE) = [1]> then\n    show\n    set [ghost v] effect to (99.999)\n    if <(_MODE) = [1]> then\n        wait until <touching (player v)?>\n        set [_type v] to [0]\n        create clone of (_myself_ v)\n        set [_type v] to [1]\n        wait until <not <touching (player v)?>>\n        delete this clone\n    else\n        forever\n            wait until <touching (player v)?>\n            set [_type v] to [0]\n            create clone of (_myself_ v)\n            set [_type v] to [1]\n            wait until <not <touching (player v)?>>\n        end\n    end\nelse\n    if <(EDIT_MODE) = [0]> then\n        set size to (100) %\n        set [ghost v] effect to (100)\n        show\n        change x by (13)\n        change y by (-2)\n        repeat (10)\n            change [ghost v] effect by (-3)\n            change y by (1.5)\n        end\n        wait (1) seconds\n        repeat (10)\n            change [ghost v] effect by (3)\n            change y by (5)\n        end\n        delete this clone\n    else\n        show\n        wait (0) seconds\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nif <(_TYPE) = [1]> then\n\nwhen I start as a clone\nif <(_TYPE) = [1]> then\n\nforever\n    create clone of (_myself_ v)\n    wait (1) seconds\nend\n\ndefine Render <spawn hitboxes>\nset [currentnoteblock v] to [Noteblock Stats Loading...]\nset [i v] to [0]\nhide variable [currentnoteblock v]\nrepeat ((length of [noteblocks v]) / (8))\n    change [i v] by (1)\n    set x to (item (i) of [noteblocks v])\n    change [i v] by (1)\n    set y to (item (i) of [noteblocks v])\n    change [i v] by (1)\n    set size to (item (i) of [noteblocks v]) %\n    change [i v] by (1)\n    set [_mode v] to (item (i) of [noteblocks v])\n    switch costume to (hit v)\n    set [_type v] to [0]\n    if <spawn hitboxes> then\n        set [_type v] to [1]\n    end\n    if <touching (mouse-pointer v)?> then\n        change [i v] by (1)\n        show variable [currentnoteblock v]\n        set [currentnoteblock v] to [Noteblock | ]\n        if <(item (i) of [noteblocks v]) = [1]> then\n            change [i v] by (1)\n            set [currentnoteblock v] to (join (currentNoteblock) (join [Sound ] (item (i) of [noteblocks v])))\n            change [i v] by (2)\n        else\n            if <(item (i) of [noteblocks v]) = [2]> then\n                change [i v] by (1)\n                set [currentnoteblock v] to (join [Noteblock | Note ] (join (item (i) of [noteblocks v]) [ | ]))\n                change [i v] by (1)\n                set [currentnoteblock v] to (join (currentNoteblock) (join [Insturment ] (join (item (i) of [noteblocks v]) [ | ])))\n                change [i v] by (1)\n                if <(item (i) of [noteblocks v]) = [1]> then\n                    set [currentnoteblock v] to (join (currentNoteblock) (join (item (i) of [noteblocks v]) [ beat]))\n                else\n                    set [currentnoteblock v] to (join (currentNoteblock) (join (item (i) of [noteblocks v]) [ beats]))\n                end\n            end\n        end\n    else\n        change [i v] by (4)\n    end\n    set [@sound_or_note v] to (item ((i) - (3)) of [noteblocks v])\n    set [@note v] to (item ((i) - (2)) of [noteblocks v])\n    set [@inst v] to (item ((i) - (1)) of [noteblocks v])\n    set [@beats v] to (item ((i) - (0)) of [noteblocks v])\n    switch costume to ((4) + ((2) - (_MODE)))\n    create clone of (_myself_ v)\nend\n\nask [x] and wait\nadd (answer) to [noteblocks v]\nask [y] and wait\nadd (answer) to [noteblocks v]\nask [size] and wait\nadd (answer) to [noteblocks v]\nask [1=1x 2=infinte] and wait\nadd (answer) to [noteblocks v]\nask [mode] and wait\nadd (answer) to [noteblocks v]\nif <(answer) = [1]> then\n    ask [sound] and wait\n    add (answer) to [noteblocks v]\n    add [] to [noteblocks v]\n    add [] to [noteblocks v]\nelse\n    ask [note] and wait\n    add (answer) to [noteblocks v]\n    ask [inst] and wait\n    add (answer) to [noteblocks v]\n    ask [beats] and wait\n    add (answer) to [noteblocks v]\nend\n\nwhen I receive [new_level v]\ndelete all of [noteblocks v]\n\nwhen I receive [level_editor v]\nwait (0) seconds\nforever\n    Render <>\nend\n\nwhen I receive [close_editor v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [restartlevel v]\nif <(clone?) = [0]> then\n    Render \nend\ndelete this clone\n\ngo to (player v)\nchange x by (13)\nrepeat (10)\n    change [ghost v] effect by (-3)\n    change y by (1.5)\nend\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (3)\n    change y by (5)\nend\ndelete this clone\n\nwhen [q v] key pressed\n\nwhen I receive [game start v]\nRender \n\nif <(clone?) = [0]> then\n    add (mouse x) to [noteblocks v]\n    add (mouse y) to [noteblocks v]\n    ask [Enter the Hitbox Size] and wait\n    add (answer) to [noteblocks v]\n    ask [Select Amount of uses \(1 = 1x, 2 = Infinite\)] and wait\n    add (answer) to [noteblocks v]\n    ask [Select Type \(1 = Sound Effect, 2 = Instrument\)] and wait\n    add (answer) to [noteblocks v]\n    if <(answer) = [1]> then\n        ask [Enter Sound Number] and wait\n        add (answer) to [noteblocks v]\n        add [] to [noteblocks v]\n        add [] to [noteblocks v]\n    else\n        ask [Enter Note] and wait\n        add (answer) to [noteblocks v]\n        ask [Choose Instrument] and wait\n        add (answer) to [noteblocks v]\n        ask [Choose Length in Beats \(Tempo = 60\)] and wait\n        add (answer) to [noteblocks v]\n    end\nend\n\n@Level Metadata Manager\n\ndefine Is (letter) a capital letter?\nif <[caps v] contains (letter)?> then\n    switch costume to (costume1 v)\n    set [cap_temp v] to (item (item # of (letter) in [caps v]) of [caps v])\n    replace item (item # of (letter) in [caps v]) of [caps v] with (letter)\n    switch costume to (caps)\n    set [capital? v] to <(caps) = (costume [name v])>\n    replace item (item # of (letter) in [caps v]) of [caps v] with (cap_TEMP)\nelse\n    set [capital? v] to [false]\nend\nswitch costume to (costume1 v)\n\ndefine Encode (string)\nset [j v] to [1]\nset [output v] to []\nrepeat (length of (string))\n    Is (letter (j) of (string)) a capital letter?\n    if <(Capital?) = [true]> then\n        set [output2 v] to ((item # of (letter (j) of (string)) in [code v]) + (26))\n    else\n        set [output2 v] to (item # of (letter (j) of (string)) in [code v])\n    end\n    if <(length of (output2)) = [1]> then\n        set [output v] to (join (output) (join [0] (output2)))\n    else\n        set [output v] to (join (output) (output2))\n    end\n    change [j v] by (1)\nend\n\ndefine import (stuff) to list # (id)\nif <(id) = [3]> then\n    delete all of [string v]\n    repeat (length of (stuff))\n        add (letter ((length of [string v]) + (1)) of (stuff)) to [string v]\n    end\nelse\n    if <(id) = [2]> then\n        delete all of [caps v]\n        repeat (length of (stuff))\n            add (letter ((length of [caps v]) + (1)) of (stuff)) to [caps v]\n        end\n    else\n        if <(id) = [1]> then\n            delete all of [code v]\n            repeat (length of (stuff))\n                add (letter ((length of [code v]) + (1)) of (stuff)) to [code v]\n            end\n        end\n    end\nend\n\ndefine Decode (num)\nset [output v] to []\nset [i v] to [1]\nrepeat ((length of (num)) / (2))\n    set [output v] to (join (output) (item ((join (letter (i) of (num)) (letter ((i) + (1)) of (num))) + (0)) of [code v]))\n    change [i v] by (2)\nend\n\ndefine Letters (1) to (2) in (item)\nset [output v] to []\nrepeat (((2) - (1)) + (1))\n    set [output v] to (join (output) (letter ((1) + (length of (output))) of (item)))\nend\n\nLetters [1] to ((item # of [█] in [string v]) - (1)) in (string)\nadd (output) to [level details v]\nLetters ((item # of [█] in [string v]) + (1)) to (length of (string)) in (string)\nadd (output) to [level details v]\n\ndefine MakeLevelDetailsCode (name)\nEncode (join (name) (join [█] (join (username) (join [▄] (join (current [month v]) (join [/] (join (current [date v]) (join [/] (current [year v])))))))))\nset [i v] to [1]\nset [j v] to []\nrepeat (length of (output))\n    set [j v] to (join (j) (item ((letter (i) of (output)) + (1)) of [encode_table v]))\n    change [i v] by (1)\nend\nset [output v] to (j)\nset [details_basket v] to (j)\n\ndefine LoadLevelDetailsCode (code)\ndelete all of [level details v]\nTurnStringIntoNumberString (code)\nDecode (output)\nimport (output) to list # [3]\nLetters [1] to ((item # of [█] in [string v]) - (1)) in (string)\nadd (output) to [level details v]\nLetters ((item # of [█] in [string v]) + (1)) to ((item # of [▄] in [string v]) - (1)) in (string)\nadd (output) to [level details v]\nLetters ((item # of [▄] in [string v]) + (1)) to (length of (string)) in (string)\nadd (output) to [level details v]\n\nwhen I receive [makedetailscode v]\nMakeLevelDetailsCode (DETAILS_BASKET)\n\nwhen I receive [loaddetailscode v]\nLoadLevelDetailsCode (DETAILS_BASKET)\n\ndefine TurnStringIntoNumberString (1)\nset [i v] to [1]\nset [j v] to []\nrepeat (length of (1))\n    set [j v] to (join (j) ((item # of (letter (i) of (1)) in [encode_table v]) - (1)))\n    change [i v] by (1)\nend\nset [output v] to (j)\n\nMakeLevelDetailsCode [Test 1234]\n\nTurnStringIntoNumberString (j)\n\nLoadLevelDetailsCode (output)\n\nLoadLevelDetailsCode [chbaaiabchacaijgbbaeajgdgdfjffjhfjheffgbheffgdffgd]\n\n@InfoCardLogo\n\nwhen I receive [infocard v]\nshow\n\nwhen flag clicked\nhide\n\nwhen I receive [testlevel v]\nhide\n\n@FontEngine\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)\nset [_i8 v] to [0]\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        set [_i8 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 [_ia v] to (item (_i9) of [_chwidth v])\n            set [_ib v] to (item (_i9) of [_chkern v])\n            set [_ib v] to ((join (join (letter ((_i8) - (3)) of (_ib)) (letter ((_i8) - (2)) of (_ib))) (join (letter ((_i8) - (1)) of (_ib)) (letter (_i8) of (_ib)))) / (1000))\n            if <((_i5) + ((_ib) + (_ia))) > (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 ((_ia) + (cspace))\n                set [_i6 v] to (_i4)\n                set [_i7 v] to ((-1) * ((cspace) + (spacewidth)))\n            else\n                change [_i5 v] by (((_ib) + (_ia)) + (cspace))\n            end\n            add (_i9) to [_ww0 v]\n        end\n        set [_i8 v] to ((4) * (_i9))\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\ndefine _sortRaster (lo) (hi)\nset [_i4 v] to ([ceiling v] of ((((hi) - (lo)) + (1)) / (4)) )\nrepeat until <(_i4) < [1]>\n    set [_i5 v] to ((lo) + (_i4))\n    set [_i4 v] to ((-1) * (_i4))\n    set [_i6 v] to (_i5)\n    repeat (((hi) + (1)) - (_i6))\n        set [_i7 v] to (item (_i6) of [_raster v])\n        set [_i9 v] to (item (_i6) of [_rasterdir v])\n        set [_i8 v] to (_i6)\n        repeat until <<(_i8) < (_i5)> or <not <(item ((_i8) + (_i4)) of [_raster v]) > (_i7)>>>\n            replace item (_i8) of [_raster v] with (item ((_i8) + (_i4)) of [_raster v])\n            replace item (_i8) of [_rasterdir v] with (item ((_i8) + (_i4)) of [_rasterdir v])\n            change [_i8 v] by (_i4)\n        end\n        replace item (_i8) of [_raster v] with (_i7)\n        replace item (_i8) of [_rasterdir v] with (_i9)\n        change [_i6 v] by (1)\n    end\n    if <(_i4) = [-2]> then\n        set [_i4 v] to [1]\n    else\n        set [_i4 v] to ([floor v] of ((_i4) / (-2.25)) )\n    end\nend\n\nwhen flag clicked\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]\nClear | Cache\n\ndefine Clear | Cache\nset [_i0 v] to [1]\nrepeat (length of [_chindex v])\n    set [_i1 v] to ((item (_i0) of [_chindex v]) + (2))\n    repeat (20)\n        replace item (_i1) of [_chdata0 v] with []\n        replace item (_i1) of [_chdata1 v] with []\n        replace item (_i1) of [_chdata2 v] with []\n        replace item (_i1) of [_chdata3 v] with []\n        replace item (_i1) of [_chdata4 v] with []\n        change [_i1 v] by (1)\n    end\n    change [_i0 v] by (1)\nend\ndelete all of [_cacheidx v]\ndelete all of [_cache0 v]\ndelete all of [_cache1 v]\ndelete all of [_raster v]\ndelete all of [_rasterdir v]\nset [_cid v] to [0]\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 [_chkern v]\ndelete all of [_chdata0 v]\ndelete all of [_chdata1 v]\ndelete all of [_chdata2 v]\ndelete all of [_chdata3 v]\ndelete all of [_chdata4 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 [] to [_chdata4 v]\n    add (length of [_chdata0 v]) to [_chindex v]\n    add ((1) * (0)) to [_chwidth v]\n    add [] to [_chkern v]\n    repeat (110)\n        add [] to [_chdata0 v]\n        add [] to [_chdata1 v]\n        add [] to [_chdata2 v]\n        add [] to [_chdata3 v]\n        add [] to [_chdata4 v]\n    end\nend\nadd [__] to [_chdata0 v]\nadd [none] to [_chdata1 v]\nadd [] to [_chdata2 v]\nadd [] to [_chdata3 v]\nadd [] to [_chdata4 v]\ndelete all of [_cacheidx v]\ndelete all of [_cache0 v]\ndelete all of [_cache1 v]\ndelete all of [_raster v]\ndelete all of [_rasterdir v]\nset [_cid v] to [0]\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    replace item (_i2) of [_chkern v] with (item ((_i0) + (2)) of [_fontdata v])\n    set [_i2 v] to (item (_i2) of [_chindex v])\n    replace item (_i2) of [_chdata1 v] with (_i1)\n    replace item (_i2) of [_chdata2 v] with (item ((_i0) + (3)) of [_fontdata v])\n    replace item (_i2) of [_chdata3 v] with (item ((_i0) + (4)) of [_fontdata v])\n    replace item ((_i2) + (1)) of [_chdata2 v] with (item ((_i0) + (5)) of [_fontdata v])\n    replace item ((_i2) + (1)) of [_chdata3 v] with (item ((_i0) + (6)) of [_fontdata v])\n    if <([abs v] of (item ((_i2) + (1)) of [_chdata3 v]) ) > ([abs v] of (item ((_i2) + (1)) of [_chdata2 v]) )> then\n        replace item ((_i2) + (1)) of [_chdata4 v] with ((4) * ([abs v] of (item ((_i2) + (1)) of [_chdata3 v]) ))\n    else\n        replace item ((_i2) + (1)) of [_chdata4 v] with ((4) * ([abs v] of (item ((_i2) + (1)) of [_chdata2 v]) ))\n    end\n    replace item ((_i2) + (22)) of [_chdata0 v] with [string]\n    replace item ((_i2) + (22)) of [_chdata1 v] with (item ((_i0) + (7)) of [_fontdata v])\n    change [_i0 v] by (8)\nend\n\ndefine _printChar (id) (x) (y) (size) (min) (max) (new)\nset [_i2 v] to (item (id) of [_chindex v])\nset [_i3 v] to (item (_i2) of [_chdata1 v])\nif <(_i3) = [none]> then\n    stop [this script v]\nend\nif <((y) + ((size) * (item ((_i2) + (1)) of [_chdata3 v]))) < [-184]> then\n    stop [this script v]\nend\nif <((x) + ((size) * (item (_i2) of [_chdata2 v]))) > [244]> then\n    stop [this script v]\nend\nif <((x) + ((size) * (item (_i2) of [_chdata3 v]))) < [-244]> then\n    stop [this script v]\nend\nif <((y) + ((size) * (item ((_i2) + (1)) of [_chdata2 v]))) > [184]> then\n    stop [this script v]\nend\nif <(item ((_i2) + (22)) of [_chdata0 v]) = [0]> then\n    stop [this script v]\nend\nset [_i4 v] to ((_i2) + (2))\nrepeat (20)\n    if <(item (_i4) of [_chdata0 v]) = (_i3)> then\n        set [_i5 v] to (item (_i4) of [_chdata1 v])\n        if <not <(_i5) < (min)>> then\n            if <not <(_i5) > (max)>> then\n                if <(_i4) > ((_i2) + (2))> then\n                    set [_i6 v] to (item (_i4) of [_chdata2 v])\n                    set [_i7 v] to (item (_i4) of [_chdata3 v])\n                    set [_i8 v] to (item (_i4) of [_chdata4 v])\n                    repeat ((_i4) - ((_i2) + (2)))\n                        replace item (_i4) of [_chdata0 v] with (item ((_i4) - (1)) of [_chdata0 v])\n                        replace item (_i4) of [_chdata1 v] with (item ((_i4) - (1)) of [_chdata1 v])\n                        replace item (_i4) of [_chdata2 v] with (item ((_i4) - (1)) of [_chdata2 v])\n                        replace item (_i4) of [_chdata3 v] with (item ((_i4) - (1)) of [_chdata3 v])\n                        replace item (_i4) of [_chdata4 v] with (item ((_i4) - (1)) of [_chdata4 v])\n                        change [_i4 v] by (-1)\n                    end\n                    replace item (_i4) of [_chdata0 v] with (item (_i2) of [_chdata1 v])\n                    replace item (_i4) of [_chdata1 v] with (_i5)\n                    replace item (_i4) of [_chdata2 v] with (_i6)\n                    replace item (_i4) of [_chdata3 v] with (_i7)\n                    replace item (_i4) of [_chdata4 v] with (_i8)\n                end\n                set [_i8 v] to (item ((_i2) + (2)) of [_chdata1 v])\n                set [_i9 v] to (round ((_i8) * (item (_i2) of [_chdata2 v])))\n                set x to ((x) + (((_i9) + (0.5)) * ((size) / (_i8))))\n                set [_i7 v] to (item ((_i2) + (2)) of [_chdata3 v])\n                if <(_i7) = []> then\n                    set [_i4 v] to (item ((_i2) + (2)) of [_chdata2 v])\n                    set [_i5 v] to ((size) / ((4) * (_i8)))\n                    if <(letter (1) of (_i4)) = [3]> then\n                        _drawChar3 (_i4) ((y) - ((500) * (_i5))) ((round ((_i8) * (item (_i2) of [_chdata3 v]))) - (_i9)) ((size) / (_i8)) (_i5)\n                    else\n                        _drawChar4 (_i4) ((y) - ((5000) * (_i5))) ((round ((_i8) * (item (_i2) of [_chdata3 v]))) - (_i9)) ((size) / (_i8)) (_i5)\n                    end\n                else\n                    change [_cid v] by (1)\n                    if <not <(item (_i7) of [_cacheidx v]) = (item ((_i2) + (2)) of [_chdata4 v])>> then\n                        _createCache (item ((_i2) + (2)) of [_chdata2 v]) ((_i2) + (2)) ((round ((_i8) * (item (_i2) of [_chdata3 v]))) - (_i9))\n                        set [_i7 v] to (_i3)\n                    end\n                    replace item ((_i7) + (1)) of [_cacheidx v] with (_cID)\n                    _drawCache (item ((_i7) + (2)) of [_cacheidx v]) (y) ((round ((_i8) * (item (_i2) of [_chdata3 v]))) - (_i9)) ((size) / (_i8)) ((size) / ((4) * (_i8)))\n                end\n                stop [this script v]\n            end\n        end\n    end\n    change [_i4 v] by (1)\nend\nif <((new) * ((item (_i2) of [_chdata3 v]) - (item (_i2) of [_chdata2 v]))) > [4850]> then\n    stop [this script v]\nend\nif <((new) * (item ((_i2) + (1)) of [_chdata4 v])) > [4950]> then\n    stop [this script v]\nend\nrepeat (19)\n    change [_i4 v] by (-1)\n    replace item (_i4) of [_chdata0 v] with (item ((_i4) - (1)) of [_chdata0 v])\n    replace item (_i4) of [_chdata1 v] with (item ((_i4) - (1)) of [_chdata1 v])\n    replace item (_i4) of [_chdata2 v] with (item ((_i4) - (1)) of [_chdata2 v])\n    replace item (_i4) of [_chdata3 v] with (item ((_i4) - (1)) of [_chdata3 v])\n    replace item (_i4) of [_chdata4 v] with (item ((_i4) - (1)) of [_chdata4 v])\nend\nset [_i4 v] to ((_i2) + (22))\nif <(item (_i4) of [_chdata0 v]) = [string]> then\n    _unpackDef (id) (_i4) (item (_i4) of [_chdata1 v])\nend\nif <(item (_i4) of [_chdata0 v]) = [0]> then\n    stop [this script v]\nend\nset [_i5 v] to (round ((new) * (item (_i2) of [_chdata2 v])))\n_rasterizeChar (_i4) (new) ((round ((new) * (item (_i2) of [_chdata3 v]))) - (_i5)) ((0) - (_i5))\nset [_i3 v] to (round ((new) * (item (_i2) of [_chdata2 v])))\nset x to ((x) + (((_i3) + (0.5)) * ((size) / (new))))\nset [_i6 v] to (item ((_i2) + (2)) of [_chdata3 v])\nif <(_i6) = []> then\n    set [_i4 v] to (item ((_i2) + (2)) of [_chdata2 v])\n    set [_i5 v] to ((size) / ((4) * (new)))\n    if <(letter (1) of (_i4)) = [3]> then\n        _drawChar3 (_i4) ((y) - ((500) * (_i5))) ((round ((new) * (item (_i2) of [_chdata3 v]))) - (_i3)) ((size) / (new)) (_i5)\n    else\n        _drawChar4 (_i4) ((y) - ((5000) * (_i5))) ((round ((new) * (item (_i2) of [_chdata3 v]))) - (_i3)) ((size) / (new)) (_i5)\n    end\nelse\n    _drawCache (item ((_i6) + (2)) of [_cacheidx v]) (y) ((round ((new) * (item (_i2) of [_chdata3 v]))) - (_i3)) ((size) / (new)) ((size) / ((4) * (new)))\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 _rasterizeChar (idx) (s) (columns) (o)\nrepeat (((41) * (columns)) - (length of [_raster v]))\n    add [] to [_raster v]\nend\nrepeat (((41) * (columns)) - (length of [_rasterdir v]))\n    add [] to [_rasterdir v]\nend\nset [_i3 v] to [1]\nrepeat (columns)\n    replace item (_i3) of [_raster v] with [0]\n    change [_i3 v] by (41)\nend\nset [_i3 v] to ((idx) + (1))\nrepeat (item (idx) of [_chdata0 v])\n    if <(letter (2) of (item (_i3) of [_chdata0 v])) = [+]> then\n        set [_i9 v] to ((1) * (1))\n    else\n        set [_i9 v] to ((1) * (-1))\n    end\n    if <(letter (1) of (item (_i3) of [_chdata0 v])) = [Q]> then\n        set [_i4 v] to (item (_i3) of [_chdata3 v])\n        set [_i5 v] to (round ((s) * (item (_i3) of [_chdata1 v])))\n        set [_i7 v] to (((41) * ((_i5) + (o))) + (1))\n        if <(_i4) = [z]> then\n            _rasterizeCurve [z] ((1) / ((item ((_i3) + (1)) of [_chdata0 v]) * (s))) [] [] ((((_i5) + (0.5)) / (s)) - (item ((_i3) + (1)) of [_chdata1 v])) ((s) * (item ((_i3) + (1)) of [_chdata2 v])) ((s) * (item ((_i3) + (1)) of [_chdata3 v])) ((s) * (item ((_i3) + (1)) of [_chdata4 v])) ((round ((s) * (item (_i3) of [_chdata2 v]))) - (_i5))\n        else\n            set [_i8 v] to (item ((_i3) + (1)) of [_chdata0 v])\n            set [_i6 v] to ((item (_i3) of [_chdata4 v]) / (_i8))\n            _rasterizeCurve (_i4) (_i6) (((_i6) * (_i6)) + (1e-7)) ((4) / ((41) * ((s) * (_i8)))) ((((41) * (s)) * ((item ((_i3) + (1)) of [_chdata1 v]) - (((_i5) + (0.5)) / (s)))) + (_i7)) ((s) * (item ((_i3) + (1)) of [_chdata2 v])) ((s) * (item ((_i3) + (1)) of [_chdata3 v])) ((s) * (item ((_i3) + (1)) of [_chdata4 v])) ((round ((s) * (item (_i3) of [_chdata2 v]))) - (_i5))\n        end\n        change [_i3 v] by (2)\n    else\n        set [_i4 v] to (round ((s) * (item (_i3) of [_chdata1 v])))\n        set [_i5 v] to (item (_i3) of [_chdata4 v])\n        set [_i7 v] to (((41) * ((_i4) + (o))) + (1))\n        if <(_i5) = [0]> then\n            set [_i6 v] to ((s) * (item (_i3) of [_chdata3 v]))\n            repeat ((round ((s) * (item (_i3) of [_chdata2 v]))) - (_i4))\n                set [_i8 v] to ((item (_i7) of [_raster v]) + (1))\n                replace item ((_i7) + (_i8)) of [_rasterdir v] with (_i9)\n                replace item ((_i7) + (_i8)) of [_raster v] with (_i6)\n                replace item (_i7) of [_raster v] with (_i8)\n                change [_i7 v] by (41)\n            end\n        else\n            set [_i6 v] to (((s) * (item (_i3) of [_chdata3 v])) + ((_i5) * (((_i4) + (0.5)) - ((s) * (item (_i3) of [_chdata1 v])))))\n            repeat ((round ((s) * (item (_i3) of [_chdata2 v]))) - (_i4))\n                set [_i8 v] to ((item (_i7) of [_raster v]) + (1))\n                replace item ((_i7) + (_i8)) of [_rasterdir v] with (_i9)\n                replace item ((_i7) + (_i8)) of [_raster v] with (_i6)\n                replace item (_i7) of [_raster v] with (_i8)\n                change [_i7 v] by (41)\n                change [_i6 v] by (_i5)\n            end\n        end\n        change [_i3 v] by (1)\n    end\nend\nset [_i3 v] to [1]\nrepeat (columns)\n    _sortRaster ((_i3) + (1)) ((_i3) + (item (_i3) of [_raster v]))\n    change [_i3 v] by (41)\nend\nset [_i3 v] to ((s) * (item ((_i2) + (1)) of [_chdata4 v]))\nset [_ib v] to [0]\nif <(_i3) < [495]> then\n    set [_i3 v] to [3]\n    set [_i4 v] to [1]\n    repeat (columns)\n        set [_i5 v] to []\n        set [_i6 v] to [0]\n        set [_i7 v] to [0]\n        set [_i8 v] to (_i4)\n        repeat (item (_i8) of [_raster v])\n            change [_i8 v] by (1)\n            if <(_i7) = [0]> then\n                set [_i9 v] to ((item (_i8) of [_raster v]) + (500))\n            else\n                if <((_i7) + (item (_i8) of [_rasterdir v])) = [0]> then\n                    set [_ia v] to ((item (_i8) of [_raster v]) + (500))\n                    if <((_ia) - (_i9)) > [4]> then\n                        set [_i9 v] to (round ((_i9) + (2)))\n                        set [_i5 v] to (join (_i5) (join (join ([floor v] of ((_i9) / (100)) ) (([floor v] of ((_i9) / (10)) ) mod (10))) ((_i9) mod (10))))\n                        set [_ia v] to ((round ((_ia) - (2))) - (_i9))\n                        set [_i5 v] to (join (_i5) (join (join ([floor v] of ((_ia) / (100)) ) (([floor v] of ((_ia) / (10)) ) mod (10))) ((_ia) mod (10))))\n                    else\n                        set [_i9 v] to (round (((_i9) + (_ia)) / (2)))\n                        set [_i5 v] to (join (_i5) (join (join (join ([floor v] of ((_i9) / (100)) ) (([floor v] of ((_i9) / (10)) ) mod (10))) ((_i9) mod (10))) [000]))\n                    end\n                    change [_i6 v] by (1)\n                    change [_ib v] by (1)\n                end\n            end\n            change [_i7 v] by (item (_i8) of [_rasterdir v])\n        end\n        set [_i3 v] to (join (_i3) (join (join ([floor v] of ((_i6) / (10)) ) ((_i6) mod (10))) (_i5)))\n        change [_i4 v] by (41)\n        change [_ib v] by (1)\n    end\nelse\n    set [_i3 v] to [4]\n    set [_i4 v] to [1]\n    repeat (columns)\n        set [_i5 v] to []\n        set [_i6 v] to [0]\n        set [_i7 v] to [0]\n        set [_i8 v] to (_i4)\n        repeat (item (_i8) of [_raster v])\n            change [_i8 v] by (1)\n            if <(_i7) = [0]> then\n                set [_i9 v] to ((item (_i8) of [_raster v]) + (5000))\n            else\n                if <((_i7) + (item (_i8) of [_rasterdir v])) = [0]> then\n                    set [_ia v] to ((item (_i8) of [_raster v]) + (5000))\n                    if <((_ia) - (_i9)) > [4]> then\n                        set [_i9 v] to (round ((_i9) + (2)))\n                        set [_i5 v] to (join (_i5) (join (join ([floor v] of ((_i9) / (1000)) ) (([floor v] of ((_i9) / (100)) ) mod (10))) (join (([floor v] of ((_i9) / (10)) ) mod (10)) ((_i9) mod (10)))))\n                        set [_ia v] to ((round ((_ia) - (2))) - (_i9))\n                        set [_i5 v] to (join (_i5) (join (join ([floor v] of ((_ia) / (1000)) ) (([floor v] of ((_ia) / (100)) ) mod (10))) (join (([floor v] of ((_ia) / (10)) ) mod (10)) ((_ia) mod (10)))))\n                    else\n                        set [_i9 v] to (round (((_i9) + (_ia)) / (2)))\n                        set [_i5 v] to (join (_i5) (join (join (join ([floor v] of ((_i9) / (1000)) ) (([floor v] of ((_i9) / (100)) ) mod (10))) (join (([floor v] of ((_i9) / (10)) ) mod (10)) ((_i9) mod (10)))) [0000]))\n                    end\n                    change [_i6 v] by (1)\n                    change [_ib v] by (1)\n                end\n            end\n            change [_i7 v] by (item (_i8) of [_rasterdir v])\n        end\n        set [_i3 v] to (join (_i3) (join (join ([floor v] of ((_i6) / (10)) ) ((_i6) mod (10))) (_i5)))\n        change [_i4 v] by (41)\n        change [_ib v] by (1)\n    end\nend\nreplace item ((_i2) + (2)) of [_chdata4 v] with []\nreplace item ((_i2) + (2)) of [_chdata3 v] with []\nreplace item ((_i2) + (2)) of [_chdata2 v] with (_i3)\nreplace item ((_i2) + (2)) of [_chdata1 v] with (s)\nreplace item ((_i2) + (2)) of [_chdata0 v] with (item (_i2) of [_chdata1 v])\nif <not <(_ib) > [109]>> then\n    change [_cid v] by (1)\n    _createCache (_i3) ((_i2) + (2)) (columns)\nend\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        insert [] at (_i6) of [_chdata4 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    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 [_chdata4 v] with ((1) * (_i9))\n    else\n        replace item (_i6) of [_chdata4 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 _rasterizeCurve (type) (bx) (bx2) (ax) (cx) (ay) (by) (cy) (rep)\nif <(type) = [p]> then\n    repeat (rep)\n        set [_i4 v] to ((item (_i7) of [_raster v]) + (1))\n        set [_i5 v] to ((bx) + ([sqrt v] of ((bx2) - ((ax) * ((cx) - (_i7)))) ))\n        replace item ((_i7) + (_i4)) of [_rasterdir v] with (_i9)\n        replace item ((_i7) + (_i4)) of [_raster v] with ((cy) + ((_i5) * ((by) + ((_i5) * (ay)))))\n        replace item (_i7) of [_raster v] with (_i4)\n        change [_i7 v] by (41)\n    end\nelse\n    if <(type) = [m]> then\n        repeat (rep)\n            set [_i4 v] to ((item (_i7) of [_raster v]) + (1))\n            set [_i5 v] to ((bx) - ([sqrt v] of ((bx2) - ((ax) * ((cx) - (_i7)))) ))\n            replace item ((_i7) + (_i4)) of [_rasterdir v] with (_i9)\n            replace item ((_i7) + (_i4)) of [_raster v] with ((cy) + ((_i5) * ((by) + ((_i5) * (ay)))))\n            replace item (_i7) of [_raster v] with (_i4)\n            change [_i7 v] by (41)\n        end\n    else\n        set [_i5 v] to (cx)\n        repeat (rep)\n            set [_i4 v] to ((item (_i7) of [_raster v]) + (1))\n            replace item ((_i7) + (_i4)) of [_rasterdir v] with (_i9)\n            replace item ((_i7) + (_i4)) of [_raster v] with ((cy) + ((_i5) * ((by) + ((_i5) * (ay)))))\n            replace item (_i7) of [_raster v] with (_i4)\n            change [_i7 v] by (41)\n            change [_i5 v] by (bx)\n        end\n    end\nend\n\ndefine _createCache (d) (idx) (c)\nif <(length of [_cacheidx v]) < [5400]> then\n    add (_cID) to [_cacheidx v]\n    set [_i3 v] to (length of [_cacheidx v])\n    add (_cID) to [_cacheidx v]\n    set [_i4 v] to (length of [_cache0 v])\n    add (_i4) to [_cacheidx v]\n    repeat (110)\n        add [] to [_cache0 v]\n        add [] to [_cache1 v]\n    end\nelse\n    set [_i3 v] to ([floor v] of ((length of [_cacheidx v]) / (3)) )\n    set [_i4 v] to [2]\n    set [_i5 v] to (item (2) of [_cacheidx v])\n    repeat (12)\n        set [_i6 v] to (((3) * (pick random (1) to (_i3))) - (1))\n        if <(item (_i6) of [_cacheidx v]) < (_i5)> then\n            set [_i4 v] to (_i6)\n            set [_i5 v] to (item (_i6) of [_cacheidx v])\n        end\n    end\n    replace item ((_i4) - (1)) of [_cacheidx v] with (_cID)\n    replace item (_i4) of [_cacheidx v] with (_cID)\n    set [_i3 v] to ((_i4) - (1))\n    set [_i4 v] to (item ((_i4) + (1)) of [_cacheidx v])\nend\nif <(letter (1) of (d)) = [3]> then\n    set [_i5 v] to [1]\n    repeat (c)\n        change [_i4 v] by (1)\n        change [_i5 v] by (2)\n        replace item (_i4) of [_cache0 v] with ((letter (_i5) of (d)) + ((10) * (letter ((_i5) - (1)) of (d))))\n        replace item (_i4) of [_cache1 v] with []\n        repeat (item (_i4) of [_cache0 v])\n            change [_i4 v] by (1)\n            change [_i5 v] by (6)\n            replace item (_i4) of [_cache0 v] with (((letter ((_i5) - (3)) of (d)) + ((10) * ((letter ((_i5) - (4)) of (d)) + ((10) * (letter ((_i5) - (5)) of (d)))))) - (500))\n            replace item (_i4) of [_cache1 v] with ((letter (_i5) of (d)) + ((10) * ((letter ((_i5) - (1)) of (d)) + ((10) * (letter ((_i5) - (2)) of (d))))))\n        end\n    end\nelse\n    set [_i5 v] to [1]\n    repeat (c)\n        change [_i4 v] by (1)\n        change [_i5 v] by (2)\n        replace item (_i4) of [_cache0 v] with ((letter (_i5) of (d)) + ((10) * (letter ((_i5) - (1)) of (d))))\n        replace item (_i4) of [_cache1 v] with []\n        repeat (item (_i4) of [_cache0 v])\n            change [_i4 v] by (1)\n            change [_i5 v] by (8)\n            replace item (_i4) of [_cache0 v] with (((letter ((_i5) - (4)) of (d)) + ((10) * ((letter ((_i5) - (5)) of (d)) + ((10) * ((letter ((_i5) - (6)) of (d)) + ((10) * (letter ((_i5) - (7)) of (d)))))))) - (5000))\n            replace item (_i4) of [_cache1 v] with ((letter (_i5) of (d)) + ((10) * ((letter ((_i5) - (1)) of (d)) + ((10) * ((letter ((_i5) - (2)) of (d)) + ((10) * (letter ((_i5) - (3)) of (d))))))))\n        end\n    end\nend\nreplace item (idx) of [_chdata4 v] with (_cID)\nreplace item (idx) of [_chdata3 v] with (_i3)\n\ndefine _drawChar3 (d) (y) (c) (xs) (ys)\nif <(xs) > [0.505]> then\n    set pen size to ((2) * (xs))\nelse\n    set pen size to (1.01)\nend\nset [_i3 v] to [1]\nrepeat (c)\n    change [_i3 v] by (2)\n    repeat ((letter (_i3) of (d)) + ((10) * (letter ((_i3) - (1)) of (d))))\n        change [_i3 v] by (6)\n        set y to ((y) + ((ys) * ((letter ((_i3) - (3)) of (d)) + ((10) * ((letter ((_i3) - (4)) of (d)) + ((10) * (letter ((_i3) - (5)) of (d))))))))\n        pen down\n        change y by ((ys) * ((letter (_i3) of (d)) + ((10) * ((letter ((_i3) - (1)) of (d)) + ((10) * (letter ((_i3) - (2)) of (d)))))))\n        pen up\n    end\n    change x by (xs)\nend\n\ndefine _drawChar4 (d) (y) (c) (xs) (ys)\nif <(xs) > [0.505]> then\n    set pen size to ((2) * (xs))\nelse\n    set pen size to (1.01)\nend\nset [_i3 v] to [1]\nrepeat (c)\n    change [_i3 v] by (2)\n    repeat ((letter (_i3) of (d)) + ((10) * (letter ((_i3) - (1)) of (d))))\n        change [_i3 v] by (8)\n        set y to ((y) + ((ys) * ((letter ((_i3) - (4)) of (d)) + ((10) * ((letter ((_i3) - (5)) of (d)) + ((10) * ((letter ((_i3) - (6)) of (d)) + ((10) * (letter ((_i3) - (7)) of (d))))))))))\n        pen down\n        change y by ((ys) * ((letter (_i3) of (d)) + ((10) * ((letter ((_i3) - (1)) of (d)) + ((10) * ((letter ((_i3) - (2)) of (d)) + ((10) * (letter ((_i3) - (3)) of (d)))))))))\n        pen up\n    end\n    change x by (xs)\nend\n\ndefine _drawCache (idx) (y) (c) (xs) (ys)\nif <(xs) > [0.505]> then\n    set pen size to ((2) * (xs))\nelse\n    set pen size to (1.01)\nend\nset [_i3 v] to (idx)\nrepeat (c)\n    change [_i3 v] by (1)\n    repeat (item (_i3) of [_cache0 v])\n        change [_i3 v] by (1)\n        set y to ((y) + ((ys) * (item (_i3) of [_cache0 v])))\n        pen down\n        change y by ((ys) * (item (_i3) of [_cache1 v]))\n        pen up\n    end\n    change x by (xs)\nend\n\ndefine Set Scaling | Factor (factor)\nif <(factor) = [auto]> then\n    set [_scale v] to [auto]\nelse\n    if <(factor) = ((1) * (factor))> then\n        if <(factor) < [0.5]> then\n            set [_scale v] to ((1) * (0.5))\n        else\n            set [_scale v] to ((1) * (factor))\n        end\n    else\n        set [_scale v] to [auto]\n    end\nend\n\ndefine _updateScaling (size)\nif <(_scale) = [auto]> then\n    set [_scmin v] to ((size) * (((2) / ((((size) * (size)) / (30)) + (1))) + (1)))\nelse\n    set [_scmin v] to ((size) * (_scale))\nend\nset [_scnew v] to ((1.2) * (_scMin))\nset [_scmax v] to ((1.44) * (_scMin))\n\ndefine Print | Pos (x) (y) Size (size) Bounds (xmin) (xmax) Space (cspace) Underline (ul.height) (ul.weight) Align (al.x) (al.y) Text (text)\npen up\nset [_i0 v] to ((size) + ((12) * <(size) = []>))\nset [_x v] to ((1) * (x))\nset [_y v] to ((1) * (y))\nif <<not <(_i0) > [0]>> or <(_i0) > [800]>> then\n    switch costume to ( _ v)\n    stop [this script v]\nend\n_updateScaling (_i0)\nset [_i1 v] to ((cspace) * (_i0))\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]>))\nif <(xmin) = []> then\n    set [_i4 v] to ((-1) / (0))\nelse\n    set [_i4 v] to (xmin)\nend\nif <(xmax) = []> then\n    set [_i5 v] to ((1) / (0))\nelse\n    set [_i5 v] to (xmax)\nend\n_printText (text) (x) ((y) - ((_i3) * (_i0))) (_i0) (_i4) (_i5) (_i1) (ul.height) (ul.weight) ((-1) * (_i2))\n\ndefine _printText (text) (x) (y) (size) (xmin) (xmax) (cspace) (ul.height) (ul.weight) (al.x)\nset [_x v] to (x)\nset [_y v] to (y)\nset [_width v] to [0]\nif <not <(al.x) = [0]>> then\n    _getWidth (text) (size) (cspace)\n    change [_x v] by ((al.x) * (_width))\nend\nset [_i0 v] to [1]\nset [_i1 v] to [0]\nif <<(xmin) = ((-1) / (0))> and <(xmax) = ((1) / (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            set [_i3 v] to (item ((costume [number v]) - (1)) of [_chkern v])\n            change [_x v] by (((size) * (join (join (letter ((_i1) - (3)) of (_i3)) (letter ((_i1) - (2)) of (_i3))) (join (letter ((_i1) - (1)) of (_i3)) (letter (_i1) of (_i3))))) / (1000))\n            _printChar ((costume [number v]) - (1)) (_x) (y) (size) (_scMin) (_scMax) (_scNew)\n            change [_x v] by (((size) * (item ((costume [number v]) - (1)) of [_chwidth v])) + (cspace))\n        end\n        set [_i1 v] to ((4) * ((costume [number v]) - (1)))\n        change [_i0 v] by (1)\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            set [_i3 v] to (item ((costume [number v]) - (1)) of [_chkern v])\n            change [_x v] by (((size) * (join (join (letter ((_i1) - (3)) of (_i3)) (letter ((_i1) - (2)) of (_i3))) (join (letter ((_i1) - (1)) of (_i3)) (letter (_i1) of (_i3))))) / (1000))\n            if <not <<(_x) < (xmin)> or <((_x) + ((size) * (item ((costume [number v]) - (1)) of [_chwidth v]))) > (xmax)>>> then\n                _printChar ((costume [number v]) - (1)) (_x) (y) (size) (_scMin) (_scMax) (_scNew)\n            end\n            change [_x v] by (((size) * (item ((costume [number v]) - (1)) of [_chwidth v])) + (cspace))\n        end\n        set [_i1 v] to ((4) * ((costume [number v]) - (1)))\n        change [_i0 v] by (1)\n    end\nend\nswitch costume to ( _ v)\nif <not <(ul.height) = []>> then\n    set [_i0 v] to (round (((0.1) * (((ul.weight) + <(ul.weight) = []>) * (size))) - (1)))\n    if <(_i0) < [1]> then\n        set [_i0 v] to [1]\n    end\n    set [_i1 v] to ((x) + ((al.x) * (_width)))\n    if <(_i1) < (xmin)> then\n        set [_i1 v] to (xmin)\n    end\n    set [_i2 v] to ((_x) - (cspace))\n    if <(_i2) > (xmax)> then\n        set [_i2 v] to (xmax)\n    end\n    _drawUnderline (_i1) (_i2) ((y) + ((ul.height) * (size))) (_i0)\nend\n\ndefine _getWidth (text) (size) (cspace)\nset [_width v] to [0]\nset [_i0 v] to [1]\nset [_i1 v] to [0]\nset [_i4 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        set [_i3 v] to (item (_i2) of [_chkern v])\n        change [_width v] by (((size) * (join (join (letter ((_i1) - (3)) of (_i3)) (letter ((_i1) - (2)) of (_i3))) (join (letter ((_i1) - (1)) of (_i3)) (letter (_i1) of (_i3))))) / (1000))\n        change [_i4 v] by (1)\n    end\n    set [_i1 v] to ((4) * (_i2))\n    change [_i0 v] by (1)\nend\nif <(_i4) > [0]> then\n    change [_width v] by ((-1) * (cspace))\nend\n\ndefine _drawUnderline (x0) (x1) (y) (weight)\nset pen size to (2)\nset y to ((y) + ((weight) / (2)))\nrepeat (weight)\n    set x to (x0)\n    pen down\n    set x to (x1)\n    pen up\n    change y by (-1)\nend\n\ndefine Print WW | Pos (x) (y) Size (size) Bounds (xmin) (xmax) (ymax) (ymin) Space (cspace) (lspace) Underline (ul.height) (ul.weight) Align (al.x) (al.y) Text (text)\npen up\nset [_i0 v] to ((size) + ((12) * <(size) = []>))\nset [_x v] to ((1) * (x))\nset [_y v] to ((1) * (y))\nif <<not <(_i0) > [0]>> or <(_i0) > [800]>> then\n    switch costume to ( _ v)\n    stop [this script v]\nend\n_updateScaling (_i0)\nset [_i1 v] to ((xmin) + ((-230) * <(xmin) = []>))\nset [_i2 v] to ((xmax) + ((230) * <(xmax) = []>))\nset [_i3 v] to (item (1) of [_chwidth v])\n_calcWW (text) (((_i2) - (_i1)) / (_i0)) (<not <(x) = []>> * (((x) - (_i1)) / (_i0))) ((1) * (cspace)) ((cspace) + (_i3))\nset [_i3 v] to ((al.x) + (((0.5) * <(al.x) = [c]>) + <(al.x) = [r]>))\nset [_i8 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) * (_i8)) / (((0.7) * (_i8)) + (1))) + ((length of [_ww1 v]) - <<(item (1) of [_ww2 v]) = [0]> and <(x) = []>>)))\n            else\n                set [_i4 v] to (((0.7) * (_i8)) / (((0.7) * (_i8)) + (1)))\n            end\n        end\n    end\nend\nset [_i5 v] to (round (((0.1) * (((ul.weight) + <(ul.weight) = []>) * (_i0))) - (1)))\nif <(_i5) < [1]> then\n    set [_i5 v] to [1]\nend\nif <(ymax) = []> then\n    set [_i6 v] to ((1) / (0))\nelse\n    set [_i6 v] to ((ymax) - (_i0))\nend\nif <(ymin) = []> then\n    set [_i7 v] to ((-1) / (0))\nelse\n    set [_i7 v] to (ymin)\nend\nset [_i8 v] to ((_i0) * ((-1) - ((0.7) * (_i8))))\nif <(x) = []> then\n    set [_i9 v] to [0]\nelse\n    set [_i9 v] to [1]\nend\n_printWW ((((1) - (_i3)) * (_i1)) + ((_i3) * (_i2))) (x) (_i9) ((1) * (y)) (_i0) (_i6) (_i7) ((cspace) * (_i0)) (_i8) ((ul.height) * (_i0)) (_i5) <not <(ul.height) = []>> ((-1) * ((_i3) * (_i0))) (_i4)\n\ndefine _printWW (x) (firstx) (firstline) (y) (size) (ymax) (ymin) (cspace) (lspace) (ul.height) (ul.weight) <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\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    repeat (item (_i0) of [_ww2 v])\n        set [_i2 v] to ((4) * (item ((_i1) - (1)) of [_ww0 v]))\n        set [_i3 v] to (item (item (_i1) of [_ww0 v]) of [_chkern v])\n        change [_x v] by (((size) * (join (join (letter ((_i2) - (3)) of (_i3)) (letter ((_i2) - (2)) of (_i3))) (join (letter ((_i2) - (1)) of (_i3)) (letter (_i2) of (_i3))))) / (1000))\n        _printChar (item (_i1) of [_ww0 v]) (_x) (_y) (size) (_scMin) (_scMax) (_scNew)\n        change [_x v] by (((size) * (item (item (_i1) of [_ww0 v]) of [_chwidth v])) + (cspace))\n        change [_i1 v] by (1)\n    end\n    if <undl> then\n        if <(_i0) = (firstline)> then\n            _drawUnderline (firstx) ((_x) - (cspace)) ((_y) + (ul.height)) (ul.weight)\n        else\n            _drawUnderline ((x) + ((al.x) * (item (_i0) of [_ww1 v]))) ((_x) - (cspace)) ((_y) + (ul.height)) (ul.weight)\n        end\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 New Lines | Number (lines) Size (size) Space (lspace)\nchange [_y v] by (((lines) + <(lines) = []>) * (((size) + ((12) * <(size) = []>)) * ((-1) - ((0.7) * ((lspace) + <(lspace) = []>)))))\n\ndefine Get Width | Size (size) Space (cspace) Text (text)\n_getWidth (text) ((size) + ((12) * <(size) = []>)) ((cspace) * ((size) + ((12) * <(size) = []>)))\n\ndefine LevelPrint (name) (user) (date) pos: (x) (y)\nLoad | Font [Handlee]\nSet Pen Color | RGBA [0] [0] [0] [0]\nPrint | Pos (x) (y) Size [15] Bounds [] [] Space [] Underline [] [] Align [] [] Text (name)\nPrint | Pos (x) ((y) + (-35)) Size [15] Bounds [] [] Space [] Underline [] [] Align [] [] Text (join [By: ] (user))\nif <(join (letter (1) of (date)) (join (letter (2) of (date)) (letter (3) of (date)))) = [bef]> then\n    Print | Pos (x) ((y) + (-60)) Size [15] Bounds [] [] Space [] Underline [] [] Align [] [] Text (join [Made ] (date))\nelse\n    Print | Pos (x) ((y) + (-60)) Size [15] Bounds [] [] Space [] Underline [] [] Align [] [] Text (join [Made on ] (date))\nend\n\nwhen I receive [infocard v]\nerase all\nLevelPrint (item (1) of [level details v]) (item (2) of [level details v]) (item (3) of [level details v]) pos: [-140] [-55]\n\n