Cactus (Pen Platformer)

Instructions: Arrow/WASD keys - Move\nDown/S - Charge jump\nR - Reset\nClick and drag - Scroll\nClick on a platform with M - Edit moves (click on a box to highlight it)\nClick on a platform with P - Edit details

@Stage\n\n@Pen\n\ndefine None\nset [codeindex v] to [3]\nrepeat (item (2) of [\['getparam', 'char', 'r'\] v])\n    go to x: (((item ((codeIndex) + (1)) of [\['getparam', 'char', 'r'\] v]) * (w)) + (x)) y: (((item ((codeIndex) + (2)) of [\['getparam', 'char', 'r'\] v]) * (h)) + (y))\n    if <(item (codeIndex) of [\['getparam', 'char', 'r'\] v]) = [0]> then\n        set pen size to (thick)\n        pen down\n        pen up\n    else\n        set pen size to (1)\n        pen down\n        set pen size to (thick)\n        repeat (item (codeIndex) of [\['getparam', 'char', 'r'\] v])\n            change [codeindex v] by (2)\n            go to x: (((item ((codeIndex) + (1)) of [\['getparam', 'char', 'r'\] v]) * (w)) + (x)) y: (((item ((codeIndex) + (2)) of [\['getparam', 'char', 'r'\] v]) * (h)) + (y))\n        end\n        pen up\n    end\n    change [codeindex v] by (3)\nend\nchange [strx v] by ((w) * ((item (1) of [\['getparam', 'char', 'r'\] v]) + (sp)))\nif <kern> then\n    if <[jkern! v] contains (char)?> then\n    else\n        if <(item (last) of [\['letter:of:', \['+', \['readvariable', 'charindex'\], 1\], \['getparam', 'str', 'r'\]\] v]) = [-10]> then\n            change [strx v] by ((-2) * (w))\n        end\n    end\nend\n\ndefine None\nset [charindex v] to [1]\nrepeat (length of (str))\n    INT Draw Char (letter (charIndex) of (str)) at (strX) (strY) W (w) H (h) PS (thick) SW (sp) StoreString (str) KernJ <kern>\n    change [charindex v] by (1)\nend\n\ndefine None\nset [strwidth v] to [0]\nset [charindex v] to [1]\nrepeat (length of (str))\n    change [strwidth v] by (item (1) of [\['letter:of:', \['readvariable', 'charindex'\], \['getparam', 'str', 'r'\]\] v])\n    if <kern> then\n        if <[jkern! v] contains (letter (charIndex) of (str))?> then\n        else\n            if <(item (last) of [\['letter:of:', \['+', \['readvariable', 'charindex'\], 1\], \['getparam', 'str', 'r'\]\] v]) = [-10]> then\n                change [strwidth v] by (-2)\n            end\n        end\n    end\n    change [charindex v] by (1)\nend\nset [strspacew v] to (((sp) * (strWidth)) / ((length of (str)) - (1)))\nchange [strwidth v] by ((sp) * (strWidth))\nif <(w) = [0]> then\n    set [stradaptw v] to (((h) - (thick)) / (8))\n    set [stradapth v] to (((h) - (thick)) / (8))\nelse\n    if <(h) = [0]> then\n        set [stradaptw v] to (((w) - (thick)) / (strWidth))\n        set [stradapth v] to (((w) - (thick)) / (strWidth))\n    else\n        set [stradaptw v] to (((w) - (thick)) / (strWidth))\n        set [stradapth v] to (((h) - (thick)) / (8))\n    end\nend\nif <(align) = [L]> then\n    set [strx v] to ((x) + ((thick) / (2)))\nelse\n    if <(align) = [C]> then\n        set [strx v] to ((x) - (((strWidth) * (strAdaptW)) / (2)))\n    else\n        set [strx v] to ((x) - (((strWidth) * (strAdaptW)) + ((thick) / (2))))\n    end\nend\nset [stry v] to ((y) - ((4) * (strAdaptH)))\nINT Draw String (str) W (strAdaptW) H (strAdaptH) PS (thick) SW (strSpaceW) KernJ <kern>\n\ndefine None\nset [dx v] to ((x2) - (x1))\nset [dy v] to ((y2) - (y1))\nset [dist v] to (((dx) * (dx)) + ((dy) * (dy)))\nset [dist v] to ([sqrt v] of (dist) )\n\ndefine Mouse Clicked?\nset [oldmouseclicked v] to (mouseClicked)\nset [mouseclicked v] to ((<(mouseClicked) > [0]> * <mouse down?>) + <mouse down?>)\nset [mouseclickedfor v] to (((mouseClickedFor) + (1)) * <mouse down?>)\n\ndefine None\nset [dcoordx v] to (((x) - (dOffsetX)) / (dZoom))\nset [dcoordy v] to (((y) - (dOffsetY)) / (dZoom))\n\ndefine None\nset [dcoordx v] to (((x) * (dZoom)) + (dOffsetX))\nset [dcoordy v] to (((y) * (dZoom)) + (dOffsetY))\n\ndefine None\nset [dx v] to ((([cos v] of (theta) ) * (x)) - (([sin v] of (theta) ) * (y)))\nset [dy v] to ((([sin v] of (theta) ) * (x)) + (([cos v] of (theta) ) * (y)))\n\ndefine None\nset pen color to (c)\ngo to x: (x) y: (y)\nset pen size to (s)\npen down\npen up\n\ndefine None\nset [x1 v] to (x1)\nset [y1 v] to (y1)\nset [x2 v] to (x2)\nset [y2 v] to (y2)\nif <(x1) > (xbound)> then\n    if <(x2) > (xbound)> then\n        stop [this script v]\n    else\n        set [x1 v] to (xbound)\n        set [y1 v] to ((y2) + (((x1) - (x2)) * (m)))\n    end\nend\nif <(x1) < (-xbound)> then\n    if <(x2) < (-xbound)> then\n        stop [this script v]\n    else\n        set [x1 v] to (-xbound)\n        set [y1 v] to ((y2) + (((x1) - (x2)) * (m)))\n    end\nend\nif <(y1) > (ybound)> then\n    if <(y2) > (ybound)> then\n        stop [this script v]\n    else\n        set [y1 v] to (ybound)\n        set [x1 v] to ((x2) + (((y1) - (y2)) / (m)))\n    end\nend\nif <(y1) < (-ybound)> then\n    if <(y2) < (-ybound)> then\n        stop [this script v]\n    else\n        set [y1 v] to (-ybound)\n        set [x1 v] to ((x2) + (((y1) - (y2)) / (m)))\n    end\nend\nif <(x2) > (xbound)> then\n    set [x2 v] to (xbound)\n    set [y2 v] to ((y1) + (((x2) - (x1)) * (m)))\nend\nif <(x2) < (-xbound)> then\n    set [x2 v] to (-xbound)\n    set [y2 v] to ((y1) + (((x2) - (x1)) * (m)))\nend\nif <(y2) > (ybound)> then\n    set [y2 v] to (ybound)\n    set [x2 v] to ((x1) + (((y2) - (y1)) / (m)))\nend\nif <(y2) < (-ybound)> then\n    set [y2 v] to (-ybound)\n    set [x2 v] to ((x1) + (((y2) - (y1)) / (m)))\nend\ngo to x: (x1) y: (y1)\nset pen size to (1)\npen down\nset pen size to (d)\ngo to x: (x2) y: (y2)\npen up\n\ndefine None\ngo to x: (x) y: (y)\nif <(distance to [mouse-pointer v]) < ((s) / (2))> then\n    set pen size to (s)\n    set pen color to (c)\n    pen down\n    pen up\n    set [bclicked v] to (<(mouseClicked) = [1]> + (0))\n    set [bhover v] to [1]\nelse\n    set [bclicked v] to [0]\n    set [bhover v] to [0]\nend\nchange [banyhover v] by (bHover)\n\ndefine Mouse Drag\nif <key (space v) pressed?> then\n    set [dmousedrag v] to [0]\nelse\n    if <<(mouseClicked) = [1]> and <(bAnyHover) = [0]>> then\n        set [dholdx v] to ((dZoom) * (mouse x))\n        set [dholdy v] to ((dZoom) * (mouse y))\n        set [dmousedrag v] to [1]\n    else\n        if <<(mouseClicked) = [2]> and <(dMouseDrag) = [1]>> then\n            change [doffsetx v] by ((dHoldX) - ((dZoom) * (mouse x)))\n            change [doffsety v] by ((dHoldY) - ((dZoom) * (mouse y)))\n            set [dholdx v] to ((dZoom) * (mouse x))\n            set [dholdy v] to ((dZoom) * (mouse y))\n        end\n    end\n    if <(mouseClicked) = [0]> then\n        set [dmousedrag v] to [0]\n    end\nend\n\ndefine Render <> <>\nif <resetting> then\n    set [moverate v] to ((1) / ((1) + ([e ^ v] of ((6) - ((moveT) * (0.12))) )))\nend\nDraw Player ((#platRadius) / (dZoom)) (#pSpines) (1.4) (1.2) <blueprints> <resetting>\nif <blueprints> then\n    Mouse - Platform Interaction\nend\nset [*platindex v] to [0]\nrepeat ((length of [*platforms v]) / (length of [\(platform\) v]))\n    if <blueprints> then\n        set pen color to (item (item ((*platIndex) + (5)) of [*platforms v]) of [\(blueprint colors\) v])\n    else\n        set pen color to (item (item ((*platIndex) + (5)) of [*platforms v]) of [\(platform colors\) v])\n    end\n    Draw Platform (*platIndex) + Radius (0) <resetting>\n    change [*platindex v] by (length of [\(platform\) v])\nend\nif <resetting> then\n    if <(moveT) < [100]> then\n        change [movet v] by (1.5)\n    else\n        set [movet v] to [-1]\n        set [*platindex v] to [0]\n        repeat ((length of [*platforms v]) / (length of [\(platform\) v]))\n            replace item ((*platIndex) + (1)) of [*platforms v] with (item ((*platIndex) + (11)) of [*platforms v])\n            replace item ((*platIndex) + (2)) of [*platforms v] with (item ((*platIndex) + (12)) of [*platforms v])\n            replace item ((*platIndex) + (7)) of [*platforms v] with (item ((*platIndex) + (10)) of [*platforms v])\n            set [*moveindex v] to (item (item ((*platIndex) + (8)) of [*platforms v]) of [*move indices v])\n            if <(item (*moveIndex) of [*moves v]) > [0]> then\n                if <(item ((*platIndex) + (9)) of [*platforms v]) > [-1]> then\n                    change [*moveindex v] by ((item ((*platIndex) + (9)) of [*platforms v]) * (length of [\(move\) v]))\n                    replace item ((*moveIndex) + (7)) of [*moves v] with [0]\n                end\n                replace item ((*platIndex) + (9)) of [*platforms v] with [0]\n            end\n            change [*platindex v] by (length of [\(platform\) v])\n        end\n        Reset Player <[] = []>\n    end\nend\n\ndefine None\ngo to x: (x1) y: (y1)\nset pen size to (1)\npen down\nset pen size to (s)\ngo to x: (x1) y: (y2)\ngo to x: (x2) y: (y2)\ngo to x: (x2) y: (y1)\ngo to x: (x1) y: (y1)\npen up\n\nwhen I receive [save v]\nSave Contents\nhide list [save code v]\nask [Copy the codes above before continuing.] and wait\nshow list [save code v]\n\nwhen I receive [load v]\nask [Paste the platform codes here: \(Leave empty to cancel.\)] and wait\nif <(answer) = []> then\nelse\n    delete (all) of [*platforms v]\n    delete (all) of [*moves v]\n    delete (all) of [*move indices v]\n    Load Platform Codes (answer)\n    ask [Paste the move codes here:] and wait\n    Load Move Codes (answer)\nend\n\ndefine Normalize Vector\nset [dx v] to ((dx) / (dist))\nset [dy v] to ((dy) / (dist))\n\ndefine None\nset [angle v] to (([atan v] of ((dy) / (dx)) ) + ((180) * <(dx) < [0]>))\n\ndefine Render Moves\nif <<(*mPlatSelect) > [-1]> and <(guiType) = [1]>> then\n    set [*moveindex v] to (item (item ((*mPlatSelect) + (8)) of [*platforms v]) of [*move indices v])\n    set [storeangle v] to (item ((*mPlatSelect) + (10)) of [*platforms v])\n    set [storemovex v] to (item ((*mPlatSelect) + (11)) of [*platforms v])\n    set [storemovey v] to (item ((*mPlatSelect) + (12)) of [*platforms v])\n    repeat (item (*moveIndex) of [*moves v])\n        Get Vector from (storeMoveX) (storeMoveY) to (item ((*moveIndex) + (1)) of [*moves v]) (item ((*moveIndex) + (2)) of [*moves v])\n        if <(*moveIndex) = (*selectedMove)> then\n            set pen color to (join [0x] [80f0ff])\n        else\n            set pen color to (join [0x] [00d0ff])\n        end\n        set [anglenotzero v] to (<([abs v] of (item ((*moveIndex) + (8)) of [*moves v]) ) > [0]> + (0))\n        if <<(dist) > [0]> or <(angleNotZero) = [1]>> then\n            if <(dist) > [0]> then\n                Get Angle (dx) (dy)\n                System -> Draw Coords (storeMoveX) (storeMoveY)\n                set [tempx v] to (dCoordX)\n                set [tempy v] to (dCoordY)\n                System -> Draw Coords (item ((*moveIndex) + (1)) of [*moves v]) (item ((*moveIndex) + (2)) of [*moves v])\n                Clipped Line from (tempX) (tempY) to (dCoordX) (dCoordY) Radius ((#platRadius) / ((6) * (dZoom)))\n                set [tempx v] to (dCoordX)\n                set [tempy v] to (dCoordY)\n                System -> Draw Coords ((item ((*moveIndex) + (1)) of [*moves v]) + (((120) / (dZoom)) * ([cos v] of ((angle) + (135)) ))) ((item ((*moveIndex) + (2)) of [*moves v]) + (((120) / (dZoom)) * ([sin v] of ((angle) + (135)) )))\n                Clipped Line from (tempX) (tempY) to (dCoordX) (dCoordY) Radius ((#platRadius) / ((6) * (dZoom)))\n                System -> Draw Coords ((item ((*moveIndex) + (1)) of [*moves v]) + (((120) / (dZoom)) * ([cos v] of ((angle) - (135)) ))) ((item ((*moveIndex) + (2)) of [*moves v]) + (((120) / (dZoom)) * ([sin v] of ((angle) - (135)) )))\n                Clipped Line from (tempX) (tempY) to (dCoordX) (dCoordY) Radius ((#platRadius) / ((6) * (dZoom)))\n                if <(angleNotZero) = [1]> then\n                    set [storemovex v] to (((storeMoveX) + (item ((*moveIndex) + (1)) of [*moves v])) / (2))\n                    set [storemovey v] to (((storeMoveY) + (item ((*moveIndex) + (2)) of [*moves v])) / (2))\n                else\n                    set [storemovex v] to (item ((*moveIndex) + (1)) of [*moves v])\n                    set [storemovey v] to (item ((*moveIndex) + (2)) of [*moves v])\n                end\n            end\n            if <(angleNotZero) = [1]> then\n                System -> Draw Coords ((storeMoveX) + (((240) / (dZoom)) * ([cos v] of (storeAngle) ))) ((storeMoveY) + (((240) / (dZoom)) * ([sin v] of (storeAngle) )))\n                set [tempx v] to (dCoordX)\n                set [tempy v] to (dCoordY)\n                set [anglenotzero v] to (item ((*moveIndex) + (8)) of [*moves v])\n                set [angle v] to (storeAngle)\n                set [angleinc v] to ([floor v] of (([log v] of ([abs v] of (angleNotZero) ) ) / (0.3)) )\n                repeat (angleInc)\n                    change [angle v] by ((angleNotZero) / (angleInc))\n                    System -> Draw Coords ((storeMoveX) + (((240) / (dZoom)) * ([cos v] of (angle) ))) ((storeMoveY) + (((240) / (dZoom)) * ([sin v] of (angle) )))\n                    Clipped Line from (tempX) (tempY) to (dCoordX) (dCoordY) Radius ((#platRadius) / ((6) * (dZoom)))\n                    set [tempx v] to (dCoordX)\n                    set [tempy v] to (dCoordY)\n                end\n                set [storemovex v] to (item ((*moveIndex) + (1)) of [*moves v])\n                set [storemovey v] to (item ((*moveIndex) + (2)) of [*moves v])\n                change [storeangle v] by (angleNotZero)\n            end\n        end\n        change [*moveindex v] by (length of [\(move\) v])\n    end\nend\n\ndefine Settings GUI\nset pen color to (join [0x] [60a0e0])\nDraw Line (guiX) (180) (guiX) (-180) Size (180)\nset pen color to (join [0x] [0])\nDraw String [Initial Values] at ((guiX) - (80)) (165) Align [L] FitW (0) FitH (20) PenSize (2) Space (0.5) KernJ \nDraw String (join (join [Center: ] (item ((*mPlatSelect) + (11)) of [*platforms v])) (join [, ] (item ((*mPlatSelect) + (12)) of [*platforms v]))) at ((guiX) - (80)) (140) Align [L] FitW (0) FitH (15) PenSize (1) Space (0.5) KernJ \nDraw String (join [Length 1: ] (item ((*mPlatSelect) + (3)) of [*platforms v])) at ((guiX) - (80)) (120) Align [L] FitW (0) FitH (15) PenSize (1) Space (0.5) KernJ \nDraw String (join [Length 2: ] (item ((*mPlatSelect) + (4)) of [*platforms v])) at ((guiX) - (80)) (100) Align [L] FitW (0) FitH (15) PenSize (1) Space (0.5) KernJ \nDraw String (join [Type: ] (item ((*mPlatSelect) + (5)) of [*platforms v])) at ((guiX) - (80)) (80) Align [L] FitW (0) FitH (15) PenSize (1) Space (0.5) KernJ \nDraw String (join [Angle: ] (item ((*mPlatSelect) + (10)) of [*platforms v])) at ((guiX) - (80)) (60) Align [L] FitW (0) FitH (15) PenSize (1) Space (0.5) KernJ \nGet Vector from (guiX) (140) to (mouse x) (mouse y)\nset [editattribute v] to [-1]\nset [liney v] to (round ((dy) / (-20)))\nif <<<[-1] < (lineY)> and <(lineY) < [5]>> and <(dx) > [-90]>> then\n    if <(mouseClicked) = [1]> then\n        set [editattribute v] to (lineY)\n    end\n    set pen color to (join [0x] [8000d0ff])\n    set [liney v] to ((140) - ((20) * (lineY)))\n    Draw Line ((guiX) - (80)) (lineY) ((guiX) + (80)) (lineY) Size (20)\nend\n\ndefine Moves GUI\nset pen color to (join [0x] [60a0e0])\nDraw Line (guiX) (180) (guiX) (-180) Size (180)\nset [*moveindex v] to (item (item ((*mPlatSelect) + (8)) of [*platforms v]) of [*move indices v])\nset [*platindex v] to ((110) + ((scrollY) * (((item (*moveIndex) of [*moves v]) * (80)) / (285))))\nset [editattribute v] to [-1]\nrepeat (item (*moveIndex) of [*moves v])\n    if <<(mouseClicked) = [1]> and <(*platIndex) < [111]>> then\n        Get Vector from (guiX) ((*platIndex) - (35)) to (mouse x) (mouse y)\n        if <<(*moveIndex) = (*selectedMove)> and <<[-80] < (dx)> and <(dx) < [70]>>> then\n            set [editattribute v] to (round (((dy) - (20)) / (-20)))\n        else\n            if <<([abs v] of (dx) ) < [80]> and <([abs v] of (dy) ) < [35]>> then\n                set [*selectedmove v] to (*moveIndex)\n            end\n        end\n    end\n    if <(*moveIndex) = (*selectedMove)> then\n        set pen color to (join [0x] [80f0ff])\n    else\n        set pen color to (join [0x] [00d0ff])\n    end\n    Draw Rect ((guiX) - (80)) (*platIndex) ((guiX) + (80)) ((*platIndex) - (70)) Size (8)\n    set pen color to (join [0x] [0])\n    Draw String (join (join [Move to: ] (item ((*moveIndex) + (1)) of [*moves v])) (join [, ] (item ((*moveIndex) + (2)) of [*moves v]))) at ((guiX) - (70)) ((*platIndex) - (15)) Align [L] FitW (0) FitH (12) PenSize (1) Space (0.5) KernJ \n    Draw String (join [Rotate by: ] (item ((*moveIndex) + (8)) of [*moves v])) at ((guiX) - (70)) ((*platIndex) - (35)) Align [L] FitW (0) FitH (12) PenSize (1) Space (0.5) KernJ \n    Draw String (join [For: ] (join (item ((*moveIndex) + (6)) of [*moves v]) [ frames])) at ((guiX) - (70)) ((*platIndex) - (55)) Align [L] FitW (0) FitH (12) PenSize (1) Space (0.5) KernJ \n    if <(*moveIndex) = (*selectedMove)> then\n        set pen color to (join [0x] [8000d0ff])\n        Get Vector from (guiX) ((*platIndex) - (15)) to (mouse x) (mouse y)\n        set [liney v] to (round ((dy) / (20)))\n        if <<<[-3] < (lineY)> and <(lineY) < [1]>> and <(dx) > [-90]>> then\n            set [liney v] to (((*platIndex) - (15)) + ((20) * (lineY)))\n            Draw Line ((guiX) - (69)) (lineY) ((guiX) + (69)) (lineY) Size (15)\n        end\n    end\n    change [*platindex v] by (-80)\n    change [*moveindex v] by (length of [\(move\) v])\nend\nMoves GUI 2\n\nwhen I receive [setting attribute v]\nif <(editAttribute) = [0]> then\n    ask [Center X:] and wait\n    replace item ((*mPlatSelect) + (11)) of [*platforms v] with (round (answer))\n    replace item ((*mPlatSelect) + (1)) of [*platforms v] with (round (answer))\n    ask [Center Y:] and wait\n    replace item ((*mPlatSelect) + (12)) of [*platforms v] with (round (answer))\n    replace item ((*mPlatSelect) + (2)) of [*platforms v] with (round (answer))\nelse\n    if <(editAttribute) = [1]> then\n        ask [Length 1:] and wait\n        replace item ((*mPlatSelect) + (3)) of [*platforms v] with (round (answer))\n    else\n        if <(editAttribute) = [2]> then\n            ask [Length 2:] and wait\n            replace item ((*mPlatSelect) + (4)) of [*platforms v] with (round (answer))\n        else\n            if <(editAttribute) = [3]> then\n                ask [Type:] and wait\n                replace item ((*mPlatSelect) + (5)) of [*platforms v] with (round (answer))\n            else\n                if <(editAttribute) = [4]> then\n                    ask [Angle:] and wait\n                    replace item ((*mPlatSelect) + (7)) of [*platforms v] with (round (answer))\n                    replace item ((*mPlatSelect) + (10)) of [*platforms v] with (round (answer))\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [new move v]\nask [Index? \(Use negative numbers to start from the end of the list.\)] and wait\nAdd Move for Platform (*mPlatSelect) | Move to (0) (0) | Rotate by (0) in (1) ticks at Index (answer)\n\ndefine Moves GUI 2\nset pen color to (join [0x] [60a0e0])\nDraw Rect ((guiX) - (80)) (129) (270) (180) Size (20)\nDraw Line ((guiX) - (72)) (155) (270) (155) Size (32)\nset pen color to (join [0x] [0])\nDraw String [Moves:] at ((guiX) - (85)) (135) Align [L] FitW (0) FitH (20) PenSize (2) Space (0.5) KernJ \nDraw Rect ((guiX) - (25)) (155) ((guiX) - (8)) (172) Size (2)\nif <(mouseClicked) = [1]> then\n    go to x: ((guiX) - (17)) y: (163)\n    if <(distance to [mouse-pointer v]) < [9]> then\n        replace item ((*mPlatSelect) + (13)) of [*platforms v] with ((1) - (item ((*mPlatSelect) + (13)) of [*platforms v]))\n        if <(item ((*mPlatSelect) + (9)) of [*platforms v]) = [-1]> then\n            replace item ((*mPlatSelect) + (9)) of [*platforms v] with [0]\n        end\n    end\nend\nif <(item ((*mPlatSelect) + (13)) of [*platforms v]) = [1]> then\n    Draw Line ((guiX) - (25)) (155) ((guiX) - (8)) (172) Size (2)\n    Draw Line ((guiX) - (25)) (172) ((guiX) - (8)) (155) Size (2)\nend\nDraw String [Loop?] at ((guiX) - (85)) (165) Align [L] FitW (0) FitH (15) PenSize (2) Space (0.5) KernJ \nset pen color to (join [0x] [00d0ff])\nDraw Line ((guiX) - (83)) (120) ((guiX) + (83)) (120) Size (2)\nset pen color to (join [0x] [00d0ff])\nDraw Line ((guiX) + (85)) (110) ((guiX) + (85)) (-175) Size (8)\nset pen color to (join [0x] [d0404040])\nset [*moveindex v] to (item (item ((*mPlatSelect) + (8)) of [*platforms v]) of [*move indices v])\nset [barlength v] to ((285) * ((285) / ((item (*moveIndex) of [*moves v]) * (80))))\nif <(barLength) > [285]> then\n    set [barlength v] to [285]\nend\nDraw Line ((guiX) + (85)) ((110) - (scrollY)) ((guiX) + (85)) ((110) - ((scrollY) + (barLength))) Size (8)\nif <<(mouse x) > ((guiX) + (80))> and <(mouseClicked) = [1]>> then\n    set [draggingbar v] to [1]\nend\nif <<mouse down?> and <(draggingBar) = [1]>> then\n    set [scrolly v] to ((110) - ((mouse y) + ((barLength) / (2))))\n    set [dmousedrag v] to [0]\nelse\n    set [draggingbar v] to [0]\nend\nif <((110) - ((scrollY) + (barLength))) < [-175]> then\n    set [scrolly v] to ((285) - (barLength))\nelse\n    if <(scrollY) < [0]> then\n        set [scrolly v] to [0]\n    end\nend\ngo to x: ((guiX) + (45)) y: (135)\nset [addmove v] to [0]\nif <(distance to [mouse-pointer v]) < [6]> then\n    set pen color to (join [0x] [00d0ff])\n    set [addmove v] to (mouseClicked)\nelse\n    set pen color to (join [0x] [0])\nend\nDraw String [+] at ((guiX) + (40)) (135) Align [L] FitW (0) FitH (40) PenSize (3) Space (0) KernJ \ngo to x: ((guiX) + (71)) y: (135)\nif <(distance to [mouse-pointer v]) < [6]> then\n    set pen color to (join [0x] [00d0ff])\n    if <<(mouseClicked) = [1]> and <(*selectedMove) > [-1]>> then\n        Remove Move (*selectedMove) of Platform (*mPlatSelect)\n    end\nelse\n    set pen color to (join [0x] [0])\nend\nDraw String [-] at ((guiX) + (65)) (135) Align [L] FitW (0) FitH (42) PenSize (3) Space (0) KernJ \n\nwhen I receive [move attribute v]\nreplace item ((*selectedMove) + (7)) of [*moves v] with [0]\nif <(editAttribute) = [0]> then\n    ask [Move to: \(X coordinate?\)] and wait\n    replace item ((*selectedMove) + (1)) of [*moves v] with (round (answer))\n    ask [Move to: \(Y coordinate?\)] and wait\n    replace item ((*selectedMove) + (2)) of [*moves v] with (round (answer))\nelse\n    if <(editAttribute) = [1]> then\n        ask [Rotate by: \(Number of degrees from -360 to 360\)] and wait\n        replace item ((*selectedMove) + (8)) of [*moves v] with (round (answer))\n    else\n        if <(editAttribute) = [2]> then\n            ask [For: \(Number of frames for move/rotate\)] and wait\n            replace item ((*selectedMove) + (6)) of [*moves v] with (round (answer))\n        end\n    end\nend\n\ndefine Mouse - Platform Interaction\nif <<key (m v) pressed?> or <key (p v) pressed?>> then\n    Draw -> System Coords (mouse x) (mouse y)\n    set [mx v] to (dCoordX)\n    set [my v] to (dCoordY)\n    set [manycoll v] to [0]\n    set [*platindex v] to [0]\n    repeat ((length of [*platforms v]) / (length of [\(platform\) v]))\n        Check Collision (mX) (mY) (0) with Platform (*platIndex) <[1] = [1]> ([cos v] of (item ((*platIndex) + (7)) of [*platforms v]) ) ([sin v] of (item ((*platIndex) + (7)) of [*platforms v]) )\n        if <<(collSuccess) = [1]> and <(mouseClicked) = [1]>> then\n            set [*mplatselect v] to (*platIndex)\n            change [banyhover v] by (1)\n            change [manycoll v] by (1)\n            set [guitargetx v] to ((240) - (90))\n        end\n        change [*platindex v] by (length of [\(platform\) v])\n    end\n    if <(mouseClicked) = [1]> then\n        if <(mAnyColl) = [0]> then\n            set [*mplatselect v] to [-1]\n            set [guitargetx v] to ((240) + (90))\n        else\n            if <key (m v) pressed?> then\n                set [guitype v] to [1]\n            else\n                set [guitype v] to [2]\n            end\n        end\n    end\nend\nif <(*mPlatSelect) > [-1]> then\n    set pen color to (join [0x] [ffff00])\n    Draw Platform (*mPlatSelect) + Radius ((#platRadius) / (2)) <(moveT) > [-1]>\nend\nset [guix v] to (((0.75) * (guiX)) + ((0.25) * (guiTargetX)))\n\ndefine Zoom Buttons\nDraw Dot (-220) (160) Color (join [0x] [606060]) Size (32)\nDraw Dot (-220) (160) Color (join [0x] [c0c0c0]) Size (30)\nset pen color to (join [0x] [707070])\nDraw Line (-229) (160) (-211) (160) Size (2)\nDraw Line (-220) (169) (-220) (151) Size (2)\nDetect Button (-220) (160) Size (32) Highlight (join [0x] [40000000])\nif <(bClicked) = [1]> then\n    change [dtargetzoom v] by ((dTargetZoom) / (-3))\nend\nDraw Dot (-180) (160) Color (join [0x] [606060]) Size (32)\nDraw Dot (-180) (160) Color (join [0x] [c0c0c0]) Size (30)\nset pen color to (join [0x] [707070])\nDraw Line (-189) (160) (-171) (160) Size (2)\nDetect Button (-180) (160) Size (32) Highlight (join [0x] [40000000])\nif <(bClicked) = [1]> then\n    change [dtargetzoom v] by ((dTargetZoom) / (3))\nend\nif <(dTargetZoom) < [3]> then\n    set [dtargetzoom v] to [3]\nend\nif <(dTargetZoom) > [15]> then\n    set [dtargetzoom v] to [15]\nend\nset [dzoom v] to (((0.75) * (dZoom)) + ((0.25) * (dTargetZoom)))\n\ndefine Mode Button\nDetect Button (-220) (-160) Size (32) Highlight (join [0x] [01000000])\nif <(bHover) = [1]> then\n    change [bmodeomega v] by (0.4)\n    if <(bModeOmega) > [20]> then\n        set [bmodeomega v] to [20]\n    end\nelse\n    change [bmodeomega v] by (-0.8)\n    if <(bModeOmega) < [0]> then\n        set [bmodeomega v] to [0]\n    end\nend\nchange [bmodetheta v] by (bModeOmega)\nDraw Dot (-220) (-160) Color (join [0x] [606060]) Size (32)\nDraw Dot (-220) (-160) Color (join [0x] [c0c0c0]) Size (30)\nset pen color to (join [0x] [606060])\nset [baddtheta v] to [0]\nrepeat (4)\n    set [dx v] to ((10) * ([cos v] of ((bModeTheta) + (bAddTheta)) ))\n    set [dy v] to ((10) * ([sin v] of ((bModeTheta) + (bAddTheta)) ))\n    Draw Line ((-220) - (dx)) ((-160) - (dy)) ((-220) + (dx)) ((-160) + (dy)) Size (4)\n    change [baddtheta v] by ((180) / (4))\nend\nDraw Dot (-220) (-160) Color (join [0x] [606060]) Size (18)\nDraw Dot (-220) (-160) Color (join [0x] [c0c0c0]) Size (8)\nif <(bClicked) = [1]> then\n    set [*mode v] to ((1) - (*mode))\n    set [dholdx v] to ((dZoom) * (mouse x))\n    set [dholdy v] to ((dZoom) * (mouse y))\n    if <(*mode) = [1]> then\n        set [dtargetzoom v] to [5]\n        Reset GUI\n    end\nend\n\ndefine None\nif <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n    change [prot v] by ((-0.75) * (speed))\n    if <(pPIndex) > [-1]> then\n        change [px v] by ((speed) * (pNy))\n        change [py v] by (((0) - (speed)) * (pNx))\n        set [pxv v] to ((speed) * (pNy))\n        set [pyv v] to (((0) - (speed)) * (pNx))\n    end\nelse\n    if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n        change [prot v] by ((0.75) * (speed))\n        if <(pPIndex) > [-1]> then\n            change [px v] by (((0) - (speed)) * (pNy))\n            change [py v] by ((speed) * (pNx))\n            set [pxv v] to (((0) - (speed)) * (pNy))\n            set [pyv v] to ((speed) * (pNx))\n        end\n    end\nend\nif <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n    if <<(pCharge) < [30]> and <(pPIndex) > [-1]>> then\n        change [pcharge v] by (1)\n        set [dzoom v] to ((dTargetZoom) - (((dTargetZoom) - (0.5)) * ((pCharge) / (30))))\n    end\nelse\n    if <(pCharge) > [0]> then\n        change [pxv v] by ((pCharge) * (pNx))\n        change [pyv v] by ((pCharge) * (pNy))\n        set [*moveindex v] to (item (item ((pPIndex) + (8)) of [*platforms v]) of [*move indices v])\n        if <(item (*moveIndex) of [*moves v]) > [0]> then\n            change [*moveindex v] by ((item ((pPIndex) + (9)) of [*platforms v]) * (length of [\(move\) v]))\n            set [pcharge v] to ((item ((*moveIndex) + (5)) of [*moves v]) * ([abs v] of ((pCollT) / ((2) * (#platRadius))) ))\n            change [pxv v] by ((item ((*moveIndex) + (3)) of [*moves v]) - ((pCharge) * ([sin v] of (item ((pPIndex) + (7)) of [*platforms v]) )))\n            change [pyv v] by ((item ((*moveIndex) + (4)) of [*moves v]) + ((pCharge) * ([cos v] of (item ((pPIndex) + (7)) of [*platforms v]) )))\n        end\n        set [pcharge v] to [0]\n        set [ppindex v] to [-1]\n    end\n    set [dzoom v] to (((0.75) * (dZoom)) + ((0.25) * (dTargetZoom)))\nend\nif <(pPIndex) > [-1]> then\n    set [pxv v] to ((-2) * (pNx))\n    set [pyv v] to ((-2) * (pNy))\n    set [pairtime v] to [0]\nelse\n    change [pyv v] by (-1)\n    change [pairtime v] by (1)\nend\nchange [px v] by (pXV)\nchange [py v] by (pYV)\nif <(pAirtime) > [90]> then\n    Reset Player \nend\nset [*platindex v] to [0]\nrepeat ((length of [*platforms v]) / (length of [\(platform\) v]))\n    Check Collision (pX) (pY) (#platRadius) with Platform (*platIndex)  ([cos v] of (item ((*platIndex) + (7)) of [*platforms v]) ) ([sin v] of (item ((*platIndex) + (7)) of [*platforms v]) )\n    change [*platindex v] by (length of [\(platform\) v])\nend\nset [prot v] to ((pRot) mod (360))\n\ndefine None\nif <resetting> then\n    set [doffsetx v] to (((1) - (moveRate)) * (pX))\n    set [doffsety v] to (((1) - (moveRate)) * (pY))\n    System -> Draw Coords (dOffsetX) (dOffsetY)\nelse\n    System -> Draw Coords (pX) (pY)\nend\nif <blueprints> then\n    set pen color to (join [0x] [e0f0f0])\nelse\n    set pen color to (join [0x] [0])\nend\ngo to x: (dCoordX) y: ((dCoordY) + (0.001))\nset pen size to ((2) * (zoomradius))\npen down\npen up\nset [dtheta v] to (pRot)\nset [pspinenum v] to [0]\nrepeat (numspines)\n    if <((pSpineNum) mod (2)) = [0]> then\n        set [pspinelength v] to ((zoomradius) * (length1))\n    else\n        set [pspinelength v] to ((zoomradius) * (length2))\n    end\n    go to x: ((dCoordX) - ((pSpineLength) * ([cos v] of (dTheta) ))) y: ((dCoordY) - ((pSpineLength) * ([sin v] of (dTheta) )))\n    set pen size to (1)\n    pen down\n    set pen size to ((0.125) * (zoomradius))\n    go to x: ((dCoordX) + ((pSpineLength) * ([cos v] of (dTheta) ))) y: ((dCoordY) + ((pSpineLength) * ([sin v] of (dTheta) )))\n    pen up\n    change [pspinenum v] by (1)\n    change [dtheta v] by ((180) / (numspines))\nend\ngo to x: (dCoordX) y: ((dCoordY) + (0.001))\nif <blueprints> then\n    set pen color to (join [0x] [4070E0])\nelse\n    set pen color to (join [0x] [00d000])\nend\nset pen size to ((1.75) * (zoomradius))\npen down\npen up\n\ndefine Reset Player <>\nif <firsttime> then\n    set [px v] to [0]\n    set [py v] to [0]\n    set [pxv v] to [0]\n    set [pyv v] to [0]\n    set [ppindex v] to [-1]\n    set [pcharge v] to [0]\n    set [prot v] to [0]\n    set [pnx v] to [0]\n    set [pny v] to [0]\n    set [pairtime v] to [0]\n    set [levelfinished v] to [0]\nelse\n    set [movet v] to [0]\nend\n\ndefine None\nif <(item ((m) + (7)) of [*moves v]) = [0]> then\n    Get Vector from (item ((p) + (1)) of [*platforms v]) (item ((p) + (2)) of [*platforms v]) to (item ((m) + (1)) of [*moves v]) (item ((m) + (2)) of [*moves v])\n    replace item ((m) + (3)) of [*moves v] with ((dx) / (item ((m) + (6)) of [*moves v]))\n    replace item ((m) + (4)) of [*moves v] with ((dy) / (item ((m) + (6)) of [*moves v]))\n    replace item ((m) + (5)) of [*moves v] with ((item ((m) + (8)) of [*moves v]) / (item ((m) + (6)) of [*moves v]))\nend\nreplace item ((p) + (1)) of [*platforms v] with ((item ((p) + (1)) of [*platforms v]) + (item ((m) + (3)) of [*moves v]))\nreplace item ((p) + (2)) of [*platforms v] with ((item ((p) + (2)) of [*platforms v]) + (item ((m) + (4)) of [*moves v]))\nreplace item ((p) + (7)) of [*platforms v] with (((item ((p) + (7)) of [*platforms v]) + (item ((m) + (5)) of [*moves v])) mod (360))\nreplace item ((m) + (7)) of [*moves v] with ((item ((m) + (7)) of [*moves v]) + (1))\nif <(pPIndex) = (p)> then\n    Rotate Vector (pNx) (pNy) by (item ((m) + (5)) of [*moves v])\n    set [px v] to ((item ((p) + (1)) of [*platforms v]) + ((([cos v] of (item ((p) + (7)) of [*platforms v]) ) * (pCollT)) + ((dx) * ((2) * (#platRadius)))))\n    set [py v] to ((item ((p) + (2)) of [*platforms v]) + ((([sin v] of (item ((p) + (7)) of [*platforms v]) ) * (pCollT)) + ((dy) * ((2) * (#platRadius)))))\n    change [prot v] by (item ((m) + (5)) of [*moves v])\nend\nif <(item ((m) + (7)) of [*moves v]) = (item ((m) + (6)) of [*moves v])> then\n    replace item ((m) + (7)) of [*moves v] with [0]\n    replace item ((p) + (9)) of [*platforms v] with (((item ((p) + (9)) of [*platforms v]) + (1)) mod (n))\n    if <((item ((p) + (9)) of [*platforms v]) + (item ((p) + (13)) of [*platforms v])) = [0]> then\n        replace item ((p) + (9)) of [*platforms v] with [-1]\n    end\nend\n\ndefine None\nif <resetting> then\n    set [storemovex v] to ((((1) - (moveRate)) * (item ((p) + (1)) of [*platforms v])) + ((moveRate) * (item ((p) + (11)) of [*platforms v])))\n    set [storemovey v] to ((((1) - (moveRate)) * (item ((p) + (2)) of [*platforms v])) + ((moveRate) * (item ((p) + (12)) of [*platforms v])))\n    set [storeangle v] to ((((1) - (moveRate)) * (item ((p) + (7)) of [*platforms v])) + ((moveRate) * (item ((p) + (10)) of [*platforms v])))\n    System -> Draw Coords ((storeMoveX) - ((item ((p) + (3)) of [*platforms v]) * ([cos v] of (storeAngle) ))) ((storeMoveY) - ((item ((p) + (3)) of [*platforms v]) * ([sin v] of (storeAngle) )))\n    set [tempx v] to (dCoordX)\n    set [tempy v] to (dCoordY)\n    System -> Draw Coords ((storeMoveX) + ((item ((p) + (4)) of [*platforms v]) * ([cos v] of (storeAngle) ))) ((storeMoveY) + ((item ((p) + (4)) of [*platforms v]) * ([sin v] of (storeAngle) )))\n    Clipped Line from (tempX) (tempY) to (dCoordX) (dCoordY) Radius (((#platRadius) + (r)) / (dZoom))\nelse\n    System -> Draw Coords ((item ((p) + (1)) of [*platforms v]) - ((item ((p) + (3)) of [*platforms v]) * ([cos v] of (item ((p) + (7)) of [*platforms v]) ))) ((item ((p) + (2)) of [*platforms v]) - ((item ((p) + (3)) of [*platforms v]) * ([sin v] of (item ((p) + (7)) of [*platforms v]) )))\n    set [tempx v] to (dCoordX)\n    set [tempy v] to (dCoordY)\n    System -> Draw Coords ((item ((p) + (1)) of [*platforms v]) + ((item ((p) + (4)) of [*platforms v]) * ([cos v] of (item ((p) + (7)) of [*platforms v]) ))) ((item ((p) + (2)) of [*platforms v]) + ((item ((p) + (4)) of [*platforms v]) * ([sin v] of (item ((p) + (7)) of [*platforms v]) )))\n    Clipped Line from (tempX) (tempY) to (dCoordX) (dCoordY) Radius (((#platRadius) + (r)) / (dZoom))\nend\n\ndefine Misc. Buttons\nDraw Dot (-180) (-160) Color (join [0x] [606060]) Size (32)\nDraw Dot (-180) (-160) Color (join [0x] [c0c0c0]) Size (30)\nDetect Button (-180) (-160) Size (32) Highlight (join [0x] [40000000])\nset pen color to (join [0x] [707070])\nDraw String [New] at (-180) (-160) Align [C] FitW (0) FitH (12) PenSize (1) Space (0.3) KernJ \nif <(bClicked) = [1]> then\n    Draw -> System Coords (0) (0)\n    Add Platform at (round (dCoordX)) (round (dCoordY)) Angle (0) Length (100) Type (1) \%center (0.5)\nend\nDraw Dot (-140) (-160) Color (join [0x] [606060]) Size (32)\nDraw Dot (-140) (-160) Color (join [0x] [c0c0c0]) Size (30)\nDetect Button (-140) (-160) Size (32) Highlight (join [0x] [40000000])\nset pen color to (join [0x] [707070])\nDraw String [Del] at (-140) (-160) Align [C] FitW (0) FitH (12) PenSize (1) Space (0.3) KernJ \nif <(bClicked) = [1]> then\n    if <(*mPlatSelect) > [-1]> then\n        Remove Platform (*mPlatSelect)\n        Reset GUI\n    end\nend\nDraw Dot (-100) (-160) Color (join [0x] [606060]) Size (32)\nDraw Dot (-100) (-160) Color (join [0x] [c0c0c0]) Size (30)\nDetect Button (-100) (-160) Size (32) Highlight (join [0x] [40000000])\nset pen color to (join [0x] [707070])\nDraw String [Reset] at (-100) (-160) Align [C] FitW (0) FitH (9) PenSize (1) Space (0.3) KernJ \nif <(bClicked) = [1]> then\n    Reset Player \nend\nDraw Dot (20) (-160) Color (join [0x] [606060]) Size (32)\nDraw Dot (20) (-160) Color (join [0x] [c0c0c0]) Size (30)\nDetect Button (20) (-160) Size (32) Highlight (join [0x] [40000000])\nset pen color to (join [0x] [707070])\nDraw String [Clear] at (20) (-160) Align [C] FitW (0) FitH (9) PenSize (1) Space (0.4) KernJ \nif <(bClicked) = [1]> then\n    delete (all) of [*moves v]\n    delete (all) of [*platforms v]\n    delete (all) of [*move indices v]\nend\n\ndefine None\nrepeat (length of [\(platform\) v])\n    delete ((n) + (1)) of [*platforms v]\nend\n\nwhen flag clicked\nset [#platradius v] to [40]\nset [#pspines v] to [8]\nset [#pspeed v] to [7]\nshow list [save code v]\ndelete (all) of [save code v]\ndelete (all) of [*platforms v]\ndelete (all) of [*moves v]\ndelete (all) of [*move indices v]\ndelete (all) of [*cactus pos v]\nrepeat (15)\n    add (pick random (-230) to (230)) to [*cactus pos v]\n    add (pick random (-175) to (-30)) to [*cactus pos v]\n    add (pick random (5) to (20)) to [*cactus pos v]\nend\nset [*level v] to [2]\nLoad Level (*level)\nset [doffsetx v] to [0]\nset [doffsety v] to [0]\nset [dzoom v] to [5]\nset [dtargetzoom v] to [5]\nset [*mode v] to [1]\nReset GUI\nReset Player <[] = []>\nset [movet v] to [-1]\nforever\n    set [banyhover v] to [0]\n    Mouse Clicked?\n    if <(*mode) = [1]> then\n        erase all\n        Background \n        if <(moveT) < [0]> then\n            Update Platforms\n            Update Player (#pSpeed)\n            set [doffsetx v] to (pX)\n            set [doffsety v] to (pY)\n            Render  \n            Mode Button\n            if <key (r v) pressed?> then\n                Reset Player \n            end\n            if <(levelFinished) = [1]> then\n                change [*level v] by (1)\n                Load Level (*level)\n                Reset Player <[] = []>\n            end\n        else\n            Render  <[1] = [1]>\n        end\n        set pen color to (join [0x] [0])\n        Draw String [Arrow/WASD keys, down to charge, r to reset] at (240) (-170) Align [R] FitW (0) FitH (10) PenSize (1) Space (0.5) KernJ \n    else\n        erase all\n        Background <[1] = [1]>\n        Render <[1] = [1]> <(moveT) > [-1]>\n        Render Moves\n        if <(guiX) < ((240) + (90))> then\n            if <(guiType) = [1]> then\n                Moves GUI\n                if <<(*mPlatSelect) > [-1]> and <<[-1] < (editAttribute)> and <(editAttribute) < [3]>>> then\n                    broadcast (Move Attribute v) and wait\n                else\n                    if <(addMove) = [1]> then\n                        broadcast (New Move v) and wait\n                    end\n                end\n            else\n                Settings GUI\n                if <<(*mPlatSelect) > [-1]> and <<[-1] < (editAttribute)> and <(editAttribute) < [5]>>> then\n                    broadcast (Setting Attribute v) and wait\n                end\n            end\n        end\n        Zoom Buttons\n        Misc. Buttons\n        Save/Load Buttons\n        if <(saveState) > [0]> then\n            if <(saveState) = [1]> then\n                broadcast (Save v) and wait\n            else\n                broadcast (Load v) and wait\n            end\n        end\n        Mode Button\n        Mouse Drag\n        set pen color to (join [0x] [e0f0f0])\n        Draw String [Mouse to scroll, click with m/p to select.] at (240) (-170) Align [R] FitW (0) FitH (10) PenSize (1) Space (0.6) KernJ \n    end\nend\n\ndefine Save/Load Buttons\nset [savestate v] to [0]\nDraw Dot (-60) (-160) Color (join [0x] [606060]) Size (32)\nDraw Dot (-60) (-160) Color (join [0x] [c0c0c0]) Size (30)\nDetect Button (-60) (-160) Size (32) Highlight (join [0x] [40000000])\nset pen color to (join [0x] [707070])\nDraw String [Save] at (-60) (-160) Align [C] FitW (0) FitH (10) PenSize (1) Space (0.3) KernJ \nif <(bClicked) = [1]> then\n    set [savestate v] to [1]\nend\nDraw Dot (-20) (-160) Color (join [0x] [606060]) Size (32)\nDraw Dot (-20) (-160) Color (join [0x] [c0c0c0]) Size (30)\nDetect Button (-20) (-160) Size (32) Highlight (join [0x] [40000000])\nset pen color to (join [0x] [707070])\nDraw String [Load] at (-20) (-160) Align [C] FitW (0) FitH (10) PenSize (1) Space (0.3) KernJ \nif <(bClicked) = [1]> then\n    set [savestate v] to [2]\nend\n\ndefine None\nset [*moveindex v] to (item (item ((p) + (8)) of [*platforms v]) of [*move indices v])\nreplace item (*moveIndex) of [*moves v] with ((item (*moveIndex) of [*moves v]) - (1))\nrepeat (length of [\(move\) v])\n    delete ((n) + (1)) of [*moves v]\nend\nset [*moveindex v] to ((item ((p) + (8)) of [*platforms v]) + (1))\nrepeat ((length of [*move indices v]) - (item ((p) + (8)) of [*platforms v]))\n    replace item (*moveIndex) of [*move indices v] with ((item (*moveIndex) of [*move indices v]) - (length of [\(move\) v]))\n    change [*moveindex v] by (1)\nend\n\ndefine Update Platforms\nset [*platindex v] to [0]\nrepeat ((length of [*platforms v]) / (length of [\(platform\) v]))\n    set [*moveindex v] to (item (item ((*platIndex) + (8)) of [*platforms v]) of [*move indices v])\n    if <(item ((*platIndex) + (9)) of [*platforms v]) = [-1]> then\n    else\n        if <(item (*moveIndex) of [*moves v]) > [0]> then\n            Update Platform (*platIndex) with Move ((*moveIndex) + ((item ((*platIndex) + (9)) of [*platforms v]) * (length of [\(move\) v]))) (Total Moves (item (*moveIndex) of [*moves v]) )\n        end\n    end\n    change [*platindex v] by (length of [\(platform\) v])\nend\n\ndefine None\nINT Line (x1) (y1) (x2) (y2) ((2) * (r)) | (((y2) - (y1)) / ((x2) - (x1))) ((240) + (r)) ((180) + (r)) ((-240) - (r)) ((-180) - (r))\n\ndefine None\nadd [_] to [save code v]\nset [savecodeindex v] to [1]\nrepeat (length of (item (n) of [save code v]))\n    set [savechar v] to (letter (saveCodeIndex) of (item (n) of [save code v]))\n    if <<(saveChar) = (letter (1) of (item (last) of [save code v]))> and <(saveChar) = [0]>> then\n        if <(item (last) of [save code v]) = [0]> then\n            replace item (last) of [save code v] with [01]\n        end\n        if <(item (last) of [save code v]) = [09]> then\n            add [0] to [save code v]\n        end\n        replace item (last) of [save code v] with (join [0] ((item (last) of [save code v]) + (1)))\n    else\n        add (saveChar) to [save code v]\n    end\n    change [savecodeindex v] by (1)\nend\nreplace item ((n) + (1)) of [save code v] with []\nrepeat ((length of [save code v]) - ((n) + (1)))\n    if <<(letter (1) of (item ((n) + (2)) of [save code v])) = [0]> and <(item ((n) + (2)) of [save code v]) > [0]>> then\n        replace item ((n) + (1)) of [save code v] with (join (item ((n) + (1)) of [save code v]) (join [f] ((item ((n) + (2)) of [save code v]) + (0))))\n    else\n        replace item ((n) + (1)) of [save code v] with (join (item ((n) + (1)) of [save code v]) (item ((n) + (2)) of [save code v]))\n    end\n    delete ((n) + (2)) of [save code v]\nend\n\ndefine None\nset [_convertedcode v] to []\nset [_codetemp v] to ([abs v] of (n) )\nrepeat until <(_codeTemp) = [0]>\n    set [_convertedcode v] to (join (letter (((_codeTemp) mod (length of (base))) + (1)) of (base)) (_convertedCode))\n    set [_codetemp v] to ([floor v] of ((_codeTemp) / (length of (base))) )\nend\nif <(_convertedCode) = []> then\n    set [_convertedcode v] to [0]\nend\nrepeat ((l) - (length of (_convertedCode)))\n    set [_convertedcode v] to (join [0] (_convertedCode))\nend\n\ndefine Convert OtherToDec [] Base Chars []\nset [_convertedcode v] to [0]\nset [_codetemp v] to [0]\nrepeat (length of (n))\n    set [_codechar v] to [1]\n    repeat until <(letter ((length of (n)) - (_codeTemp)) of (n)) = (letter (_codeChar) of (base))>\n        change [_codechar v] by (1)\n    end\n    change [_convertedcode v] by (((_codeChar) - (1)) * ([e ^ v] of (([ln v] of (length of (base)) ) * (_codeTemp)) ))\n    change [_codetemp v] by (1)\nend\n\ndefine None\nGet Vector from (item ((p) + (1)) of [*platforms v]) (item ((p) + (2)) of [*platforms v]) to (x) (y)\nset [colltproj v] to (((dx) * (tx)) + ((dy) * (ty)))\nif <(collTProj) < ((0) - (item ((p) + (3)) of [*platforms v]))> then\n    set [colltproj v] to ((0) - (item ((p) + (3)) of [*platforms v]))\nelse\n    if <(collTProj) > (item ((p) + (4)) of [*platforms v])> then\n        set [colltproj v] to (item ((p) + (4)) of [*platforms v])\n    end\nend\nGet Vector from ((item ((p) + (1)) of [*platforms v]) + ((collTProj) * (tx))) ((item ((p) + (2)) of [*platforms v]) + ((collTProj) * (ty))) to (x) (y)\nset [colldepth v] to (((radius) + (#platRadius)) - (dist))\nif <mouse?> then\n    set [collsuccess v] to (<(collDepth) > [0]> + (0))\nelse\n    if <(collDepth) > [0]> then\n        Normalize Vector\n        if <<(pPIndex) = [-1]> or <<(pPIndex) = (p)> or <(pick random (1) to (2)) = [1]>>> then\n            if <(item ((p) + (5)) of [*platforms v]) = [3]> then\n            else\n                set [pcollt v] to (collTProj)\n                set [ppindex v] to (p)\n                set [pnx v] to (dx)\n                set [pny v] to (dy)\n            end\n        end\n        change [px v] by ((collDepth) * (dx))\n        change [py v] by ((collDepth) * (dy))\n        set [collvelo v] to (((dx) * (pXV)) + ((dy) * (pYV)))\n        set [collvelo v] to ((0) - (collVelo))\n        change [pxv v] by ((collVelo) * (dx))\n        change [pyv v] by ((collVelo) * (dy))\n        if <(item ((p) + (5)) of [*platforms v]) = [2]> then\n            Reset Player \n        else\n            if <(item ((p) + (5)) of [*platforms v]) = [3]> then\n                set [pairtime v] to [0]\n                set [ppindex v] to [-1]\n                set [pnx v] to [0]\n                set [pny v] to [0]\n                set [*moveindex v] to (item (item ((p) + (8)) of [*platforms v]) of [*move indices v])\n                if <(item (*moveIndex) of [*moves v]) > [0]> then\n                    change [*moveindex v] by ((item ((p) + (9)) of [*platforms v]) * (length of [\(move\) v]))\n                    set [launchvelo v] to ((item ((*moveIndex) + (5)) of [*moves v]) * ([abs v] of ((collTProj) / ((2) * (#platRadius))) ))\n                    set [storemovex v] to ((item ((*moveIndex) + (3)) of [*moves v]) - ((launchVelo) * ([sin v] of (item ((p) + (7)) of [*platforms v]) )))\n                    set [storemovey v] to ((item ((*moveIndex) + (4)) of [*moves v]) + ((launchVelo) * ([cos v] of (item ((p) + (7)) of [*platforms v]) )))\n                    if <(((storeMoveX) * (dx)) + ((storeMoveY) * (dy))) > [0]> then\n                        change [pxv v] by ((1.5) * (storeMoveX))\n                        change [pyv v] by ((1.5) * (storeMoveY))\n                    end\n                end\n            else\n                if <(item ((p) + (5)) of [*platforms v]) = [4]> then\n                    set [levelfinished v] to [1]\n                end\n            end\n        end\n    end\nend\n\ndefine None\nGet Vector from (x1) (y1) to (x2) (y2)\nNormalize Vector\nadd (((x1) + (x2)) / (2)) to [*platforms v]\nadd (((y1) + (y2)) / (2)) to [*platforms v]\nadd ((dist) / (2)) to [*platforms v]\nadd ((dist) / (2)) to [*platforms v]\nadd (t) to [*platforms v]\nadd [0] to [*platforms v]\nif <(dx) < [0]> then\n    add (([atan v] of ((dy) / (dx)) ) + (180)) to [*platforms v]\nelse\n    add ([atan v] of ((dy) / (dx)) ) to [*platforms v]\nend\nadd [0] to [*moves v]\nadd (length of [*moves v]) to [*move indices v]\nadd (length of [*move indices v]) to [*platforms v]\nadd [0] to [*platforms v]\nadd (item ((((length of [*platforms v]) + (4)) - (length of [\(platform\) v])) + (7)) of [*platforms v]) to [*platforms v]\nadd (item ((((length of [*platforms v]) + (3)) - (length of [\(platform\) v])) + (1)) of [*platforms v]) to [*platforms v]\nadd (item ((((length of [*platforms v]) + (2)) - (length of [\(platform\) v])) + (2)) of [*platforms v]) to [*platforms v]\nadd [1] to [*platforms v]\n\ndefine None\nadd (x) to [*platforms v]\nadd (y) to [*platforms v]\nadd ((p) * (l)) to [*platforms v]\nadd (((1) - (p)) * (l)) to [*platforms v]\nadd (t) to [*platforms v]\nadd [0] to [*platforms v]\nadd (a) to [*platforms v]\nadd [0] to [*moves v]\nadd (length of [*moves v]) to [*move indices v]\nadd (length of [*move indices v]) to [*platforms v]\nadd [0] to [*platforms v]\nadd (a) to [*platforms v]\nadd (x) to [*platforms v]\nadd (y) to [*platforms v]\nadd [1] to [*platforms v]\n\ndefine None\nadd (x) to [*platforms v]\nadd (y) to [*platforms v]\nadd (l1) to [*platforms v]\nadd (l2) to [*platforms v]\nadd (type) to [*platforms v]\nadd [0] to [*platforms v]\nadd (angle) to [*platforms v]\nadd [0] to [*moves v]\nadd (length of [*moves v]) to [*move indices v]\nadd (length of [*move indices v]) to [*platforms v]\nadd [0] to [*platforms v]\nadd (angle) to [*platforms v]\nadd (x) to [*platforms v]\nadd (y) to [*platforms v]\nadd (loop) to [*platforms v]\n\ndefine Load Move Codes []\nUnpack Contents (code)\nset [savecodeindex v] to [1]\nset [*platindex v] to [0]\nrepeat until <(saveCodeIndex) > (length of (saveCode))>\n    Convert OtherToDec (letter (saveCodeIndex) of (saveCode)) Base Chars [0123456789abcdeghijklmnopqrsuvwxyz]\n    change [savecodeindex v] by (1)\n    repeat (_convertedCode)\n        delete (all) of [save code v]\n        repeat (2)\n            Add (saveCodeIndex) to Code, Length (3) Sign <[1] = [1]>\n        end\n        Add (saveCodeIndex) to Code, Length (2) Sign <[1] = [1]>\n        Add (saveCodeIndex) to Code, Length (2) Sign \n        Add Move for Platform (*platIndex) | Move to (item (1) of [save code v]) (item (2) of [save code v]) | Rotate by (item (3) of [save code v]) in (item (4) of [save code v]) ticks at Index (-1)\n    end\n    change [*platindex v] by (length of [\(platform\) v])\nend\n\ndefine None\nset [_convertedcode v] to (letter ((index) + <sign>) of (saveCode))\nrepeat ((l) - (1))\n    set [_convertedcode v] to (join (_convertedCode) (letter ((index) + ((length of (_convertedCode)) + <sign>)) of (saveCode)))\nend\nConvert OtherToDec (_convertedCode) Base Chars [0123456789abcdeghijklmnopqrsuvwxyz]\nif <<not <sign>> or <(letter (saveCodeIndex) of (saveCode)) = [1]>> then\n    add (round (_convertedCode)) to [save code v]\nelse\n    add (join [-] (round (_convertedCode))) to [save code v]\nend\nchange [savecodeindex v] by ((l) + <sign>)\n\ndefine None\nConvert DecToOther ([abs v] of (val) ) Length (l) Base Chars [0123456789abcdeghijklmnopqrsuvwxyz]\nif <sign> then\n    set [sign v] to ((([abs v] of (val) ) / (val)) + (0))\n    if <(sign) = [0]> then\n        set [sign v] to [1]\n    end\n    set [savecode v] to (join (saveCode) (join (((sign) + (1)) / (2)) (_convertedCode)))\nelse\n    set [savecode v] to (join (saveCode) (_convertedCode))\nend\n\ndefine Unpack Contents []\nset [savecode v] to []\nset [savecodeindex v] to [1]\nrepeat until <(saveCodeIndex) > (length of (code))>\n    if <(letter (saveCodeIndex) of (code)) = [f]> then\n        repeat (letter ((saveCodeIndex) + (1)) of (code))\n            set [savecode v] to (join (saveCode) [0])\n        end\n        change [savecodeindex v] by (2)\n    else\n        set [savecode v] to (join (saveCode) (letter (saveCodeIndex) of (code)))\n        change [savecodeindex v] by (1)\n    end\nend\n\ndefine Load Platform Codes []\nUnpack Contents (code)\nset [savecodeindex v] to [1]\nrepeat ((length of (saveCode)) / (18))\n    delete (all) of [save code v]\n    repeat (2)\n        Add (saveCodeIndex) to Code, Length (3) Sign <[1] = [1]>\n    end\n    Add (saveCodeIndex) to Code, Length (2) Sign \n    repeat (2)\n        Add (saveCodeIndex) to Code, Length (3) Sign \n    end\n    repeat (2)\n        Add (saveCodeIndex) to Code, Length (1) Sign \n    end\n    Add Platform (item (1) of [save code v]) (item (2) of [save code v]) (item (3) of [save code v]) (item (4) of [save code v]) (item (5) of [save code v]) (item (6) of [save code v]) (item (7) of [save code v])\nend\n\ndefine Save Contents\ndelete (all) of [save code v]\nset [savecode v] to []\nset [*platindex v] to [0]\nrepeat ((length of [*platforms v]) / (length of [\(platform\) v]))\n    Convert Val (item ((*platIndex) + (11)) of [*platforms v]) Length (3) Sign <[1] = [1]>\n    Convert Val (item ((*platIndex) + (12)) of [*platforms v]) Length (3) Sign <[1] = [1]>\n    Convert Val (((item ((*platIndex) + (10)) of [*platforms v]) + (360)) mod (360)) Length (2) Sign \n    Convert Val (item ((*platIndex) + (3)) of [*platforms v]) Length (3) Sign \n    Convert Val (item ((*platIndex) + (4)) of [*platforms v]) Length (3) Sign \n    Convert Val (item ((*platIndex) + (5)) of [*platforms v]) Length (1) Sign \n    Convert Val (item ((*platIndex) + (13)) of [*platforms v]) Length (1) Sign \n    change [*platindex v] by (length of [\(platform\) v])\nend\nadd [Platform Codes:] to [save code v]\nadd (saveCode) to [save code v]\nShorten 0s of Item (2)\ndelete (2) of [save code v]\nset [savecode v] to []\nset [*moveindex v] to [1]\nrepeat until <(*moveIndex) > (length of [*moves v])>\n    Convert Val (item (*moveIndex) of [*moves v]) Length (1) Sign \n    repeat (item (*moveIndex) of [*moves v])\n        Convert Val (item ((*moveIndex) + (1)) of [*moves v]) Length (3) Sign <[1] = [1]>\n        Convert Val (item ((*moveIndex) + (2)) of [*moves v]) Length (3) Sign <[1] = [1]>\n        Convert Val (item ((*moveIndex) + (8)) of [*moves v]) Length (2) Sign <[1] = [1]>\n        Convert Val (item ((*moveIndex) + (6)) of [*moves v]) Length (2) Sign \n        change [*moveindex v] by (length of [\(move\) v])\n    end\n    change [*moveindex v] by (1)\nend\nadd [Move Codes:] to [save code v]\nadd (saveCode) to [save code v]\nShorten 0s of Item (4)\ndelete (4) of [save code v]\n\nAdd Platform at (0) (-100) Angle (0) Length (1000) Type (1) \%center (0.5)\nAdd Platform at (-500) (0) Angle (90) Length (1000) Type (1) \%center (0)\nAdd Move for Platform ((1) * (length of [\(platform\) v])) | Move to (-700) (0) | Rotate by (0) in (50) ticks at Index (-1)\nAdd Move for Platform ((1) * (length of [\(platform\) v])) | Move to (-700) (0) | Rotate by (90) in (50) ticks at Index (-1)\nAdd Move for Platform ((1) * (length of [\(platform\) v])) | Move to (-700) (0) | Rotate by (-90) in (50) ticks at Index (-1)\nAdd Move for Platform ((1) * (length of [\(platform\) v])) | Move to (-500) (0) | Rotate by (0) in (50) ticks at Index (-1)\nAdd Platform at (800) (200) Angle (0) Length (400) Type (1) \%center (0.5)\nAdd Platform at (800) (200) Angle (90) Length (400) Type (1) \%center (0.5)\nAdd Move for Platform ((2) * (length of [\(platform\) v])) | Move to (800) (200) | Rotate by (180) in (80) ticks at Index (-1)\nAdd Move for Platform ((3) * (length of [\(platform\) v])) | Move to (800) (200) | Rotate by (180) in (80) ticks at Index (-1)\nAdd Platform at (1800) (200) Angle (0) Length (400) Type (1) \%center (0.5)\nAdd Platform at (1800) (200) Angle (90) Length (400) Type (1) \%center (0.5)\nAdd Move for Platform ((4) * (length of [\(platform\) v])) | Move to (1800) (200) | Rotate by (180) in (80) ticks at Index (-1)\nAdd Move for Platform ((5) * (length of [\(platform\) v])) | Move to (1800) (200) | Rotate by (180) in (80) ticks at Index (-1)\nAdd Platform at (2800) (0) Angle (90) Length (1000) Type (1) \%center (0)\nAdd Platform at (0) (700) Angle (0) Length (100) Type (1) \%center (0.5)\nAdd Move for Platform ((7) * (length of [\(platform\) v])) | Move to (2500) (700) | Rotate by (180) in (150) ticks at Index (-1)\nAdd Move for Platform ((7) * (length of [\(platform\) v])) | Move to (0) (700) | Rotate by (180) in (150) ticks at Index (-1)\nAdd Platform at (3200) (0) Angle (90) Length (1000) Type (4) \%center (0)\n\ndefine None\ndelete (all) of [*platforms v]\ndelete (all) of [*moves v]\ndelete (all) of [*move indices v]\nLoad Platform Codes (item (n) of [level plat codes v])\nLoad Move Codes (item (n) of [level move codes v])\n\ndefine Reset GUI\nset [*mplatselect v] to [-1]\nset [guitargetx v] to ((240) + (90))\nset [guix v] to ((240) + (90))\nset [scrolly v] to [0]\nset [*selectedmove v] to [-1]\nset [guitype v] to [0]\n\ndefine None\nset [*moveindex v] to (item (item ((p) + (8)) of [*platforms v]) of [*move indices v])\nreplace item (*moveIndex) of [*moves v] with ((item (*moveIndex) of [*moves v]) + (1))\nif <(i) < [0]> then\n    change [*moveindex v] by (((((item (*moveIndex) of [*moves v]) - (1)) - ((i) + (1))) * (length of [\(move\) v])) + (1))\nelse\n    change [*moveindex v] by (((i) * (length of [\(move\) v])) + (1))\nend\ninsert (rot) at (*moveIndex) of [*moves v] \ninsert [0] at (*moveIndex) of [*moves v] \ninsert (n) at (*moveIndex) of [*moves v] \ninsert [0] at (*moveIndex) of [*moves v] \ninsert [0] at (*moveIndex) of [*moves v] \ninsert [0] at (*moveIndex) of [*moves v] \ninsert (y) at (*moveIndex) of [*moves v] \ninsert (x) at (*moveIndex) of [*moves v] \nset [*moveindex v] to ((item ((p) + (8)) of [*platforms v]) + (1))\nrepeat ((length of [*move indices v]) - (item ((p) + (8)) of [*platforms v]))\n    replace item (*moveIndex) of [*move indices v] with ((item (*moveIndex) of [*move indices v]) + (length of [\(move\) v]))\n    change [*moveindex v] by (1)\nend\n\ndefine Background <>\nif <blueprints> then\n    Shade Screen (join [0x] [4070E0])\nelse\n    set pen color to (join [0x] [ffe090])\n    Draw Line (-330) (-90) (330) (-90) Size (180)\n    set pen color to (join [0x] [a0ffff])\n    Draw Line (-330) (90) (330) (90) Size (180)\n    set [*platindex v] to [0]\n    repeat ((length of [*cactus pos v]) / (3))\n        go to x: (item ((*platIndex) + (1)) of [*cactus pos v]) y: (item ((*platIndex) + (2)) of [*cactus pos v])\n        set pen color to (join [0x] [00d000])\n        set pen size to (1)\n        pen down\n        set pen size to (5)\n        change y by (item ((*platIndex) + (3)) of [*cactus pos v])\n        pen up\n        change [*platindex v] by (3)\n    end\nend\n\ndefine None\ngo to x: (x1) y: (y1)\nset pen size to (1)\npen down\nset pen size to (s)\ngo to x: (x2) y: (y2)\npen up\n\ndefine None\nset pen color to (c)\nDraw Line (-330) (-90) (330) (-90) Size (180)\nDraw Line (-330) (90) (330) (90) Size (180)\n\n@oh yeahhh it's a thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\n