InfiniFormer 3 || Pen Platformer
@Stage\n\nwhen flag clicked\nforever\n    wait (1) seconds\n    play sound [Underwater.mp3 v] until done\nend\n\n@game\n\ndefine c - l col (x) (y) (x2) (y2) (cx) (cy) (rad) (line rad)\n// [bug fix]\nif <(y) = (y2)> then\n    set [ty v] to ((y2) + (0.001))\nelse\n    set [ty v] to (y2)\nend\n// [find the gradients]\nset [m01 v] to (((y) - (Ty)) / ((x) - (x2)))\nset [m02 v] to ((((cy) - ((x2) - (x))) - (cy)) / (((cx) + ((Ty) - (y))) - (cx)))\n// [finds the point on line]\nset [b1 v] to ((y) - ((M01) * (x)))\nset [b2 v] to ((cy) - ((M02) * (cx)))\nset [px v] to (((B1) - (B2)) / ((M02) - (M01)))\n// [bug fix]\nif <(M01) = [0]> then\n    set [py v] to (((M02) * (Px)) + (B2))\nelse\n    set [py v] to (((M01) * (Px)) + (B1))\nend\nif <(x) = (x2)> then\n    if <(y) < (Py)> then\n        if <not <(Py) < (Ty)>> then\n            set [px v] to (x2)\n            set [py v] to (Ty)\n        end\n    else\n        set [px v] to (x)\n        set [py v] to (y)\n    end\nelse\n    if <(x) < (Px)> then\n        if <not <(Px) < (x2)>> then\n            set [px v] to (x2)\n            set [py v] to (Ty)\n        end\n    else\n        set [px v] to (x)\n        set [py v] to (y)\n    end\nend\n// [collides]\ncalc dist (Px) (Py) (cx) (cy)\nset [collisions v] to [0]\nif <(((rad) + (line rad)) / (2)) > (dist)> then\n    set [collisions v] to [1]\n    add [t] to [collisions v]\nend\n\nwhen flag clicked\n// [setup]\nset [level v] to [1]\nset [seed v] to (pick random (0) to (9999999))\nint\nforever\n    // [main loop]\n    broadcast (update  v)\n    broadcast (draw v)\n    broadcast (draw test v)\nend\n\ndefine generate level\nset [rlgc v] to (SEED)\ndelete all of [level start v]\ndelete all of [level blocks v]\ndelete all of [moving v]\nadd start [0] [0] [1]\ngenerate rand#. (min: [0] max: [1] )\nset [dir v] to (rR)\nif <(dir) = [0]> then\n    set [dir v] to [-1]\nend\ngenerate rand#. (min: [10] max: [20] )\nset [length v] to (rR)\nset [idx v] to [0]\nadd block [-100] [-100] [200] [50] [1] [] [] []\ndelete all of [triangles v]\nrepeat (length)\n    set [pidx v] to (idx)\n    change [idx v] by (#Block)\n    delete all of [data v]\n    generate rand#. (min: [1] max: [3] )\n    generate rand#. (min: [1] max: (rR) )\n    if <(rR) = [3]> then\n        set [rr v] to [4]\n    end\n    set [type v] to (rR)\n    if <(dir) = [1]> then\n        get data ⊕\n    else\n        get data ⊝\n    end\n    generate rand#. (min: [40] max: [60] )\n    add block (item (5) of [data v]) (item (6) of [data v]) (item (3) of [data v]) (item (4) of [data v]) (type) (item (7) of [data v]) (item (8) of [data v]) (rR)\nend\nset [pidx v] to (idx)\nchange [idx v] by (#Block)\nset [type v] to [3]\ndelete all of [data v]\nif <(dir) = [1]> then\n    add ((item ((pidx) + (9)) of [level blocks v]) + ((item ((pidx) + (1)) of [level blocks v]) + (item ((pidx) + (3)) of [level blocks v]))) to [data v]\n    add ((item ((pidx) + (10)) of [level blocks v]) + (item ((pidx) + (2)) of [level blocks v])) to [data v]\n    add [20] to [data v]\n    add [20] to [data v]\n    generate rand#. (min: (item (3) of [data v]) max: ((item (3) of [data v]) + (20)) )\n    add ((item (1) of [data v]) + (rR)) to [data v]\n    generate rand#. (min: [20] max: [80] )\n    add (((item (2) of [data v]) - ((item (4) of [data v]) / (2))) + (rR)) to [data v]\nelse\n    add ((item ((pidx) + (9)) of [level blocks v]) + (item ((pidx) + (1)) of [level blocks v])) to [data v]\n    add ((item ((pidx) + (10)) of [level blocks v]) + (item ((pidx) + (2)) of [level blocks v])) to [data v]\n    add [20] to [data v]\n    add [20] to [data v]\n    generate rand#. (min: [0] max: [50] )\n    add (((item (1) of [data v]) - (item (3) of [data v])) - (rR)) to [data v]\n    generate rand#. (min: [20] max: [80] )\n    add (((item (2) of [data v]) - ((item (4) of [data v]) / (2))) + (rR)) to [data v]\nend\nadd block (item (5) of [data v]) (item (6) of [data v]) (item (3) of [data v]) (item (4) of [data v]) (type) [] [] []\n\ndefine add start (x) (y) (type)\nset [#start v] to (length of [level start v])\nadd (x) to [level start v]\nadd (y) to [level start v]\nadd (type) to [level start v]\nset [#start v] to ((length of [level start v]) - (#Start))\n\ndefine add block (x) (y) (lenx) (higy) (type) (cx2) (cy2) (sp)\nset [#block v] to (length of [level blocks v])\nadd (x) to [level blocks v]\nadd (y) to [level blocks v]\nadd (lenx) to [level blocks v]\nadd (higy) to [level blocks v]\nadd (type) to [level blocks v]\nadd (join [/] (idx)) to [level blocks v]\nif <(type) = [2]> then\n    add (cx2) to [level blocks v]\n    add (cy2) to [level blocks v]\n    add ((cx2) - (x)) to [level blocks v]\n    add ((cy2) - (y)) to [level blocks v]\nelse\n    repeat (4)\n        add [] to [level blocks v]\n    end\nend\nadd (dir) to [level blocks v]\nadd (x) to [level blocks v]\nadd (dir) to [level blocks v]\nadd (sp) to [level blocks v]\nset [#block v] to ((length of [level blocks v]) - (#Block))\n\nwhen I receive [update  v]\n// [main update section]\nupdate player <<<(mouse x) < [50]> and <mouse down?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> <<<[50] < (mouse x)> and <mouse down?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> <<<<[50] < (mouse y)> and <mouse down?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> or <key (space v) pressed?>>\nU I\nupdate platforms\n\ndefine update player <<> <>> <^>\ndelete all of [data v]\nchange [sx v] by ((<>> - <<>) - ((sx) * (0.15)))\nchange [x v] by (sx)\nchange [y v] by (#PenSize)\n// [get the x collisions]\ncollide []\nchange [y v] by (() - (#PenSize))\n// [if x is touching moving dont collide]\nif <[moving v] contains (item (1) of [collisions v])?> then\n    // [make data to tell y not to collide as well]\n    add [] to [data v]\nelse\n    if <(length of [collisions v]) > [0]> then\n        change [x v] by (() - (sx))\n        set [sx v] to [0]\n    end\nend\nchange [sy v] by (() - (gravity))\nchange [y v] by (sy)\ncollide []\nif <(item ((item (1) of [collisions v]) + (5)) of [level blocks v]) = [4]> then\n    change [y v] by (() - (sy))\n    set [sy v] to (pick random (20) to (25))\nelse\n    if <<(length of [collisions v]) > [0]> and <(length of [data v]) = [0]>> then\n        change [y v] by (() - (sy))\n        set [m01 v] to (item ((item (1) of [collisions v]) + (2)) of [level blocks v])\n        set [m01 v] to ((M01) + (item ((item (1) of [collisions v]) + (4)) of [level blocks v]))\n        set [m01 v] to ((((M01) + (#PenSize)) + (#PlayerSize)) - (y))\n        change [y v] by (round (M01))\n        set [sy v] to [0]\n        set [double jump v] to [0]\n        if <<^> and <(sy) < [1]>> then\n            set [sy v] to [15]\n            set [double jump v] to [1]\n        end\n    end\nend\nif <<(double jump) = [1]> and <<^> and <(sy) < [1]>>> then\n    set [sy v] to [10]\n    set [double jump v] to [0]\nend\nchange [camx v] by ((((x) + ((sx) * (10))) - (CamX)) / (5))\nchange [camy v] by (((y) - (CamY)) / (8))\nif <((y) - (CamY)) < [-180]> then\n    int\nend\n\ndefine int\n// [call the generator here so as to reset the level with the same seed]\ngenerate level\n// [reset player]\nset [#pensize v] to [4]\nset [x v] to (item (1) of [level start v])\nset [y v] to (item (2) of [level start v])\nset [#playersize v] to [10]\nset [sx v] to [0]\nset [sy v] to [0]\nset [gravity v] to [1]\n\ndefine collide (idx)\ndelete all of [collisions v]\nset [idx v] to [0]\n// [box - box]\nrepeat ((length of [level blocks v]) / (#Block))\n    check collisions (((x) + (#PlayerSize)) + (#PenSize)) (((y) + (#PlayerSize)) + (#PenSize)) (((x) - (#PlayerSize)) - (#PenSize)) (((y) - (#PlayerSize)) - (#PenSize)) (idx)\n    change [idx v] by (#Block)\nend\nif <(item ((item (1) of [collisions v]) + (5)) of [level blocks v]) = [3]> then\n    change [level v] by (1)\n    set [seed v] to (pick random (0) to (9999999))\n    int\nend\nset [idx v] to [0]\n// [circle - line]\nrepeat ((length of [triangles v]) / (#Triangle))\n    calc dist (x) (y) (item ((idx) + (1)) of [triangles v]) (item ((idx) + (2)) of [triangles v])\n    if <(dist) < ((item ((idx) + (3)) of [triangles v]) + (item ((idx) + (4)) of [triangles v]))> then\n        c - l col (item ((idx) + (1)) of [triangles v]) (item ((idx) + (2)) of [triangles v]) ((item ((idx) + (1)) of [triangles v]) + ((item ((idx) + (3)) of [triangles v]) / (2))) ((item ((idx) + (2)) of [triangles v]) + (item ((idx) + (4)) of [triangles v])) (x) (y) (#PlayerSize) (#PenSize)\n        c - l col ((item ((idx) + (1)) of [triangles v]) + ((item ((idx) + (3)) of [triangles v]) / (2))) ((item ((idx) + (2)) of [triangles v]) + (item ((idx) + (4)) of [triangles v])) ((item ((idx) + (1)) of [triangles v]) + (item ((idx) + (3)) of [triangles v])) (item ((idx) + (2)) of [triangles v]) (x) (y) (#PlayerSize) (#PenSize)\n    end\n    change [idx v] by (#Triangle)\nend\n// [reset the player if touching a ∆]\nif <[collisions v] contains [t]?> then\n    int\nend\n// [put the index back]\nset [idx v] to (idx)\n\ndefine check collisions (x) (y) (x2) (y2) (idx)\n// [normal box to box collisions]\nif <<(x) > (item ((idx) + (1)) of [level blocks v])> and <(x2) < ((item ((idx) + (1)) of [level blocks v]) + (item ((idx) + (3)) of [level blocks v]))>> then\n    if <<(y) > (item ((idx) + (2)) of [level blocks v])> and <(y2) < ((item ((idx) + (2)) of [level blocks v]) + (item ((idx) + (4)) of [level blocks v]))>> then\n        add (idx) to [collisions v]\n    end\nend\n\ndefine get data ⊝\n// [basically the same as the + data, but -]\nadd ((item ((pidx) + (9)) of [level blocks v]) + (item ((pidx) + (1)) of [level blocks v])) to [data v]\nadd ((item ((pidx) + (10)) of [level blocks v]) + (item ((pidx) + (2)) of [level blocks v])) to [data v]\nif <(type) = [1]> then\n    generate rand#. (min: [150] max: [250] )\n    generate rand#. (min: [30] max: (rR) )\n    add (rR) to [data v]\n    generate rand#. (min: [20] max: [50] )\n    add (rR) to [data v]\nelse\n    generate rand#. (min: [40] max: [60] )\n    generate rand#. (min: [20] max: (rR) )\n    add (rR) to [data v]\n    generate rand#. (min: [20] max: [50] )\n    add (rR) to [data v]\nend\ngenerate rand#. (min: [1] max: [2] )\nset [rr2 v] to (rR)\ngenerate rand#. (min: [1] max: [2] )\nif <(rR) = (rR2)> then\n    generate rand#. (min: [100] max: [200] )\n    add (((item (1) of [data v]) - (item (3) of [data v])) - (rR)) to [data v]\n    generate rand#. (min: [-50] max: [80] )\n    add (((item (2) of [data v]) - ((item (4) of [data v]) / (1.5))) + (((rR) / (2)) + ((120) * <(item ((pidx) + (5)) of [level blocks v]) = [4]>))) to [data v]\nelse\n    generate rand#. (min: (item (3) of [data v]) max: [100] )\n    add (((item (1) of [data v]) - (item (3) of [data v])) - (rR)) to [data v]\n    generate rand#. (min: [-50] max: [50] )\n    add (((item (2) of [data v]) - ((item (4) of [data v]) / (2))) + ((rR) + ((120) * <(item ((pidx) + (5)) of [level blocks v]) = [4]>))) to [data v]\nend\nif <(type) = [1]> then\n    if <(item (3) of [data v]) > [70]> then\n        if <(item (3) of [data v]) < [120]> then\n            generate rand#. (min: (((item (5) of [data v]) + (#PenSize)) + (20)) max: ((((item (5) of [data v]) + (item (3) of [data v])) - (#PenSize)) - (20)) )\n            add triangle at (rR) ((item (6) of [data v]) + (item (4) of [data v])) [20] [30]\n        else\n            generate rand#. (min: (((item (5) of [data v]) + (#PenSize)) + (20)) max: ((((item (5) of [data v]) + ((item (3) of [data v]) / (2))) - (#PenSize)) - (20)) )\n            add triangle at (rR) ((item (6) of [data v]) + (item (4) of [data v])) [20] [30]\n            generate rand#. (min: [1] max: [4] )\n            if <(rR) = [1]> then\n                generate rand#. (min: ((((item (5) of [data v]) + ((item (3) of [data v]) / (2))) + (#PenSize)) + (20)) max: ((((item (5) of [data v]) + (item (3) of [data v])) - (#PenSize)) - (20)) )\n                add triangle at (rR) ((item (6) of [data v]) + (item (4) of [data v])) [20] [30]\n            end\n        end\n    end\nelse\n    generate rand#. (min: [40] max: [300] )\n    generate rand#. (min: ((item (5) of [data v]) - (30)) max: ((item (5) of [data v]) - (rR)) )\n    add (rR) to [data v]\n    generate rand#. (min: [40] max: [200] )\n    generate rand#. (min: ((item (6) of [data v]) - (10)) max: ((item (6) of [data v]) + ((rR) + ((120) * <(item ((pidx) + (5)) of [level blocks v]) = [4]>))) )\n    add (rR) to [data v]\n    add (idx) to [moving v]\nend\n\ndefine get data ⊕\n// [find the index point \(x, y\)]\nadd ((item ((pidx) + (9)) of [level blocks v]) + ((item ((pidx) + (1)) of [level blocks v]) + (item ((pidx) + (3)) of [level blocks v]))) to [data v]\nadd ((item ((pidx) + (10)) of [level blocks v]) + (item ((pidx) + (2)) of [level blocks v])) to [data v]\n// [decides if it is a moving platform or not]\n// [basically just gets the length and height]\nif <(type) = [1]> then\n    generate rand#. (min: [150] max: [250] )\n    generate rand#. (min: [30] max: (rR) )\n    add (rR) to [data v]\n    generate rand#. (min: [20] max: [50] )\n    add (rR) to [data v]\nelse\n    generate rand#. (min: [40] max: [60] )\n    generate rand#. (min: [20] max: (rR) )\n    add (rR) to [data v]\n    generate rand#. (min: [20] max: [50] )\n    add (rR) to [data v]\nend\ngenerate rand#. (min: [1] max: [2] )\nset [rr2 v] to (rR)\ngenerate rand#. (min: [1] max: [2] )\nif <(type) = [4]> then\n    generate rand#. (min: (item (3) of [data v]) max: [100] )\n    add ((item (1) of [data v]) + (rR)) to [data v]\n    generate rand#. (min: [-50] max: [50] )\n    add (((item (2) of [data v]) - ((item (4) of [data v]) / (2))) + (rR)) to [data v]\nelse\n    if <(type) = [1]> then\n        // [decides if it should be a long jump or not]\n        if <(rR) = (rR2)> then\n            generate rand#. (min: [100] max: [200] )\n            add ((item (1) of [data v]) + (rR)) to [data v]\n            generate rand#. (min: [-50] max: [80] )\n            add (((item (2) of [data v]) - ((item (4) of [data v]) / (1.5))) + (((rR) / (2)) + ((120) * <(item ((pidx) + (5)) of [level blocks v]) = [4]>))) to [data v]\n        else\n            generate rand#. (min: (item (3) of [data v]) max: [100] )\n            add ((item (1) of [data v]) + (rR)) to [data v]\n            generate rand#. (min: [-50] max: [50] )\n            add (((item (2) of [data v]) - ((item (4) of [data v]) / (2))) + ((rR) + ((120) * <(item ((pidx) + (5)) of [level blocks v]) = [4]>))) to [data v]\n        end\n        // [adds a ∆ if the parameters are big enough]\n        if <(item (3) of [data v]) > [70]> then\n            if <(item (3) of [data v]) < [120]> then\n                // [1 ∆]\n                generate rand#. (min: (((item (5) of [data v]) + (#PenSize)) + (20)) max: ((((item (5) of [data v]) + (item (3) of [data v])) - (#PenSize)) - (20)) )\n                add triangle at (rR) ((item (6) of [data v]) + (item (4) of [data v])) [20] [30]\n            else\n                // [2 ∆]\n                generate rand#. (min: (((item (5) of [data v]) + (#PenSize)) + (20)) max: ((((item (5) of [data v]) + ((item (3) of [data v]) / (2))) - (#PenSize)) - (20)) )\n                add triangle at (rR) ((item (6) of [data v]) + (item (4) of [data v])) [20] [30]\n                generate rand#. (min: [1] max: [2] )\n                if <(rR) = [1]> then\n                    generate rand#. (min: ((((item (5) of [data v]) + ((item (3) of [data v]) / (2))) + (#PenSize)) + (20)) max: ((((item (5) of [data v]) + (item (3) of [data v])) - (#PenSize)) - (20)) )\n                    add triangle at (rR) ((item (6) of [data v]) + (item (4) of [data v])) [20] [30]\n                end\n            end\n        end\n    else\n        // [adds data for a moving platform]\n        generate rand#. (min: (item (3) of [data v]) max: [50] )\n        add ((item (1) of [data v]) + (rR)) to [data v]\n        generate rand#. (min: [-50] max: [50] )\n        add (((item (2) of [data v]) - ((item (4) of [data v]) / (2))) + ((rR) + ((120) * <(item ((pidx) + (5)) of [level blocks v]) = [4]>))) to [data v]\n        generate rand#. (min: [40] max: [500] )\n        generate rand#. (min: ((item (5) of [data v]) + (30)) max: ((item (5) of [data v]) + (rR)) )\n        add (rR) to [data v]\n        generate rand#. (min: [40] max: [200] )\n        generate rand#. (min: ((item (6) of [data v]) - (10)) max: ((item (6) of [data v]) + (rR)) )\n        add (rR) to [data v]\n        add (idx) to [moving v]\n    end\nend\n\ndefine generate rand#. (min: (min) max: (max) )\n// [randomized linear regression formula \(go see @javaprogrammer ' s perlin noise for more detail]\nset [rlgc v] to ((((RLGC) * (1664525)) + (1013904223)) mod (4294967296))\nset [rr v] to (round ((min) + (((max) - (min)) * ((RLGC) / (4294967296)))))\n\ndefine U I\nif <<(mouse x) < [-100]> and <(mouse y) > [155]>> then\n    show variable [seed v]\nelse\n    hide variable [seed v]\nend\nset [gc v] to ((<(gc) > [0]> * <key (g v) pressed?>) + <key (g v) pressed?>)\nif <(gc) = [1]> then\n    set [seed v] to (pick random (0) to (9999999))\n    int\nend\n\ndefine add triangle at (x) (y) (high) (leng)\nset [#triangle v] to (length of [triangles v])\nadd (x) to [triangles v]\nadd (y) to [triangles v]\nadd (high) to [triangles v]\nadd (leng) to [triangles v]\nset [#triangle v] to ((length of [triangles v]) - (#Triangle))\n\ndefine calc dist (x) (y) (x2) (y2)\n// [pyth]\nset [dx v] to ((x2) - (x))\nset [dy v] to ((y2) - (y))\nset [dist v] to ([sqrt v] of (((dX) * (dX)) + ((dY) * (dY))) )\n\ndefine update platforms\nset [idx v] to [0]\nrepeat (length of [moving v])\n    change [idx v] by (1)\n    // [set the index # in "moving"]\n    set [pidx v] to (item (idx) of [moving v])\n    // [translate the positions by a fixed amount]\n    replace item ((pidx) + (1)) of [level blocks v] with ((item ((pidx) + (1)) of [level blocks v]) + ((item ((pidx) + (9)) of [level blocks v]) / ((item ((pidx) + (14)) of [level blocks v]) * (item ((pidx) + (11)) of [level blocks v]))))\n    replace item ((pidx) + (2)) of [level blocks v] with ((item ((pidx) + (2)) of [level blocks v]) + ((item ((pidx) + (10)) of [level blocks v]) / ((item ((pidx) + (14)) of [level blocks v]) * (item ((pidx) + (11)) of [level blocks v]))))\n    // [collisions from y save so we can use those to collide the player to the moving platform]\n    if <[collisions v] contains (item (idx) of [moving v])?> then\n        // [move the player by the same amount as the platforms]\n        change [x v] by ((item ((pidx) + (9)) of [level blocks v]) / ((item ((pidx) + (14)) of [level blocks v]) * (item ((pidx) + (11)) of [level blocks v])))\n        change [y v] by ((0) + ((item ((pidx) + (10)) of [level blocks v]) / ((item ((pidx) + (14)) of [level blocks v]) * (item ((pidx) + (11)) of [level blocks v]))))\n    end\n    // [get boundries]\n    if <(item ((pidx) + (13)) of [level blocks v]) = [1]> then\n        if <(item ((pidx) + (1)) of [level blocks v]) > (item ((pidx) + (7)) of [level blocks v])> then\n            replace item ((pidx) + (11)) of [level blocks v] with [-1]\n        end\n        if <(item ((pidx) + (1)) of [level blocks v]) < (item ((pidx) + (12)) of [level blocks v])> then\n            replace item ((pidx) + (11)) of [level blocks v] with [1]\n        end\n    else\n        if <(item ((pidx) + (1)) of [level blocks v]) > (item ((pidx) + (12)) of [level blocks v])> then\n            replace item ((pidx) + (11)) of [level blocks v] with [1]\n        end\n        if <(item ((pidx) + (1)) of [level blocks v]) < (item ((pidx) + (7)) of [level blocks v])> then\n            replace item ((pidx) + (11)) of [level blocks v] with [-1]\n        end\n    end\nend\n\ndefine // ()\n\nwhen [s v] key pressed\nask [Set a SEED] and wait\nif <not <<<(answer) = [No]> or <(answer) = [no]>> or <(answer) = [n]>>> then\n    set [seed v] to (answer)\n    int\nend\n\n@renderer\n\nwhen I receive [draw v]\nerase all\ndraw grid\ndraw back\ndraw players\ndraw triangles\ndraw platforms\n\ndefine fill (x) (y) (x2) (y2) (idx) (res) (type)\npen up\nset pen size to ((res) + (1))\nset [idx v] to [0]\nrepeat (([abs v] of (((y2) - (y)) / (res)) ) - (0))\n    go to ((x) + ((res) / (2))) (((y) + ((res) / (2))) + (idx)) \n    go to ((x2) - ((res) / (2))) (((y) + ((res) / (2))) + (idx)) <>\n    change [idx v] by (res)\nend\nset pen size to (res)\nset pen color to (#000000)\ngo to (x) (y) \ngo to (x2) (y) <>\ngo to (x2) (y2) <>\ngo to (x) (y2) <>\ngo to (x) (y) <>\nif <(type) = [1]> then\n    set [idx v] to ((res) * (-1))\n    set pen color to (#0bb700)\n    repeat (2)\n        set pen size to ((res) * (2))\n        go to (x) ((y2) + (idx)) \n        go to (x2) ((y2) + (idx)) <>\n        change pen (brightness v) by (30)\n        change [idx v] by (res)\n    end\nend\nset [idx v] to (idx)\n\ndefine draw platforms\nset [idx v] to [0]\nrepeat ((length of [level blocks v]) / (#Block))\n    delete all of [block v]\n    add (item ((idx) + (1)) of [level blocks v]) to [block v]\n    add (item ((idx) + (2)) of [level blocks v]) to [block v]\n    add (item ((idx) + (3)) of [level blocks v]) to [block v]\n    add (item ((idx) + (4)) of [level blocks v]) to [block v]\n    get colour (item ((idx) + (5)) of [level blocks v])\n    fill (item (1) of [block v]) (item (2) of [block v]) ((item (1) of [block v]) + (item (3) of [block v])) ((item (2) of [block v]) + (item (4) of [block v])) (idx) (#PenSize) (item ((idx) + (5)) of [level blocks v])\n    change [idx v] by (#Block)\nend\n\ndefine go to (x) (y) <block>\nif <block> then\n    pen up\nelse\n    pen down\nend\ngo to x: ((x) - (CamX)) y: ((y) - (CamY))\n\ndefine draw players\nset pen color to (#ff9a9a)\nfill (([x v] of [game v]) - (#PlayerSize)) (([y v] of [game v]) - (#PlayerSize)) (([x v] of [game v]) + (#PlayerSize)) (([y v] of [game v]) + (#PlayerSize)) [] (#PenSize) []\n\ndefine draw grid\nset pen color to (#c7d9ff)\nset pen size to (5)\nrepeat (2)\n    set [idx v] to [-240]\n    repeat (10)\n        pen up\n        go to x: ((idx) - (((CamX) / (4)) mod (70))) y: (-180)\n        pen down\n        go to x: ((idx) - (((CamX) / (4)) mod (70))) y: (180)\n        change [idx v] by (70)\n    end\n    set [idx v] to [-180]\n    repeat (10)\n        pen up\n        go to x: (240) y: ((idx) - (((CamY) / (4)) mod (70)))\n        pen down\n        go to x: (-240) y: ((idx) - (((CamY) / (4)) mod (70)))\n        change [idx v] by (70)\n    end\n    change pen (transparency v) by (50)\n    set pen size to ((12) + (([sin v] of ((timer) * (200)) ) * (3)))\nend\n\ndefine draw triangles\nset [idx v] to [0]\nset pen color to (#ff0000)\nset pen size to (#PenSize)\nrepeat ((length of [triangles v]) / (#Triangle))\n    pen up\n    go to (item ((idx) + (1)) of [triangles v]) (item ((idx) + (2)) of [triangles v]) \n    pen down\n    go to ((item ((idx) + (1)) of [triangles v]) + ((item ((idx) + (3)) of [triangles v]) / (2))) ((item ((idx) + (2)) of [triangles v]) + (item ((idx) + (4)) of [triangles v])) <>\n    go to ((item ((idx) + (1)) of [triangles v]) + (item ((idx) + (3)) of [triangles v])) (item ((idx) + (2)) of [triangles v]) <>\n    change [idx v] by (#Triangle)\nend\n\ndefine draw back\nset [idx v] to [0]\nset pen color to (#afafaf)\nset pen size to (#PenSize)\nrepeat ((length of [level blocks v]) / (#Block))\n    set [nidx v] to ((idx) + (#Block))\n    if <<<[moving v] contains (nidx)?> or <[moving v] contains (idx)?>> or <(item ((nidx) + (1)) of [level blocks v]) = []>> then\n    change [idx v] by (#Block)\nend\n\ndefine get back for ⊕\nadd ((item ((idx) + (1)) of [level blocks v]) + (item ((idx) + (3)) of [level blocks v])) to [block v]\nadd (item ((idx) + (2)) of [level blocks v]) to [block v]\nadd ((item ((idx) + (1)) of [level blocks v]) + (item ((idx) + (3)) of [level blocks v])) to [block v]\nadd ((item ((idx) + (2)) of [level blocks v]) + (item ((idx) + (4)) of [level blocks v])) to [block v]\nadd (item ((nidx) + (1)) of [level blocks v]) to [block v]\nadd (item ((nidx) + (2)) of [level blocks v]) to [block v]\nadd (item ((nidx) + (1)) of [level blocks v]) to [block v]\nadd ((item ((nidx) + (2)) of [level blocks v]) + (item ((nidx) + (4)) of [level blocks v])) to [block v]\n\ndefine get back for ⊖\nadd (item ((idx) + (1)) of [level blocks v]) to [block v]\nadd (item ((idx) + (2)) of [level blocks v]) to [block v]\nadd (item ((idx) + (1)) of [level blocks v]) to [block v]\nadd ((item ((idx) + (2)) of [level blocks v]) + (item ((idx) + (4)) of [level blocks v])) to [block v]\nadd ((item ((nidx) + (1)) of [level blocks v]) + (item ((nidx) + (3)) of [level blocks v])) to [block v]\nadd (item ((nidx) + (2)) of [level blocks v]) to [block v]\nadd ((item ((nidx) + (1)) of [level blocks v]) + (item ((nidx) + (3)) of [level blocks v])) to [block v]\nadd ((item ((nidx) + (2)) of [level blocks v]) + (item ((nidx) + (4)) of [level blocks v])) to [block v]\n\ndefine get colour (type)\nif <(type) = [1]> then\n    set pen color to (#c54709)\nend\nif <(type) = [2]> then\n    set pen color to (#c59909)\nend\nif <(type) = [3]> then\n    set pen color to (#5009d4)\nend\nif <(type) = [4]> then\n    set pen color to (#eeff00)\nend\n\n@tb\n\nwhen flag clicked\nset [ghost v] effect to (100)\nshow\n\n@PTE Ultra+\n\ndefine INTERNAL | calcWW (text) (cspace) (width) (space) (x) (offset)\ndelete all of [_temp0 v]\ndelete all of [_temp1 v]\ndelete all of [_temp2 v]\nset [_i3 v] to [1]\nset [_i4 v] to (space)\nset [_i5 v] to [0]\nset [_i8 v] to [0]\nset [_i9 v] to [0]\nrepeat (length of (text))\n    set [_i6 v] to (letter (_i3) of (text))\n    if <(_i6) = [ ]> then\n        add [1] to [_temp2 v]\n        if <((_i5) + (_i4)) > (width)> then\n            add ((_i9) - (1)) to [_temp0 v]\n            add ((x) + ((offset) * (_i5))) to [_temp1 v]\n            set [_i5 v] to (_i4)\n            set [_i4 v] to (space)\n            set [_i9 v] to ((_i8) + (1))\n        else\n            change [_i5 v] by (_i4)\n            set [_i4 v] to (space)\n            change [_i9 v] by ((_i8) + (1))\n        end\n        set [_i8 v] to [0]\n    else\n        if < [abcdefghijklmnopqrstuvwxyz] contains (_i6)?> then\n            switch costume to (_i6)\n            set [_i7 v] to (costume [number v])\n        else\n            set [_i7 v] to (item # of (_i6) in [_chars v])\n        end\n        if <not <(_i7) = [0]>> then\n            add (_i7) to [_temp2 v]\n            set [_i7 v] to ((item (_i7) of [_charwidths v]) + (cspace))\n            if <((_i4) + (_i7)) > (width)> then\n                add ((_i9) - (1)) to [_temp0 v]\n                add ((x) + ((offset) * (_i5))) to [_temp1 v]\n                set [_i5 v] to (_i4)\n                set [_i4 v] to ((space) + (_i7))\n                set [_i9 v] to ((_i8) + (1))\n                set [_i8 v] to [1]\n                add (item (last) of [_temp2 v]) to [_temp2 v]\n            else\n                change [_i4 v] by (_i7)\n                change [_i8 v] by (1)\n            end\n        end\n    end\n    change [_i3 v] by (1)\nend\nif <(_i8) = [0]> then\n    if <not <(_i9) = [0]>> then\n        add ((_i9) - (1)) to [_temp0 v]\n        add ((x) + ((offset) * (_i5))) to [_temp1 v]\n    end\nelse\n    if <((_i5) + (_i4)) > (width)> then\n        add ((_i9) - (1)) to [_temp0 v]\n        add ((x) + ((offset) * (_i5))) to [_temp1 v]\n        add (_i8) to [_temp0 v]\n        add ((x) + ((offset) * (_i4))) to [_temp1 v]\n    else\n        add ((_i9) + (_i8)) to [_temp0 v]\n        add ((x) + ((offset) * ((_i5) + (_i4)))) to [_temp1 v]\n    end\nend\nrepeat until <<not <(item (1) of [_temp0 v]) < [1]>> or <(length of [_temp0 v]) < [1]>>\n    delete (1) of [_temp0 v]\n    delete (1) of [_temp1 v]\nend\nrepeat until <<not <(item (last) of [_temp0 v]) < [1]>> or <(length of [_temp0 v]) < [1]>>\n    delete (last) of [_temp0 v]\n    delete (last) of [_temp1 v]\nend\n\ndefine Print | Pos (x) (y) Size (size) Width (width) RGB (r) (g) (b) WSU (w) (s) (u) CSpace (cspace) Align (align) Text (text)\nSlow Print | Pos (x) (y) Size (size) Width (width) RGB (r) (g) (b) WSU (w) (s) (u) CSpace (cspace) Align (align) Text (text)\n\ndefine Slow Print | Pos (x) (y) Size (size) Width (width) RGB (r) (g) (b) WSU (w) (s) (u) CSpace (cspace) Align (align) Text (text)\npen up\nset pen color to ((((65536) * (round (r))) + ((256) * (round (g)))) + (round (b)))\nset pen (transparency v) to ([abs v] of ([x v] of [game v]) )\nset [_x v] to (x)\nset [_i0 v] to ((0.01) * (size))\nset [_i1 v] to ([abs v] of ((0.125) * ((w) * (size))) )\nif <<(size) = (round (size))> and <not <(w) < [0]>>> then\n    if <<((round (_i1)) mod (2)) = [0]> and <not <(_i1) < [0.5]>>> then\n        set [_y v] to (round (y))\n    else\n        set [_y v] to (([floor v] of (y) ) + (0.5))\n    end\nelse\n    set [_y v] to (y)\nend\nif <(w) < [0]> then\n    set [_i2 v] to ((0.125) * (size))\nelse\n    set [_i2 v] to (_i1)\nend\nINTERNAL | printText (text) (_y) (_i0) ((width) * (_i0)) ([tan v] of (s) ) ((_i0) * (u)) (((cspace) * ((0.475) * ((size) / ([log v] of (((size) + (1.01)) * ((size) + (1.01))) )))) + (_i2)) (align) ([ceiling v] of ((0.15) * ([sqrt v] of ((width) * ((size) * (size))) )) ) ((1) / (([ceiling v] of ((0.15) * ([sqrt v] of ((width) * ((size) * (size))) )) ) + (1))) (_i1) ((_i1) + (1)) (((0.6) + ((0.4) * <([floor v] of ((u) / (100)) ) = [0]>)) * (_i1)) ((0.09375) * (size))\n\ndefine WW Print | Pos (x) (y) Size (size) Width (width) RGB (r) (g) (b) WW Width (ww width) WSU (w) (s) (u) CSpace (cspace) LSpace (lspace) Align (align) Text (text)\nWW Slow Print | Pos (x) (y) Size (size) Width (width) RGB (r) (g) (b) WW Width (ww width) WSU (w) (s) (u) CSpace (cspace) LSpace (lspace) Align (align) Text (text)\n\ndefine WW Slow Print | Pos (x) (y) Size (size) Width (width) RGB (r) (g) (b) WW Width (ww width) WSU (w) (s) (u) CSpace (cspace) LSpace (lspace) Align (align) Text (text)\npen up\nset pen color to ((((65536) * (round (r))) + ((256) * (round (g)))) + (round (b)))\nset pen (transparency v) to ([abs v] of ([x v] of [game v]) )\nset [_i0 v] to ((0.01) * (size))\nset [_i1 v] to ([abs v] of ((0.125) * ((w) * (size))) )\nif <<(size) = (round (size))> and <not <(w) < [0]>>> then\n    if <<((round (_i1)) mod (2)) = [0]> and <not <(_i1) < [0.5]>>> then\n        set [_y v] to (round (y))\n    else\n        set [_y v] to (([floor v] of (y) ) + (0.5))\n    end\nelse\n    set [_y v] to (y)\nend\nif <(w) < [0]> then\n    set [_i2 v] to ((0.125) * (size))\nelse\n    set [_i2 v] to (_i1)\nend\nset [_i3 v] to (((100) / (size)) / (width))\nset [_i4 v] to ((_i3) * (((cspace) * ((0.475) * ((size) / ([log v] of (((size) + (1.01)) * ((size) + (1.01))) )))) + (_i2)))\nif <(align) = [r]> then\n    set [_i5 v] to ((-1) * (_i0))\nelse\n    if <(align) = [c]> then\n        set [_i5 v] to ((-0.5) * (_i0))\n    else\n        set [_i5 v] to [0]\n    end\nend\nset [_i5 v] to ((width) * (_i5))\nset [_i6 v] to ((item (1) of [_charwidths v]) + (_i4))\nINTERNAL | calcWW (text) (_i4) (((_i3) * (ww width)) + ((_i6) + (_i4))) (_i6) ((x) - ((_i5) * ((_i6) + (_i4)))) (_i5)\nINTERNAL | printWW (_i0) ((width) * (_i0)) ([tan v] of (s) ) ((_i0) * (u)) <not <(u) = [0]>> (((cspace) * ((0.475) * ((size) / ([log v] of (((size) + (1.01)) * ((size) + (1.01))) )))) + (_i2)) (round ((((-0.65) * ((lspace) * (size))) - (size)) - (_i2))) ([ceiling v] of ((0.15) * ([sqrt v] of ((width) * ((size) * (size))) )) ) ((1) / (([ceiling v] of ((0.15) * ([sqrt v] of ((width) * ((size) * (size))) )) ) + (1))) (_i1) ((_i1) + (1)) (((0.6) + ((0.4) * <([floor v] of ((u) / (100)) ) = [0]>)) * (_i1)) ((0.09375) * (size))\n\ndefine INTERNAL | drawBezier (x2) (y2) (x3) (y3) (qual) (dt)\nINTERNAL | bezier (((x3) - ((2) * (x2))) + (x position)) ((2) * ((x2) - (x position))) (x position) (((y3) - ((2) * (y2))) + (y position)) ((2) * ((y2) - (y position))) (y position) (qual) (dt)\ngo to x: (x3) y: (y3)\n\ndefine INTERNAL | bezier (cx1) (cx2) (x1) (cy1) (cy2) (y1) (qual) (dt)\nset [_i4 v] to [0]\nrepeat (qual)\n    change [_i4 v] by (dt)\n    go to x: (((_i4) * (((_i4) * (cx1)) + (cx2))) + (x1)) y: (((_i4) * (((_i4) * (cy1)) + (cy2))) + (y1))\nend\n\ndefine Newlines | # of Lines (lines) Size (size) Weight (w) LSpace (lspace)\nif <(w) < [0]> then\n    change [_y v] by ((lines) * (round ((((-0.65) * ((lspace) * (size))) - (size)) - ((0.125) * (size)))))\nelse\n    change [_y v] by ((lines) * (round ((((-0.65) * ((lspace) * (size))) - (size)) - ((0.125) * ((w) * (size))))))\nend\nif <<(size) = (round (size))> and <not <(w) < [0]>>> then\n    if <<((round ((0.125) * ((w) * (size)))) mod (2)) = [0]> and <not <((0.125) * ((w) * (size))) < [0.5]>>> then\n        set [_y v] to (round (_y))\n    else\n        set [_y v] to (([floor v] of (_y) ) + (0.5))\n    end\nend\n\ndefine INTERNAL | printWW (height) (width) (slant) (underline) <hasundr> (cspace) (lspace) (bezqual) (bezdt) (weight) (dotweight) (underlwt) (underloffset)\nset [_i0 v] to [1]\nset [_i1 v] to [1]\nrepeat (length of [_temp0 v])\n    set [_x v] to (item (_i0) of [_temp1 v])\n    repeat (item (_i0) of [_temp0 v])\n        INTERNAL | printChar (item (_i1) of [_temp2 v]) (height) (width) (_x) (_y) (slant) (bezqual) (bezdt) (weight) (dotweight)\n        change [_x v] by (cspace)\n        change [_i1 v] by (1)\n    end\n    change [_i1 v] by (1)\n    if <hasundr> then\n        set pen size to (underlwt)\n        go to x: ((((_x) - (cspace)) + ((slant) * (underline))) + (underloffset)) y: ((_y) + (underline))\n        pen down\n        set x to (((item (_i0) of [_temp1 v]) + ((slant) * (underline))) - (underloffset))\n        pen up\n    end\n    change [_y v] by (lspace)\n    change [_i0 v] by (1)\nend\nchange [_y v] by ((-1) * (lspace))\ndelete all of [_temp2 v]\n\ndefine INTERNAL | printText (text) (y) (height) (width) (slant) (underline) (space) (align) (bezqual) (bezdt) (weight) (dotweight) (underlwt) (underloffset)\nif <<(align) = [c]> or <(align) = [r]>> then\n    delete all of [_temp0 v]\n    set [_i0 v] to [1]\n    set [_i1 v] to [0]\n    repeat (length of (text))\n        set [_i2 v] to (letter (_i0) of (text))\n        if < [abcdefghijklmnopqrstuvwxyz] contains (_i2)?> then\n            switch costume to (_i2)\n            change [_i1 v] by (((width) * (item (costume [number v]) of [_charwidths v])) + (space))\n            add (costume [number v]) to [_temp0 v]\n        else\n            set [_i2 v] to (item # of (_i2) in [_chars v])\n            if <not <(_i2) = [0]>> then\n                change [_i1 v] by (((width) * (item (_i2) of [_charwidths v])) + (space))\n                add (_i2) to [_temp0 v]\n            end\n        end\n        change [_i0 v] by (1)\n    end\n    if <(align) = [c]> then\n        change [_x v] by ((-0.5) * ((_i1) - (space)))\n    else\n        change [_x v] by ((-1) * ((_i1) - (space)))\n    end\n    set [_i6 v] to (_x)\n    set [_i0 v] to [1]\n    repeat (length of [_temp0 v])\n        INTERNAL | printChar (item (_i0) of [_temp0 v]) (height) (width) (_x) (y) (slant) (bezqual) (bezdt) (weight) (dotweight)\n        change [_x v] by (space)\n        change [_i0 v] by (1)\n    end\nelse\n    set [_i6 v] to (_x)\n    set [_i0 v] to [1]\n    repeat (length of (text))\n        set [_i7 v] to (letter (_i0) of (text))\n        if < [abcdefghijklmnopqrstuvwxyz] contains (_i7)?> then\n            switch costume to (_i7)\n            INTERNAL | printChar (costume [number v]) (height) (width) (_x) (y) (slant) (bezqual) (bezdt) (weight) (dotweight)\n            change [_x v] by (space)\n        else\n            set [_i7 v] to (item # of (_i7) in [_chars v])\n            if <not <(_i7) = [0]>> then\n                INTERNAL | printChar (_i7) (height) (width) (_x) (y) (slant) (bezqual) (bezdt) (weight) (dotweight)\n                change [_x v] by (space)\n            end\n        end\n        change [_i0 v] by (1)\n    end\nend\nif <not <(underline) = [0]>> then\n    set pen size to (underlwt)\n    go to x: ((((_x) - (space)) + ((slant) * (underline))) + (underloffset)) y: ((y) + (underline))\n    pen down\n    set x to (((_i6) + ((slant) * (underline))) - (underloffset))\n    pen up\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nswitch costume to (sizebypass v)\nset size to (50000) %\nswitch costume to (pte ultra+ v)\n\ndefine INTERNAL | loadFont (font)\nset [_i0 v] to [1]\nrepeat until <(_i0) > (length of (font))>\n    set [_i1 v] to (letter (_i0) of (font))\n    if <[_chars v] contains (_i1)?> then\n        if < [abcdefghijklmnopqrstuvwxyz] contains (_i1)?> then\n            switch costume to (_i1)\n            set [_i4 v] to (costume [number v])\n        else\n            set [_i4 v] to (item # of (_i1) in [_chars v])\n        end\n        if < [abcdefghijklmnopqrstuvwxyz] contains (_i1)?> then\n            switch costume to (_i1)\n            if <(costume [number v]) > [27]> then\n                set [_i2 v] to (item # of (join [_] (_i1)) in [_chardata v])\n                set [_i5 v] to (item (_i2) of [_chardata v])\n                replace item (_i2) of [_chardata v] with []\n                set [_i3 v] to ((item # of (join [_] (_i1)) in [_chardata v]) + (1))\n                replace item (_i2) of [_chardata v] with (_i5)\n            else\n                set [_i3 v] to ((item # of (join [_] (_i1)) in [_chardata v]) + (1))\n            end\n        else\n            set [_i3 v] to ((item # of (join [_] (_i1)) in [_chardata v]) + (1))\n        end\n    else\n        add (_i1) to [_chars v]\n        add [0] to [_charids v]\n        add [0] to [_charwidths v]\n        add (join [_] (_i1)) to [_chardata v]\n        set [_i3 v] to ((length of [_chardata v]) + (1))\n        set [_i4 v] to (length of [_chars v])\n    end\n    add [_] to [_chardata v]\n    change [_i0 v] by (2)\n    set [_i2 v] to []\n    repeat until <(letter (_i0) of (font)) = [ ]>\n        set [_i2 v] to (join (_i2) (letter (_i0) of (font)))\n        change [_i0 v] by (1)\n    end\n    change [_i0 v] by (1)\n    replace item (_i4) of [_charwidths v] with ((1) * (_i2))\n    set [_i2 v] to []\n    repeat until <(letter (_i0) of (font)) = [ ]>\n        set [_i2 v] to (join (_i2) (letter (_i0) of (font)))\n        change [_i0 v] by (1)\n    end\n    change [_i0 v] by (1)\n    if <(letter (1) of (item (_i3) of [_chardata v])) = [_]> then\n        insert (round (_i2)) at (_i3) of [_chardata v] \n    else\n        replace item (_i3) of [_chardata v] with (round (_i2))\n    end\n    change [_i3 v] by (1)\n    repeat (round (_i2))\n        repeat (2)\n            set [_i2 v] to []\n            repeat until <(letter (_i0) of (font)) = [ ]>\n                set [_i2 v] to (join (_i2) (letter (_i0) of (font)))\n                change [_i0 v] by (1)\n            end\n            change [_i0 v] by (1)\n            if <(letter (1) of (item (_i3) of [_chardata v])) = [_]> then\n                insert ((1) * (_i2)) at (_i3) of [_chardata v] \n            else\n                replace item (_i3) of [_chardata v] with ((1) * (_i2))\n            end\n            change [_i3 v] by (1)\n        end\n        set [_i2 v] to []\n        repeat until <(letter (_i0) of (font)) = [ ]>\n            set [_i2 v] to (join (_i2) (letter (_i0) of (font)))\n            change [_i0 v] by (1)\n        end\n        change [_i0 v] by (1)\n        if <(letter (1) of (item (_i3) of [_chardata v])) = [_]> then\n            insert (round (_i2)) at (_i3) of [_chardata v] \n        else\n            replace item (_i3) of [_chardata v] with (round (_i2))\n        end\n        change [_i3 v] by (1)\n        repeat (round (_i2))\n            if <(letter (_i0) of (font)) = [b]> then\n                if <(letter (1) of (item (_i3) of [_chardata v])) = [_]> then\n                    insert [b] at (_i3) of [_chardata v] \n                else\n                    replace item (_i3) of [_chardata v] with [b]\n                end\n                change [_i3 v] by (1)\n                change [_i0 v] by (2)\n                repeat (4)\n                    set [_i2 v] to []\n                    repeat until <(letter (_i0) of (font)) = [ ]>\n                        set [_i2 v] to (join (_i2) (letter (_i0) of (font)))\n                        change [_i0 v] by (1)\n                    end\n                    change [_i0 v] by (1)\n                    if <(letter (1) of (item (_i3) of [_chardata v])) = [_]> then\n                        insert ((1) * (_i2)) at (_i3) of [_chardata v] \n                    else\n                        replace item (_i3) of [_chardata v] with ((1) * (_i2))\n                    end\n                    change [_i3 v] by (1)\n                end\n            else\n                repeat (2)\n                    set [_i2 v] to []\n                    repeat until <(letter (_i0) of (font)) = [ ]>\n                        set [_i2 v] to (join (_i2) (letter (_i0) of (font)))\n                        change [_i0 v] by (1)\n                    end\n                    change [_i0 v] by (1)\n                    if <(letter (1) of (item (_i3) of [_chardata v])) = [_]> then\n                        insert ((1) * (_i2)) at (_i3) of [_chardata v] \n                    else\n                        replace item (_i3) of [_chardata v] with ((1) * (_i2))\n                    end\n                    change [_i3 v] by (1)\n                end\n            end\n        end\n    end\n    set [_i2 v] to []\n    repeat until <(letter (_i0) of (font)) = [ ]>\n        set [_i2 v] to (join (_i2) (letter (_i0) of (font)))\n        change [_i0 v] by (1)\n    end\n    change [_i0 v] by (1)\n    if <(letter (1) of (item (_i3) of [_chardata v])) = [_]> then\n        insert (round (_i2)) at (_i3) of [_chardata v] \n    else\n        replace item (_i3) of [_chardata v] with (round (_i2))\n    end\n    change [_i3 v] by (1)\n    repeat (round (_i2))\n        repeat (2)\n            set [_i2 v] to []\n            repeat until <(letter (_i0) of (font)) = [ ]>\n                set [_i2 v] to (join (_i2) (letter (_i0) of (font)))\n                change [_i0 v] by (1)\n            end\n            change [_i0 v] by (1)\n            if <(letter (1) of (item (_i3) of [_chardata v])) = [_]> then\n                insert ((1) * (_i2)) at (_i3) of [_chardata v] \n            else\n                replace item (_i3) of [_chardata v] with ((1) * (_i2))\n            end\n            change [_i3 v] by (1)\n        end\n    end\n    delete (last) of [_chardata v]\nend\nset [_i0 v] to [1]\nrepeat (length of [_chars v])\n    set [_i1 v] to (item (_i0) of [_chars v])\n    if < [abcdefghijklmnopqrstuvwxyz] contains (_i1)?> then\n        switch costume to (_i1)\n        if <(costume [number v]) > [27]> then\n            set [_i2 v] to (item # of (join [_] (_i1)) in [_chardata v])\n            set [_i3 v] to (item (_i2) of [_chardata v])\n            replace item (_i2) of [_chardata v] with []\n            replace item (_i0) of [_charids v] with ((item # of (join [_] (_i1)) in [_chardata v]) + (2))\n            replace item (_i2) of [_chardata v] with (_i3)\n        else\n            replace item (_i0) of [_charids v] with ((item # of (join [_] (_i1)) in [_chardata v]) + (2))\n        end\n    else\n        replace item (_i0) of [_charids v] with ((item # of (join [_] (_i1)) in [_chardata v]) + (2))\n    end\n    change [_i0 v] by (1)\nend\n\ndefine Import Font | Data (font data)\nset [_i0 v] to [1]\nrepeat until <(letter (_i0) of (font data)) = [{]>\n    change [_i0 v] by (1)\nend\nchange [_i0 v] by (1)\nrepeat until <(letter (_i0) of (font data)) = [\[]>\n    change [_i0 v] by (1)\nend\nchange [_i0 v] by (1)\nset [_i1 v] to []\nrepeat until <(letter (_i0) of (font data)) = [\]]>\n    set [_i1 v] to (join (_i1) (letter (_i0) of (font data)))\n    change [_i0 v] by (1)\nend\nchange [_i0 v] by (1)\nset [_i6 v] to (_i1)\ndelete all of [_temp0 v]\nchange [_i0 v] by (1)\nrepeat until <<(letter (_i0) of (font data)) = [\[]> or <(letter (_i0) of (font data)) = [}]>>\n    change [_i0 v] by (1)\nend\nrepeat until <(letter (_i0) of (font data)) = [}]>\n    change [_i0 v] by (1)\n    delete all of [_temp1 v]\n    add (letter (_i0) of (font data)) to [_temp0 v]\n    change [_i0 v] by (2)\n    set [_i1 v] to []\n    repeat until <<<(letter (_i0) of (font data)) = [,]> or <(letter (_i0) of (font data)) = [;]>> or <(letter (_i0) of (font data)) = [\]]>>\n        set [_i1 v] to (join (_i1) (letter (_i0) of (font data)))\n        change [_i0 v] by (1)\n    end\n    add (_i1) to [_temp0 v]\n    set [_i2 v] to ((length of [_temp0 v]) + (1))\n    set [_i3 v] to [0]\n    repeat until <<(letter (_i0) of (font data)) = [\(]> or <(letter (_i0) of (font data)) = [\]]>>\n        change [_i0 v] by (1)\n    end\n    repeat until <(letter (_i0) of (font data)) = [\]]>\n        set [_i4 v] to ((length of [_temp0 v]) + (3))\n        set [_i5 v] to [0]\n        repeat until <(letter (_i0) of (font data)) = [\)]>\n            change [_i0 v] by (1)\n            if <(letter (_i0) of (font data)) = [b]> then\n                add [b] to [_temp0 v]\n                change [_i0 v] by (1)\n                repeat (4)\n                    change [_i0 v] by (1)\n                    set [_i1 v] to []\n                    repeat until <<<(letter (_i0) of (font data)) = [,]> or <(letter (_i0) of (font data)) = [;]>> or <(letter (_i0) of (font data)) = [\)]>>\n                        set [_i1 v] to (join (_i1) (letter (_i0) of (font data)))\n                        change [_i0 v] by (1)\n                    end\n                    add (_i1) to [_temp0 v]\n                end\n            else\n                change [_i0 v] by (-1)\n                repeat (2)\n                    change [_i0 v] by (1)\n                    set [_i1 v] to []\n                    repeat until <<<(letter (_i0) of (font data)) = [,]> or <(letter (_i0) of (font data)) = [;]>> or <(letter (_i0) of (font data)) = [\)]>>\n                        set [_i1 v] to (join (_i1) (letter (_i0) of (font data)))\n                        change [_i0 v] by (1)\n                    end\n                    add (_i1) to [_temp0 v]\n                end\n            end\n            change [_i5 v] by (1)\n        end\n        if <(_i5) = [1]> then\n            add (item ((length of [_temp0 v]) - (1)) of [_temp0 v]) to [_temp1 v]\n            add (item (last) of [_temp0 v]) to [_temp1 v]\n            delete (last) of [_temp0 v]\n            delete (last) of [_temp0 v]\n        else\n            insert ((_i5) - (1)) at (_i4) of [_temp0 v] \n            change [_i3 v] by (1)\n        end\n        repeat until <<(letter (_i0) of (font data)) = [\(]> or <(letter (_i0) of (font data)) = [\]]>>\n            change [_i0 v] by (1)\n        end\n    end\n    insert (_i3) at (_i2) of [_temp0 v] \n    insert (round ((length of [_temp1 v]) / (2))) at (1) of [_temp1 v] \n    repeat (length of [_temp1 v])\n        add (item (1) of [_temp1 v]) to [_temp0 v]\n        delete (1) of [_temp1 v]\n    end\n    repeat until <<(letter (_i0) of (font data)) = [\[]> or <(letter (_i0) of (font data)) = [}]>>\n        change [_i0 v] by (1)\n    end\nend\nadd [] to [_temp0 v]\nset [_i0 v] to (item # of (_i6) in [_fonts v])\nif <((_i0) mod (2)) = [1]> then\n    replace item ((_i0) + (1)) of [_fonts v] with (_temp0)\nelse\n    add (_i6) to [_fonts v]\n    add (_temp0) to [_fonts v]\nend\ndelete all of [_temp0 v]\n\ndefine Load Font | Name (font)\nset [_i0 v] to (item # of (font) in [_fonts v])\nif <((_i0) mod (2)) = [1]> then\n    INTERNAL | loadFont (item ((_i0) + (1)) of [_fonts v])\nend\n\ndefine Reset Character Data\ndelete all of [_chars v]\ndelete all of [_charids v]\ndelete all of [_charwidths v]\ndelete all of [_chardata v]\nset [_i0 v] to [1]\nrepeat (53)\n    set [_i1 v] to (letter (_i0) of [ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ])\n    add (_i1) to [_chars v]\n    add ((length of [_chardata v]) + (3)) to [_charids v]\n    add [0] to [_charwidths v]\n    add (join [_] (_i1)) to [_chardata v]\n    add [0] to [_chardata v]\n    change [_i0 v] by (1)\nend\n\ndefine INTERNAL | printChar (num) (height) (width) (x) (y) (slant) (bezqual) (bezdt) (weight) (dotweight)\nchange [_x v] by ((width) * (item (num) of [_charwidths v]))\nset [_i3 v] to (item (num) of [_charids v])\nset pen size to (weight)\nrepeat (item ((_i3) - (1)) of [_chardata v])\n    set [_i4 v] to ((height) * (item ((_i3) + (1)) of [_chardata v]))\n    go to x: ((x) + (((width) * (item (_i3) of [_chardata v])) + ((slant) * (_i4)))) y: ((y) + (_i4))\n    pen down\n    change [_i3 v] by (3)\n    repeat (item ((_i3) - (1)) of [_chardata v])\n        if <(item (_i3) of [_chardata v]) = [b]> then\n            set [_i4 v] to ((height) * (item ((_i3) + (2)) of [_chardata v]))\n            set [_i5 v] to ((height) * (item ((_i3) + (4)) of [_chardata v]))\n            INTERNAL | drawBezier ((x) + (((width) * (item ((_i3) + (1)) of [_chardata v])) + ((slant) * (_i4)))) ((y) + (_i4)) ((x) + (((width) * (item ((_i3) + (3)) of [_chardata v])) + ((slant) * (_i5)))) ((y) + (_i5)) (bezqual) (bezdt)\n            change [_i3 v] by (5)\n        else\n            set [_i4 v] to ((height) * (item ((_i3) + (1)) of [_chardata v]))\n            go to x: ((x) + (((width) * (item (_i3) of [_chardata v])) + ((slant) * (_i4)))) y: ((y) + (_i4))\n            change [_i3 v] by (2)\n        end\n    end\n    pen up\nend\nset pen size to (dotweight)\nchange [_i3 v] by (1)\nrepeat (item ((_i3) - (1)) of [_chardata v])\n    set [_i4 v] to ((height) * (item ((_i3) + (1)) of [_chardata v]))\n    go to x: ((x) + (((width) * (item (_i3) of [_chardata v])) + ((slant) * (_i4)))) y: ((y) + (_i4))\n    pen down\n    pen up\n    change [_i3 v] by (2)\nend\n\nwhen I receive [draw test v]\nif <([abs v] of ([x v] of [game v]) ) < [101]> then\n    Print | Pos (() - (CamX)) ((-150) - (CamY)) Size (20) Width (1) RGB (1) (1) (1) WSU (1) (0) (0) CSpace (0.5) Align [c] Text (join [Level: ] (Level))\n    Print | Pos (() - (CamX)) ((110) - (CamY)) Size (20) Width (1) RGB (1) (1) (1) WSU (1) (0) (0) CSpace (0.5) Align [c] Text (join [most levels complete: ] ([high score v] of [☁ score v]))\n    Print | Pos (() - (CamX)) ((70) - (CamY)) Size (20) Width (1) RGB (1) (1) (1) WSU (1) (0) (0) CSpace (0.5) Align [c] Text (join [by: ] ([player v] of [☁ score v]))\n    Print | Pos (() - (CamX)) ((40) - (CamY)) Size (10) Width (1) RGB (1) (1) (1) WSU (0) (0) (0) CSpace (1) Align [c] Text [\(press "g" to generate a new map\)]\n    Print | Pos (() - (CamX)) ((20) - (CamY)) Size (10) Width (1) RGB (1) (1) (1) WSU (0) (0) (0) CSpace (1) Align [c] Text [\(you can double jump\)]\n    Print | Pos (() - (CamX)) ((-180) - (CamY)) Size (12) Width (1) RGB (1) (1) (1) WSU (0) (0) (0) CSpace (1) Align [c] Text [press 's' to set a SEED]\nend\n\n@☁ score\n\ndefine load\nset [idx v] to [1]\nset [encoded v] to (☁ CloudScore)\ndelete all of [scores v]\ndecode\nadd (val) to [scores v]\ndecode\nadd (val) to [scores v]\n\ndefine decode\nset [val v] to []\nforever\n    set [read v] to (join (letter (idx) of (encoded)) (letter ((idx) + (1)) of (encoded)))\n    change [idx v] by (2)\n    if <(read) < [1]> then\n        stop [this script v]\n    end\n    set [val v] to (join (val) (item (read) of [disk v]))\nend\n\ndefine encode (val)\nset [idx v] to [1]\nrepeat (length of (val))\n    set [encoded v] to (join (encoded) (item # of (letter (idx) of (val)) in [disk v]))\n    change [idx v] by (1)\nend\nset [encoded v] to (join (encoded) [00])\n\nwhen I receive [update  v]\nload\nupdate\n\ndefine update\nif <(Level) > (item (2) of [scores v])> then\n    set [encoded v] to []\n    encode (username)\n    encode (Level)\n    set [☁ cloudscore v] to (encoded)\nend\nset [player v] to (item (1) of [scores v])\nset [high score v] to (item (2) of [scores v])\n\n