Grassland - Pen Platformer

Instructions: Grassland - Pen Platformer\n------------------------------------------------------------------------\nControls:\nComputer:\nLeft, right arrows - move left and right\nUp arrow - jump\nMobile:\nMove your mouse to the left to go left, to the right to go right, and up to jump.\nGet to the purple portal to finish the level!\n\nInfo:\nI've seen a few (semi)realistic pen platformers on scratch, and this is my attempt at making my own. Right now there are 3 levels, plus a fourth ending screen. It's all possible.

@Stage\n\n@Blank\n\n@Pen Platformer\n\ndefine fast rect (x1) (y1) (x2) (y2) (pen size)\nif <<<<[240] < (x1)> and <[240] < (x2)>> or <<[180] < (y1)> and <[180] < (y2)>>> or <<<(x1) < [-240]> and <(x2) < [-240]>> or <<(y1) < [-180]> and <(y2) < [-180]>>>> then\n    stop [this script v]\nend\nif <((x2) - (x1)) > ((y2) - (y1))> then\n    set [r2 v] to ((y2) - (y1))\n    set pen size to ((r2) + (pen size))\n    go to x: ((x1) + (((y2) - (y1)) / (2))) y: ((y1) + (((y2) - (y1)) / (2)))\nelse\n    set [r2 v] to ((x2) - (x1))\n    set pen size to ((r2) + (pen size))\n    go to x: ((x1) + ((r2) / (2))) y: ((y1) + ((r2) / (2)))\nend\npen down\nif <((x2) - (x1)) > ((y2) - (y1))> then\n    set x to ((x2) - (((y2) - (y1)) / (2)))\nelse\n    set y to ((y2) - (((x2) - (x1)) / (2)))\nend\nif <((x2) - (x1)) > ((y2) - (y1))> then\n    set [r v] to ((((y2) - (y1)) + (pen size)) / (2))\nelse\n    set [r v] to ((((x2) - (x1)) + (pen size)) / (2))\nend\nrepeat until <(r) < [2]>\n    set [r v] to ((r) / (3.5))\n    set pen size to ((r) + (pen size))\n    set [r2 v] to ((r) / (2))\n    go to x: ((x1) + (r2)) y: ((y2) - (r2))\n    pen down\n    set x to ((x2) - (r2))\n    set y to ((y1) + (r2))\n    set x to ((x1) + (r2))\n    set y to ((y2) - (r2))\n    pen up\nend\n\ndefine draw platforms\nset [i v] to [1]\nrepeat ((length of [platforms v]) / (6))\n    if <(item ((i) + (4)) of [platforms v]) = [1]> then\n        draw grass platform ((item (i) of [platforms v]) - (CAM X)) ((item ((i) + (2)) of [platforms v]) - (CAM Y)) ((item ((i) + (1)) of [platforms v]) - (CAM X)) ((item ((i) + (3)) of [platforms v]) - (CAM Y))\n    else\n        if <(item ((i) + (4)) of [platforms v]) = [2]> then\n            draw lava platform ((item (i) of [platforms v]) - (CAM X)) ((item ((i) + (2)) of [platforms v]) - (CAM Y)) ((item ((i) + (1)) of [platforms v]) - (CAM X)) ((item ((i) + (3)) of [platforms v]) - (CAM Y))\n        else\n            if <(item ((i) + (4)) of [platforms v]) = [3]> then\n                draw trampoline ((item (i) of [platforms v]) - (CAM X)) ((item ((i) + (2)) of [platforms v]) - (CAM Y)) ((item ((i) + (1)) of [platforms v]) - (CAM X)) ((item ((i) + (3)) of [platforms v]) - (CAM Y))\n            else\n                if <(item ((i) + (4)) of [platforms v]) = [4]> then\n                    draw water ((item (i) of [platforms v]) - (CAM X)) ((item ((i) + (2)) of [platforms v]) - (CAM Y)) ((item ((i) + (1)) of [platforms v]) - (CAM X)) ((item ((i) + (3)) of [platforms v]) - (CAM Y))\n                else\n                    if <(item ((i) + (4)) of [platforms v]) = [5]> then\n                        draw checkpoint ((item (i) of [platforms v]) - (CAM X)) ((item ((i) + (2)) of [platforms v]) - (CAM Y)) ((item ((i) + (1)) of [platforms v]) - (CAM X)) ((item ((i) + (3)) of [platforms v]) - (CAM Y))\n                    else\n                        if <(item ((i) + (4)) of [platforms v]) = [6]> then\n                            if <(item ((i) + (5)) of [platforms v]) > [0]> then\n                                draw disintegrating platform ((item (i) of [platforms v]) - (CAM X)) ((item ((i) + (2)) of [platforms v]) - (CAM Y)) ((item ((i) + (1)) of [platforms v]) - (CAM X)) ((item ((i) + (3)) of [platforms v]) - (CAM Y))\n                            end\n                        else\n                            if <(item ((i) + (4)) of [platforms v]) = [7]> then\n                                draw portal ((item (i) of [platforms v]) - (CAM X)) ((item ((i) + (2)) of [platforms v]) - (CAM Y))\n                            else\n                                draw spike ((item (i) of [platforms v]) - (CAM X)) ((item ((i) + (2)) of [platforms v]) - (CAM Y))\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [i v] by (6)\nend\nset [i v] to [1]\nrepeat ((length of [particle v]) / (4))\n    set pen size to ((item ((i) + (3)) of [particle v]) / (10))\n    set pen color to (((item ((i) + (3)) of [particle v]) * (16777216)) + (8014613))\n    go to x: ((item (i) of [particle v]) - (CAM X)) y: ((item ((i) + (1)) of [particle v]) - (CAM Y))\n    pen down\n    pen up\n    replace item (i) of [particle v] with ((item (i) of [particle v]) - (item ((i) + (2)) of [particle v]))\n    replace item ((i) + (2)) of [particle v] with ((item ((i) + (2)) of [particle v]) * (0.9))\n    replace item ((i) + (3)) of [particle v] with ((item ((i) + (3)) of [particle v]) - (12))\n    if <(item ((i) + (3)) of [particle v]) < [1]> then\n        repeat (4)\n            delete (i) of [particle v]\n        end\n    end\n    change [i v] by (4)\nend\n\ndefine tick\nfilter platforms\nset [on ground? v] to [0]\nset [start next tick? v] to [0]\nset [target x v] to (PX)\nset [target y v] to (PY)\nchange [yv v] by (-1)\nif <not <(next frame yv) = [0]>> then\n    set [yv v] to (next frame yv)\nend\nset [next frame yv v] to [0]\nchange [target y v] by (yv)\ncheck collisions [1236]\nif <(collision?) = [1]> then\n    if <(yv) < [0]> then\n        repeat until <(collision?) = [0]>\n            change [target y v] by (1)\n            check collisions [1236]\n        end\n    else\n        repeat until <(collision?) = [0]>\n            change [target y v] by (-1)\n            check collisions [1236]\n        end\n    end\n    set [yv v] to [0]\nend\nset [xv v] to ((xv) * (0.86))\nchange [target x v] by (xv)\nchange [target y v] by (-1)\ncheck collisions [123468]\nif <<<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > ((PY) - (CAM Y))>>> and <(collision?) = [1]>> then\n    set [yv v] to [14]\nend\nchange [target y v] by (1)\ncheck collisions [1236]\nif <(collision?) = [0]> then\n    if <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > ((PX) - (CAM X))>>> then\n        change [xv v] by (0.85)\n    end\n    if <<key (left arrow v) pressed?> or <<mouse down?> and <((PX) - (CAM X)) > (mouse x)>>> then\n        change [xv v] by (-0.85)\n    end\nend\nrepeat until <(collision?) = [0]>\n    change [target x v] by ((xv) * (-1.2))\n    if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > ((PY) - (CAM Y))>>> then\n        set [yv v] to [14]\n        if <(xv) < [0]> then\n            set [xv v] to [7]\n        else\n            set [xv v] to [-7]\n        end\n    else\n        set [xv v] to [0]\n    end\n    check collisions [1236]\nend\nchange [target y v] by (-1)\nif <<(PY) < [-300]> or <(start next tick?) = [1]>> then\n    start me []\nend\nif <(start next tick?) = [2]> then\n    change [level v] by (1)\n    start me [1]\nend\nif <<<([abs v] of (xv) ) > [5]> and <((round ((timer) * (1000))) mod (3)) = [0]>> and <(on ground?) = [1]>> then\n    add ((PX) - ((xv) * (4))) to [particle v]\n    add ((PY) - (18)) to [particle v]\n    add ((xv) / (2)) to [particle v]\n    add [200] to [particle v]\nend\ncheck collisions [57]\ndraw background\ndraw platforms\ndraw player\nscroll\n\ndefine start me (full reset)\nhide\nswitch costume to (2 v)\nset size to ((1) / (0)) %\nswitch costume to (1 v)\nif <(full reset) = [1]> then\n    if <(LEVEL) = [1]> then\n        set [cx v] to [-200]\n        set [cy v] to [100]\n    else\n        set [cx v] to [0]\n        set [cy v] to [0]\n    end\n    delete all of [platforms v]\n    if <(LEVEL) = [1]> then\n        add platform [100] [300] [-250] [-50] type [1] []\n        add platform [900] [950] [-200] [50] type [1] []\n        add platform [1150] [1200] [-200] [50] type [1] []\n        add platform [400] [500] [-250] [-50] type [1] []\n        add platform [-300] [0] [-250] [-50] type [1] []\n        add platform [-100] [0] [-100] [0] type [1] []\n        add platform [100] [200] [-100] [50] type [1] []\n        add platform [2] [98] [-250] [-150] type [1] []\n        add platform [302] [398] [-250] [-150] type [1] []\n        add platform [600] [900] [0] [50] type [1] []\n        add platform [1200] [1300] [-200] [50] type [1] []\n        add platform [1450] [1500] [-200] [50] type [1] []\n        add platform [952] [1148] [-200] [-50] type [1] []\n        add platform [1502] [1798] [-200] [-100] type [1] [1]\n        add platform [1800] [2000] [-200] [50] type [1] []\n        add platform [1300] [1450] [-200] [-100] type [1] [1]\n        add platform [2] [98] [-200] [-50] type [2] []\n        add platform [302] [398] [-200] [-80] type [2] []\n        add platform [952] [1148] [-100] [20] type [2] []\n        add platform [2250] [2350] [280] [300] type [6] []\n        add platform [1302] [1448] [-100] [20] type [2] []\n        add platform [890] [940] [50] [70] type [3] []\n        add platform [1502] [1798] [-100] [20] type [4] []\n        add platform [1200] [1240] [50] [110] type [5] []\n        add platform [2050] [2150] [100] [120] type [6] []\n        add platform [2250] [2350] [160] [180] type [6] []\n        add platform [2050] [2150] [220] [240] type [6] []\n        add platform [2250] [2350] [280] [300] type [6] []\n        add platform [2400] [] [400] [] type [7] []\n        add platform [-50] [] [0] [] type [8] []\n        add platform [150] [] [50] [] type [8] []\n        add platform [450] [] [-50] [] type [8] []\n        add platform [700] [] [50] [] type [8] []\n        add platform [740] [] [50] [] type [8] []\n    else\n        if <(LEVEL) = [2]> then\n            add platform [-500] [650] [-100] [-50] type [1] []\n            add platform [-100] [-50] [-80] [80] type [1] []\n            add platform [-500] [500] [60] [110] type [1] []\n            add platform [502] [520] [60] [110] type [2] []\n            add platform [570] [620] [-50] [-30] type [3] []\n            add platform [-200] [-150] [110] [130] type [3] []\n            add platform [0] [40] [110] [170] type [5] []\n            add platform [-180] [] [0] [] type [7] []\n            add platform [-250] [] [110] [] type [8] []\n            add platform [-290] [] [110] [] type [8] []\n            add platform [-330] [] [110] [] type [8] []\n            add platform [-370] [] [110] [] type [8] []\n            add platform [100] [] [-50] [] type [8] []\n            add platform [200] [] [-50] [] type [8] []\n            add platform [300] [] [-50] [] type [8] []\n            add platform [400] [] [-50] [] type [8] []\n            add platform [100] [] [110] [] type [8] []\n            add platform [200] [] [110] [] type [8] []\n            add platform [300] [] [110] [] type [8] []\n            add platform [400] [] [110] [] type [8] []\n            add platform [-250] [] [-50] [] type [8] []\n            add platform [-350] [] [-50] [] type [8] []\n        else\n            if <(LEVEL) = [3]> then\n                add platform [-100] [50] [-100] [-50] type [1] []\n                add platform [600] [700] [-100] [-50] type [1] []\n                add platform [630] [680] [180] [200] type [2] []\n                add platform [630] [680] [-50] [-30] type [3] []\n                add platform [770] [870] [-50] [0] type [1] []\n                add platform [800] [850] [230] [250] type [2] []\n                add platform [800] [850] [0] [20] type [3] []\n                add platform [940] [1040] [0] [50] type [1] []\n                add platform [970] [1020] [270] [290] type [2] []\n                add platform [970] [1020] [50] [70] type [3] []\n                add platform [1100] [1200] [250] [300] type [1] []\n                add platform [100] [560] [-70] [-50] type [6] []\n                add platform [950] [1050] [320] [340] type [6] []\n                add platform [780] [880] [320] [340] type [6] []\n                add platform [610] [710] [320] [340] type [6] []\n                add platform [500] [] [350] [] type [7] []\n            else\n                add platform [-100] [100] [-100] [-50] type [1] []\n            end\n        end\n    end\nend\nset [target x v] to (CX)\nset [target y v] to (CY)\nset [px v] to (target x)\nset [py v] to (target y)\nset [yv v] to [0]\nset [xv v] to [0]\n\ndefine scroll\nchange [px v] by (round ((target x) - (PX)))\nchange [py v] by (round ((target y) - (PY)))\nchange [cam x v] by (round (((PX) - (CAM X)) / (10)))\nchange [cam y v] by (round (((PY) - (CAM Y)) / (10)))\nbroadcast (position v)\n\nwhen I receive [start v]\nset [level v] to [1]\ndelete all of [particle v]\nstart me [1]\n\nwhen flag clicked\nchange [☁ who saw it v] by (1)\nbroadcast (start v)\nforever\n    tick\nend\n\ndefine add platform (x1) (x2) (y1) (y2) type (type) (no top)\nadd (x1) to [platforms v]\nadd (x2) to [platforms v]\nadd (y1) to [platforms v]\nadd (y2) to [platforms v]\nadd (type) to [platforms v]\nif <(no top) = [1]> then\n    add [800] to [platforms v]\nelse\n    add [769] to [platforms v]\nend\n\ndefine check collisions (platform types)\nset [collision? v] to [0]\nset [i v] to [1]\nrepeat ((length of [collisions v]) / (6))\n    if <(item ((i) + (4)) of [collisions v]) = [8]> then\n        if << (platform types) contains [8]?> and <<<(target x) > ((item (i) of [collisions v]) - (35))> and <(target x) < ((item (i) of [collisions v]) + (35))>> and <<(target y) > (item ((i) + (2)) of [collisions v])> and <(target y) < ((item ((i) + (2)) of [collisions v]) + (40))>>>> then\n            set [start next tick? v] to [1]\n        end\n    else\n        if <(item ((i) + (4)) of [collisions v]) = [7]> then\n            if <([sqrt v] of ((((item (i) of [collisions v]) - (target x)) * ((item (i) of [collisions v]) - (target x))) + (((item ((i) + (2)) of [collisions v]) - (target y)) * ((item ((i) + (2)) of [collisions v]) - (target y)))) ) < [50]> then\n                set [start next tick? v] to [2]\n            end\n        else\n            if << (platform types) contains (item ((i) + (4)) of [collisions v])?> and <<<(target x) > ((item (i) of [collisions v]) - (20))> and <(target x) < ((item ((i) + (1)) of [collisions v]) + (20))>> and <<(target y) > ((item ((i) + (2)) of [collisions v]) - (20))> and <(target y) < ((item ((i) + (3)) of [collisions v]) + (20))>>>> then\n                set [collision? v] to [1]\n                if <(item ((i) + (4)) of [collisions v]) = [1]> then\n                    set [on ground? v] to [1]\n                end\n                if <(item ((i) + (4)) of [collisions v]) = [2]> then\n                    set [start next tick? v] to [1]\n                end\n                if <(item ((i) + (4)) of [collisions v]) = [3]> then\n                    set [next frame yv v] to [21]\n                end\n                if <(item ((i) + (4)) of [collisions v]) = [4]> then\n                    set [yv v] to [-1]\n                    change [target y v] by (2)\n                    if <key (down arrow v) pressed?> then\n                        set [yv v] to [-2]\n                    end\n                end\n                if <(item ((i) + (4)) of [collisions v]) = [5]> then\n                    set [cx v] to (item (i) of [collisions v])\n                    set [cy v] to ((item ((i) + (2)) of [collisions v]) + (30))\n                end\n                if <(item ((i) + (5)) of [collisions v]) < [0]> then\n                    set [collision? v] to [0]\n                else\n                end\n            end\n        end\n    end\n    change [i v] by (6)\nend\ntest disintegrating and trampoline\n\ndefine draw grass platform (x1) (y1) (x2) (y2)\nset pen color to (#7b5014)\nif <(item ((i) + (5)) of [platforms v]) = [800]> then\n    fast rect (x1) (y1) (x2) (y2) [1]\nelse\n    fast rect (x1) (y1) (x2) ((y2) - (20)) [1]\n    set pen color to (#1db72a)\n    fast rect (x1) ((y2) - (20)) (x2) (y2) [1]\n    set pen size to (4)\n    go to x: (x1) y: (y2)\n    change x by (3)\n    repeat (((x2) - (x1)) / (9))\n        pen down\n        change y by ((15) + (letter (5) of ([sin v] of ((x1) - (x position)) )))\n        if <(letter ((((x1) - (x position)) mod (5)) + (3)) of ([sin v] of ((x1) - (x position)) )) = [6]> then\n            set pen color to (#ffee33)\n            set pen size to (14)\n            pen down\n            pen up\n            set pen color to (#f17224)\n            set pen size to (6)\n            pen down\n            pen up\n            set pen color to (#1db72a)\n            set pen size to (4)\n        end\n        if <(letter ((((x1) - (x position)) mod (5)) + (3)) of ([sin v] of ((x1) - (x position)) )) = [2]> then\n            set pen color to (#d821a7)\n            set pen size to (14)\n            pen down\n            pen up\n            set pen color to (#961673)\n            set pen size to (6)\n            pen down\n            pen up\n            set pen color to (#1db72a)\n            set pen size to (4)\n        end\n        pen up\n        change y by (((15) + (letter (5) of ([sin v] of ((x1) - (x position)) ))) * (-1))\n        change x by (9)\n    end\nend\n\ndefine draw lava platform (x1) (y1) (x2) (y2)\nset pen color to (#cc0000)\nfast rect (x1) (y1) (x2) ((y2) - ((5) + (([sin v] of ((timer) * (150)) ) * (10)))) [1]\n\ndefine draw player\nset pen color to (#ff7b00)\nfast rect ((-13) + ((PX) - (CAM X))) ((-13) + ((PY) - (CAM Y))) ((13) + ((PX) - (CAM X))) ((13) + ((PY) - (CAM Y))) [10]\nset pen color to (#e8e8e8)\nset pen size to (27)\ngo to x: ((PX) - (CAM X)) y: ((PY) - (CAM Y))\npen down\npen up\nset pen color to (#000000)\nset pen size to (10)\nif <(yv) < [-16]> then\n    go to x: (((PX) - (CAM X)) + (xv)) y: (((PY) - (CAM Y)) + (-8))\nelse\n    if <(yv) > [16]> then\n        go to x: (((PX) - (CAM X)) + (xv)) y: (((PY) - (CAM Y)) + (8))\n    else\n        go to x: (((PX) - (CAM X)) + (xv)) y: (((PY) - (CAM Y)) + ((yv) / (2)))\n    end\nend\npen down\npen up\n\ndefine draw trampoline (x1) (y1) (x2) (y2)\nset pen color to (#5d5d5d)\nset pen size to (7)\nif <(item ((i) + (5)) of [platforms v]) = [769]> then\n    go to x: (x2) y: ((y1) + (4))\n    pen down\n    go to x: (x1) y: ((y2) + (4))\n    pen up\n    go to x: (x1) y: ((y1) + (4))\n    pen down\n    go to x: (x2) y: ((y2) + (4))\n    pen up\n    set pen color to (#ffea03)\n    fast rect ((x1) - (8)) ((y2) + (7)) ((x2) + (8)) ((y2) + (20)) [6]\nelse\n    go to x: (x2) y: ((y1) + (4))\n    pen down\n    go to x: (x1) y: ((y2) + (-6))\n    pen up\n    go to x: (x1) y: ((y1) + (4))\n    pen down\n    go to x: (x2) y: ((y2) + (-6))\n    pen up\n    set pen color to (#ffea03)\n    fast rect ((x1) - (8)) ((y2) + (-3)) ((x2) + (8)) ((y2) + (10)) [6]\nend\n\ndefine draw water (x1) (y1) (x2) (y2)\nset pen color to (#1700cc)\nfast rect (x1) (y1) (x2) ((y2) - ((5) + (([sin v] of ((timer) * (150)) ) * (10)))) [1]\n\ndefine draw checkpoint (x1) (y1) (x2) (y2)\ngo to x: (x1) y: (y1)\nset pen size to (8)\nset pen color to (#8c8c8c)\npen down\nset y to (y2)\npen up\nif <<(CX) = ((x1) + (CAM X))> and <(CY) = (((y1) + (30)) + (CAM Y))>> then\n    set pen color to (#258bca)\nelse\n    set pen color to (#2927ca)\nend\nfast rect (x1) ((y1) + (30)) (x2) (y2) [6]\n\ndefine draw background\nerase all\ngo to x: (0) y: (0)\nset pen size to (1000)\nset pen color to (#66b4ff)\npen down\npen up\n\ndefine draw disintegrating platform (x1) (y1) (x2) (y2)\ngo to x: ((x1) + (10)) y: ((y2) - (10))\nrepeat (((x2) - (x1)) / (20))\n    if <(item ((i) + (5)) of [platforms v]) < [513]> then\n        set pen color to (((round ((item ((i) + (5)) of [platforms v]) / (2))) * (16777216)) + (5192992))\n    else\n        set pen color to (() + (5192992))\n    end\n    set pen size to (22)\n    pen down\n    pen up\n    if <(item ((i) + (5)) of [platforms v]) < [513]> then\n        set pen color to (((round ((item ((i) + (5)) of [platforms v]) / (2))) * (16777216)) + (7887921))\n    else\n        set pen color to (() + (7887921))\n    end\n    set pen size to (14)\n    pen down\n    pen up\n    change x by (20)\nend\n\ndefine filter platforms\ndelete all of [collisions v]\nset [i v] to [1]\nrepeat ((length of [platforms v]) / (6))\n    if <<<<[50] < ((item (i) of [platforms v]) - (PX))> and <[50] < ((item ((i) + (1)) of [platforms v]) - (PX))>> or <<[50] < ((item ((i) + (2)) of [platforms v]) - (PY))> and <[50] < ((item ((i) + (3)) of [platforms v]) - (PY))>>> or <<<((item (i) of [platforms v]) - (PX)) < [-50]> and <((item ((i) + (1)) of [platforms v]) - (PX)) < [-50]>> or <<((item ((i) + (2)) of [platforms v]) - (PY)) < [-50]> and <((item ((i) + (3)) of [platforms v]) - (PY)) < [-50]>>>> then\n    change [i v] by (6)\nend\n\ndefine test disintegrating and trampoline\nset [i2 v] to [1]\nrepeat ((length of [platforms v]) / (6))\n    if <(item ((i2) + (4)) of [platforms v]) = [3]> then\n        if <<<(target x) > ((item (i2) of [platforms v]) - (20))> and <(target x) < ((item ((i2) + (1)) of [platforms v]) + (20))>> and <<(target y) > ((item ((i2) + (2)) of [platforms v]) - (20))> and <(target y) < ((item ((i2) + (3)) of [platforms v]) + (20))>>> then\n            replace item ((i2) + (5)) of [platforms v] with [790]\n        else\n            replace item ((i2) + (5)) of [platforms v] with ((item ((i2) + (5)) of [platforms v]) - (2))\n            if <(item ((i2) + (5)) of [platforms v]) < [769]> then\n                replace item ((i2) + (5)) of [platforms v] with [769]\n            end\n        end\n    end\n    if <(item ((i2) + (4)) of [platforms v]) = [6]> then\n        if <(item ((i2) + (5)) of [platforms v]) = [769]> then\n            if <<<(target x) > ((item (i2) of [platforms v]) - (20))> and <(target x) < ((item ((i2) + (1)) of [platforms v]) + (20))>> and <<(target y) > ((item ((i2) + (2)) of [platforms v]) - (20))> and <(target y) < ((item ((i2) + (3)) of [platforms v]) + (20))>>> then\n                replace item ((i2) + (5)) of [platforms v] with [768]\n            end\n        end\n        if <(item ((i2) + (5)) of [platforms v]) < [769]> then\n            replace item ((i2) + (5)) of [platforms v] with ((item ((i2) + (5)) of [platforms v]) - (2))\n        end\n    end\n    if <(item ((i2) + (5)) of [platforms v]) < [-300]> then\n        replace item ((i2) + (5)) of [platforms v] with [769]\n    end\n    change [i2 v] by (6)\nend\n\ndefine draw portal (x) (y)\nset pen color to (#d53ed8)\nset pen size to (50)\ngo to x: (x) y: (y)\npen down\npen up\nset pen color to (() + (1692284894))\nset pen size to ((70) + (([sin v] of ((timer) * (200)) ) * (5)))\npen down\npen up\n\ndefine draw spike (x) (y)\ngo to x: (x) y: ((y) + (4))\nset pen size to (8)\nset pen color to (#ababab)\npen down\nchange y by (40)\ngo to x: ((x position) + (15)) y: ((y position) - (40))\nchange x by (-15)\nchange x by (7)\ngo to x: ((x position) + (-7.5)) y: ((y position) - (-40))\nset pen color to (#828282)\ngo to x: ((x position) + (-15)) y: ((y position) - (40))\nchange x by (15)\nchange x by (-7)\ngo to x: ((x position) + (7.5)) y: ((y position) - (-40))\nset pen size to (7)\nchange y by (-40)\npen up\n\n@Thumbnail\n\nwhen I receive [position v]\nset [ghost v] effect to (100)\n\n