Getting Over It A Platformer

Instructions: Use arrow keys or WASD to move and jump.\n\n\nThe leader board is broken, you can't set a time\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\npog\n\n

@Stage\n\nwhen I receive [position level v]\nbright (round ((315) - ((CAMERA Y) / (30))))\n\ndefine bright (level)\nif <not <(level) = (BRIGHT)>> then\n    set [bright v] to (level)\n    set [brightness v] effect to (level)\nend\n\n@Blank\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\n@Player\n\nwhen I receive [tick player v]\nif <<key (w v) pressed?> and <(username) = [griffpatch]>> then\n    set [player sx v] to ((mouse x) / (7))\n    set [player sy v] to ((mouse y) / (7))\nend\ntick\nt = Get Scroll (((PLAYER X) + (cox)) - (_camera x)) [1500] [40]\nchange [_camera x v] by (t)\nt = Get Scroll (((PLAYER Y) + (coy)) - (_camera y)) [1500] [40]\nchange [_camera y v] by (t)\nset [camera x v] to (round (_camera x))\nset [camera y v] to (round (_camera y))\nif <(CAMERA Y) < [0]> then\n    set [camera y v] to [0]\nend\nswitch costume to (big v)\ngo to x: ((PLAYER X) - (CAMERA X)) y: ((PLAYER Y) - (CAMERA Y))\nswitch costume to (player v)\n\ndefine tick\nset [lasthx v] to (HAMMER X)\nset [lasthy v] to (HAMMER Y)\nset [sensepx v] to []\nGravity\nif <(PLAYER X) < [-1000]> then\n    set [player x v] to [-1000]\nend\nif <(PLAYER X) > [5480]> then\n    set [player x v] to [5480]\nend\nif <(PLAYER SY) < [-64]> then\n    set [player sy v] to [-64]\nend\nposition\nset [tx v] to ((0.4) * ((mouse x) - ((HAMMER X) - ((PLAYER X) + (cox)))))\nset [ty v] to ((0.4) * ((mouse y) - ((HAMMER Y) - ((PLAYER Y) + (coy)))))\nset [touch x v] to ((touch x) * (0.85))\nset [touch y v] to ((touch y) * (0.85))\nset [last mouse x v] to (mouse x)\nset [last mouse y v] to (mouse y)\ndistance ((tx) - (last tx)) ((ty) - (last ty))\nif <(distance) > [40]> then\n    set [tx v] to ((((tx) - (last tx)) / ((distance) / (40))) + (last tx))\n    set [ty v] to ((((ty) - (last ty)) / ((distance) / (40))) + (last ty))\nend\nset [effort v] to (distance)\nset [last tx v] to (tx)\nset [last ty v] to (ty)\ndistance (tx) (ty)\nif <(distance) > [50]> then\n    set [tx v] to ((tx) / ((distance) / (50)))\n    set [ty v] to ((ty) / ((distance) / (50)))\nend\nExtent (((HAMMER X) + (tx)) - (PLAYER X)) (((HAMMER Y) + (ty)) - (PLAYER Y))\ndistance (tx) (ty)\nset [t v] to (distance)\ndistance ((PLAYER SX) + (tx)) ((PLAYER SY) + (ty))\nif <(t) > (distance)> then\n    set [distance v] to (t)\nend\nif <(distance) < [1]> then\n    set [distance v] to [1]\nelse\n    set [distance v] to ([ceiling v] of (distance) )\nend\nset [dx v] to ((PLAYER SX) / (distance))\nset [dy v] to ((PLAYER SY) / (distance))\nset [hvy v] to ((PLAYER SY) + (ty))\nmove hammer ((tx) / (distance)) ((ty) / (distance)) (distance)\ndistance ((HAMMER X) - (lastHx)) ((HAMMER Y) - (lastHy))\nset [last h dist v] to (distance)\n\ndefine position\ngo to x: ((PLAYER X) - (CAMERA X)) y: ((PLAYER Y) - (CAMERA Y))\n\ndefine distance (dx) (dy)\nset [distance v] to ([sqrt v] of (((dx) * (dx)) + ((dy) * (dy))) )\n\ndefine touch = touching <player?> <hammer?>\nif <hammer?> then\n    if <<(round (HAMMER X)) = (sameHX)> and <(round (HAMMER Y)) = (sameHY)>> then\n    if <touching (level v)?> then\n        set [touch v] to [1]\n        stop [this script v]\n    end\nend\nif <player?> then\n    if <<(round (PLAYER X)) = (sensePX)> and <(round (PLAYER Y)) = (sensePY)>> then\n    if <(sensePV) = [true]> then\n        set [touch v] to [2]\n        stop [this script v]\n    end\nend\nset [touch v] to [0]\n\nwhen I receive [fix collisions v]\nfix player\nfix hammer\n\ndefine Extent (dx) (dy)\ndistance (dx) (dy)\nif <(distance) > (MAX LEN)> then\n    change [tx v] by ((((dx) / (distance)) * (MAX LEN)) - (dx))\n    change [ty v] by ((((dy) / (distance)) * (MAX LEN)) - (dy))\nend\nif <(distance) < (MIN LEN)> then\n    change [tx v] by ((((dx) / (distance)) * (MIN LEN)) - (dx))\n    change [ty v] by ((((dy) / (distance)) * (MIN LEN)) - (dy))\nend\n\ndefine move hammer (dx) (dy) (distance)\nset [ox v] to (PLAYER X)\nset [oy v] to (PLAYER Y)\nif <(last h dist) < [3]> then\n    set [tx v] to (HAMMER X)\n    set [ty v] to (HAMMER Y)\n    hammer wall? ((dx) + ((PLAYER SX) / (distance))) ((dy) + ((PLAYER SY) / (distance)))\n    set [hammer x v] to (tx)\n    set [hammer y v] to (ty)\nelse\n    set [touch v] to [0]\nend\nif <(touch) > [0]> then\n    move player next ((-0.5) * (dx)) ((-0.5) * (dy))\nelse\n    move hammer first (dx) (dy) (PLAYER SX) (PLAYER SY)\nend\nif <<(PLAYER Y) < [-43]> and <not <(oy) < [-43]>>> then\n    start sound [Small_Splash_Audio v]\nend\n\ndefine momentum (dx) (dy)\ndistance ((HAMMER X) - (PLAYER X)) ((HAMMER Y) - (PLAYER Y))\nset [t v] to (((HAMMER Y) - (PLAYER Y)) / (distance))\nif <(t) < [-0.75]> then\n    change [player sx v] by ((1) * ((dx) - (PLAYER SX)))\n    change [player sy v] by ((1) * ((dy) - (PLAYER SY)))\nelse\n    change [player sx v] by ((0.77) * ((dx) - (PLAYER SX)))\n    change [player sy v] by ((0.77) * ((dy) - (PLAYER SY)))\nend\n\ndefine move player next (dx) (dy)\n\n    change [ox v] by ((0.5) * ((PLAYER X) - (ox)))\n    change [ox v] by ((0.5) * ((PLAYER Y) - (oy)))\nend\nif <(HAMMER AIR) > [0]> then\n    set [touch x v] to (() - ((mouse x) - ((HAMMER X) - (PLAYER X))))\n    set [touch y v] to (() - ((mouse y) - ((HAMMER Y) - (PLAYER Y))))\n    set [hammer air v] to [0]\nend\nrepeat (distance)\n    set [tx v] to (PLAYER X)\n    set [ty v] to (PLAYER Y)\n    change [player x v] by (dx)\n    change [player x v] by (dx)\n    touch = touching  <>\n    if <(touch) > [0]> then\n        set [player x v] to (tx)\n        set [player sx v] to [0]\n        set [dx v] to [0]\n    end\n    change [player y v] by (dy)\n    change [player y v] by (dy)\n    touch = touching  <>\n    if <(touch) > [0]> then\n        set [player y v] to (ty)\n        set [player sy v] to [0]\n        set [dy v] to [0]\n    end\n    \n        set [tx v] to (HAMMER X)\n        set [ty v] to (HAMMER Y)\n        change [hammer x v] by (dx)\n        change [hammer y v] by (dy)\n        touch = touching <> \n        if <(touch) > [0]> then\n            set [hammer x v] to (tx)\n            set [hammer y v] to (ty)\n        end\n    end\nend\nmomentum ((0.55) * ((PLAYER X) - (ox))) (((0.55) * ((PLAYER Y) - (oy))) + (0))\n\ndefine move hammer first (dx) (dy) (lpsx) (lpsy)\nrepeat until <(distance) < [1]>\n    hammer tick (dx) (dy) (HAMMER X) (HAMMER Y) (lpsx) (lpsy)\n    change [distance v] by (-1)\nend\nchange [hammer air v] by (1)\n\ndefine fix player\ntouch = touching  <>\nif <(touch) = [0]> then\n    stop [this script v]\nend\nset [t v] to [1]\nrepeat (8)\n    change [player x v] by (item (t) of [fix v])\n    change [t v] by (1)\n    change [player y v] by (item (t) of [fix v])\n    change [t v] by (1)\n    touch = touching  <>\n    if <(touch) = [0]> then\n        stop [this script v]\n    end\nend\nchange [player x v] by (item (t) of [fix v])\nchange [t v] by (1)\nchange [player y v] by (item (t) of [fix v])\nset [t v] to [1]\nrepeat (8)\n    change [player x v] by ((item (t) of [fix v]) * (2))\n    change [t v] by (1)\n    change [player y v] by ((item (t) of [fix v]) * (2))\n    change [t v] by (1)\n    touch = touching  <>\n    if <(touch) = [0]> then\n        stop [this script v]\n    end\nend\nchange [player x v] by ((item (t) of [fix v]) * (2))\nchange [t v] by (1)\nchange [player y v] by (((item (t) of [fix v]) * (2)) - (1))\n\ndefine fix hammer\ntouch = touching <> \nif <(touch) = [0]> then\n    stop [this script v]\nend\nset [t v] to [1]\nrepeat (8)\n    change [hammer x v] by (item (t) of [fix v])\n    change [t v] by (1)\n    change [hammer y v] by (item (t) of [fix v])\n    change [t v] by (1)\n    touch = touching <> \n    if <(touch) = [0]> then\n        stop [this script v]\n    end\nend\nchange [hammer x v] by (item (t) of [fix v])\nchange [t v] by (1)\nchange [hammer y v] by ((item (t) of [fix v]) - (1))\nset [t v] to [1]\nrepeat (8)\n    change [hammer x v] by ((item (t) of [fix v]) * (2))\n    change [t v] by (1)\n    change [hammer y v] by ((item (t) of [fix v]) * (2))\n    change [t v] by (1)\n    touch = touching <> \n    if <(touch) = [0]> then\n        stop [this script v]\n    end\nend\nchange [hammer x v] by ((item (t) of [fix v]) * (2))\nchange [t v] by (1)\nchange [hammer y v] by (((item (t) of [fix v]) * (2)) - (1))\n\ndefine hammer wall? (dx) (dy)\nset [t v] to ([sqrt v] of (((dx) * (dx)) + ((dy) * (dy))) )\nif <([abs v] of ((dx) / (t)) ) > [0.2]> then\n    change [hammer x v] by ((dx) / ([abs v] of (dx) ))\nend\nif <([abs v] of ((dy) / (t)) ) > [0.2]> then\n    change [hammer y v] by ((dy) / ([abs v] of (dy) ))\nend\ntouch = touching <> \nif <(touch) > [0]> then\n    if <<(effort) > [17]> and <(lastEffort) < [18]>> then\n        if <([abs v] of ((HAMMER X) - (PLAYER X)) ) > [40]> then\n            start sound (join [whu] (pick random (1) to (6)))\n        else\n            start sound (join [jump] (pick random (1) to (5)))\n        end\n        set [lasteffort v] to (effort)\n    end\nelse\n    if <(effort) < [5]> then\n        set [lasteffort v] to [0]\n    end\nend\n\ndefine t = Get Scroll (d) (divide) (cap)\nif <([abs v] of (d) ) > [3]> then\n    set [tx v] to ((([abs v] of (d) ) + (25)) / (divide))\n    if <(tx) > [1]> then\n        set [t v] to ((d) * (1))\n    else\n        set [t v] to ((d) * (tx))\n    end\n    if <([abs v] of (t) ) > (cap)> then\n        set [t v] to ((cap) * ((t) / ([abs v] of (t) )))\n    end\n    set [t v] to ((cap) * ([sin v] of ((([abs v] of (t) ) / (cap)) * (90)) ))\n    if <(d) < [0]> then\n        set [t v] to ((0) - (t))\n    end\nelse\n    set [t v] to [0]\nend\n\ndefine hammer tick (dx) (dy) (hx) (hy) (lpsx) (lpsy)\nset [tx v] to (HAMMER X)\nset [ty v] to (HAMMER Y)\nchange [hammer x v] by (dx)\nchange [hammer y v] by (dy)\nchange [hammer x v] by (dx)\nchange [hammer y v] by (dy)\nset [ax v] to [0]\ntouch = touching <> \nif <(touch) > [0]> then\n    change [hammer x v] by (-1)\n    touch = touching <> \n    if <(touch) > [0]> then\n        change [hammer x v] by (2)\n        touch = touching <> \n        if <(touch) > [0]> then\n            last contact\n            if <(effort) > [10]> then\n                if <(FRAME) > (last touch)> then\n                    start sound (join [hardhit_fabricb_] (pick random (1) to (4)))\n                    set [last touch v] to ((FRAME) + (5))\n                end\n            else\n                if <(effort) > [2]> then\n                    if <(FRAME) > (last touch)> then\n                        start sound (join [hit_fabricb_] (pick random (1) to (5)))\n                        set [last touch v] to ((FRAME) + (5))\n                    end\n                end\n            end\n            if <<(PLAYER SY) < [-16]> and <(hvy) < [-0.5]>> then\n                Hammer Impact\n            end\n            set [hammer x v] to (tx)\n            set [hammer y v] to (ty)\n        else\n            if <(hvy) < [-5]> then\n                set [ax v] to [1]\n                change [player sx v] by ((0.5) / (distance))\n                change [distance v] by (-1)\n            end\n        end\n    else\n        if <(hvy) < [-5]> then\n            set [ax v] to [-1]\n            change [player sx v] by ((-0.5) / (distance))\n            change [distance v] by (-1)\n        end\n    end\nend\nset [tx v] to (PLAYER X)\nset [ty v] to (PLAYER Y)\nchange [player x v] by ((dx) + (ax))\nchange [player y v] by (dy)\ntouch = touching  <>\nif <(touch) = [0]> then\n    stop [this script v]\nend\nchange [player x v] by (-1)\ntouch = touching  <>\nif <(touch) = [0]> then\n    change [player sy v] by ((-0.7) * ((PLAYER SY) / ([abs v] of (PLAYER SY) )))\n    if <([abs v] of (PLAYER SY) ) > ((0) - (PLAYER SX))> then\n        change [player sx v] by (-0.7)\n    end\n    change [distance v] by (-1)\n    stop [this script v]\nend\nchange [player x v] by (2)\ntouch = touching  <>\nif <(touch) = [0]> then\n    change [player sy v] by ((-0.7) * ((PLAYER SY) / ([abs v] of (PLAYER SY) )))\n    if <([abs v] of (PLAYER SY) ) > (PLAYER SX)> then\n        change [player sx v] by (0.7)\n    end\n    change [distance v] by (-1)\n    stop [this script v]\nend\nchange [player x v] by (-1)\nset [player y v] to (round (ty))\nset [d2 v] to ([sqrt v] of (((lpsx) * (lpsx)) + ((lpsy) * (lpsy))) )\nif <<((lpsy) / (d2)) < [-0.7]> and <(lpsy) < [-4]>> then\n    start sound (join [newclunk] (pick random (1) to (5)))\n    set [player sx v] to ((PLAYER SX) * (0.7))\n    set [player sy v] to ([abs v] of ((lpsy) * (0.2)) )\n    set [distance v] to [-1]\n    stop [this script v]\nelse\n    if <([sqrt v] of (((lpsx) * (lpsx)) + ((lpsy) * (lpsy))) ) > [6]> then\n        start sound (join [newscrape] (pick random (1) to (5)))\n    end\nend\ntouch = touching  <>\nset [d2 v] to ([sqrt v] of (((lpsx) * (lpsx)) + ((lpsy) * (lpsy))) )\nif <(touch) > [0]> then\n    last contact\n    set [player x v] to (tx)\n    set [player sx v] to [0]\n    set [player sy v] to [0]\n    set [distance v] to [-1]\n    stop [this script v]\nelse\n    change [distance v] by (-0.7)\n    if <(d2) < [1]> then\n        set [player sx v] to ((PLAYER SX) * (0.5))\n        set [player sy v] to ((PLAYER SY) * (0.5))\n        last contact\n    else\n        set [t v] to (([abs v] of (PLAYER SX) ) / (d2))\n        set [player sx v] to ((PLAYER SX) * ((0.3) + ((t) * (0.7))))\n        if <<((lpsx) / (d2)) < [-0.7]> and <(lpsy) < [-4]>> then\n            set [player sy v] to ([abs v] of ((PLAYER SY) * (0.2)) )\n            set [player sx v] to ((PLAYER SX) * (0.5))\n            set [distance v] to [1]\n        else\n            set [player sy v] to ((PLAYER SY) * (0.5))\n            last contact\n        end\n    end\nend\n\nwhen [x v] key pressed\ndelete all of [debug v]\n\n    add [bang] to [debug v]\n    add [static] to [debug v]\n    add (t) to [debug v]\n    change [player x v] by (-3)\n    if <(PLAYER SX) < [0]> then\n        touch = touching  <>\n    end\n    if <(touch) > [0]> then\n        change [player x v] by (4)\n        if <(PLAYER SX) > [0]> then\n            touch = touching  <>\n        end\n        if <(touch) > [0]> then\n            set [player y v] to (ty)\n            touch = touching  <>\n            if <(touch) > [0]> then\n                set [player x v] to (tx)\n                set [player sx v] to [0]\n                set [player sy v] to [0]\n                set [dx v] to [0]\n                set [dy v] to [0]\n            else\n                \n                set [player sx v] to ((PLAYER SX) * (0.5))\n                set [player sy v] to ((PLAYER SY) * (0.5))\n                set [distance v] to (round ((distance) * (0.7)))\n            end\n        end\n    end\nend\n\nwhen I receive [new game v]\nforever\n    Game Loop\nend\n\ndefine Gravity\nif <(PLAYER Y) > [16000]> then\n    set [player sx v] to ((PLAYER SX) * (0.99))\n    if <(PLAYER SY) > [4]> then\n        set [player sy v] to ((PLAYER SY) * (0.99))\n    end\n    stop [this script v]\nend\nif <(PLAYER Y) < [11990]> then\n    change [player sy v] by (-1.3)\n    stop [this script v]\nend\nset [t v] to [1]\nset [tx v] to [99999]\nset [ty v] to [0]\nrepeat ((length of [planet v]) / (2))\n    set [dx v] to ((item (t) of [planet v]) - (PLAYER X))\n    set [dy v] to ((item ((t) + (1)) of [planet v]) - (PLAYER Y))\n    distance (dx) (dy)\n    if <(distance) < (tx)> then\n        set [tx v] to (distance)\n        set [ty v] to (t)\n    end\n    change [t v] by (2)\nend\nset [dx v] to ((item (ty) of [planet v]) - (PLAYER X))\nset [dy v] to ((item ((ty) + (1)) of [planet v]) - (PLAYER Y))\nset [distance v] to (((tx) * (tx)) / (12))\nchange [player sx v] by ((dx) / (distance))\nchange [player sy v] by ((dy) / (distance))\ndistance (PLAYER SX) (PLAYER SY)\nif <(distance) > [15]> then\n    set [distance v] to ((distance) / (15))\n    change [player sx v] by ((((PLAYER SX) / (distance)) - (PLAYER SX)) * (0.3))\n    change [player sy v] by ((((PLAYER SY) / (distance)) - (PLAYER SY)) * (0.3))\nend\nset [player sx v] to ((PLAYER SX) * (0.99))\nif <(PLAYER Y) < [15000]> then\n    set [player sy v] to ((PLAYER SY) * (0.99))\nend\n\nwhen [g v] key pressed\n\n    add ((CAMERA X) + (mouse x)) to [planet v]\n    add ((CAMERA Y) + (mouse y)) to [planet v]\nend\n\ndefine Game Loop\nif <(SFX) = [true]> then\n    set [pitch v] effect to (50)\n    set volume to (50) %\nelse\n    set volume to (0) %\nend\nset size to (100) %\nshow\nset [bright v] to [-999]\nset [frame v] to [0]\nset [max len v] to [102]\nset [min len v] to [26]\nset [player x v] to [0]\nset [player y v] to [100]\nset [contact y v] to (PLAYER Y)\nset [hammer x v] to (PLAYER X)\nset [hammer y v] to (PLAYER Y)\nset [player sx v] to [0]\nset [player sy v] to [0]\nset [_camera x v] to (PLAYER X)\nset [_camera y v] to (PLAYER Y)\nset [camera x v] to (PLAYER X)\nset [camera y v] to (PLAYER Y)\nset [hammer air v] to [100]\nset [cox v] to [0]\nset [coy v] to [20]\nset [last touch v] to [0]\ndelete all of [time v]\nbroadcast (Show v)\nbroadcast (Position Level v)\nrepeat until <<(PLAYER Y) > [16000]> or <(PLAYER Y) < [-180]>>\n    change [frame v] by (1)\n    Timer\n    All Broadcast Ticks\n    if <key (p v) pressed?> then\n        wait until <not <key (p v) pressed?>>\n        repeat until <key (p v) pressed?>\n            wait (0) seconds\n        end\n        wait until <not <key (p v) pressed?>>\n    end\n    if <<key (q v) pressed?> and <key (r v) pressed?>> then\n        broadcast (white out v)\n        repeat (10)\n            set [player sx v] to [0]\n            set [player sy v] to [-1]\n            All Broadcast Ticks\n        end\n        stop [this script v]\n    end\nend\nif <(PLAYER Y) < [-180]> then\n    hide\n    broadcast (out of bounds v)\n    repeat until <(CAMERA Y) < [10]>\n        set [player sx v] to [0]\n        set [player sy v] to [-1]\n        All Broadcast Ticks\n    end\n    repeat (20)\n        set [player sx v] to [0]\n        set [player sy v] to [-1]\n        All Broadcast Ticks\n    end\n    broadcast (white out v)\n    broadcast (head v)\n    repeat (10)\n        set [player sx v] to [0]\n        set [player sy v] to [-1]\n        All Broadcast Ticks\n    end\n    stop [this script v]\nend\nbroadcast (SAVE TIME TO CLOUD v)\nforever\n    All Broadcast Ticks\nend\n\ndefine All Broadcast Ticks\nbroadcast (centre v)\nbroadcast (Fix Collisions v)\nbroadcast (Swing Hammer v)\nbroadcast (Tick Player v)\nbroadcast (Position Level v)\nbroadcast (Position Limbs v)\n\nif <(touch) > [0]> then\n    change [hammer x v] by (2)\n    touch = touching <> \n    if <(touch) > [0]> then\n        set [hammer y v] to (ty)\n        if <(last h dist) > [5]> then\n    else\n        if <(hvy) < [-5]> then\n            set [ax v] to [1]\n            change [player sx v] by ((0.5) / (distance))\n            change [distance v] by (-1)\n        end\n    end\nelse\n    if <(hvy) < [-5]> then\n        set [ax v] to [-1]\n        change [player sx v] by ((-0.5) / (distance))\n        change [distance v] by (-1)\n    end\nend\n\nwhen I receive [centre v]\nset [camera x v] to (round (PLAYER X))\nset [camera y v] to (round (PLAYER Y))\n\ndefine Hammer Impact\nchange [hammer x v] by (2)\nif <(PLAYER SX) > [-2]> then\n    touch = touching <> \n    if <(touch) = [0]> then\n        change [debug v] by (1)\n        if <(hvy) < [-8]> then\n            change [player sx v] by ((-8) * (-0.3))\n        else\n            change [player sx v] by ((hvy) * (-0.3))\n        end\n        set [player sy v] to ((0.3) * ((PLAYER SY) / ([abs v] of (PLAYER SY) )))\n        set [distance v] to [-1]\n        if <(FRAME) > (last touch)> then\n            start sound (join [scrape_plastic_] (pick random (1) to (4)))\n            set [last touch v] to ((FRAME) + (5))\n        end\n        stop [this script v]\n    end\nend\nchange [hammer x v] by (-6)\nif <(PLAYER SX) < [2]> then\n    touch = touching <> \n    if <(touch) = [0]> then\n        change [debug v] by (1)\n        if <(hvy) < [-8]> then\n            change [player sx v] by ((-8) * (0.3))\n        else\n            change [player sx v] by ((hvy) * (0.3))\n        end\n        set [player sy v] to ((0.3) * ((PLAYER SY) / ([abs v] of (PLAYER SY) )))\n        set [distance v] to [-1]\n        if <(FRAME) > (last touch)> then\n            start sound (join [scrape_plastic_] (pick random (1) to (4)))\n            set [last touch v] to ((FRAME) + (5))\n        end\n        stop [this script v]\n    end\nend\n\ndefine Timer\ndelete all of [time v]\nset [t v] to ([floor v] of ((FRAME) / (30)) )\nif <(t) > [35999]> then\n    set [t v] to [35999]\nend\nset [tx v] to ((t) mod (60))\nset [t v] to ([floor v] of ((t) / (60)) )\nif <(tx) < [10]> then\n    add (letter (1) of (tx)) to [time v]\n    add [0] to [time v]\nelse\n    add (letter (2) of (tx)) to [time v]\n    add (letter (1) of (tx)) to [time v]\nend\nset [tx v] to ((t) mod (60))\nset [t v] to ([floor v] of ((t) / (60)) )\nif <(tx) < [10]> then\n    add (letter (1) of (tx)) to [time v]\n    if <(t) > [0]> then\n        add [0] to [time v]\n    end\nelse\n    add (letter (2) of (tx)) to [time v]\n    add (letter (1) of (tx)) to [time v]\nend\nset [tx v] to ((t) mod (60))\nif <(t) > [0]> then\n    add (letter (1) of (tx)) to [time v]\nend\n\ndefine last contact\nif <(PLAYER Y) < ((Contact Y) - (650))> then\n    if <([talking v] of [narrator v]) = [0]> then\n        broadcast (Fall v)\n    end\nend\nset [contact y v] to (PLAYER Y)\n\nwhen I receive [load high score v]\nset [frame v] to (☁ FASTEST)\nTimer\n\nset [frame v] to [20281]\nTimer\n\nwhen I receive [new game v]\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [player sx v] by (2.5)\n        if <(PLAYER SX) > [15]> then\n            set [player sx v] to [15]\n        end\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [player sx v] by (-2.5)\n        if <(PLAYER SX) < [-15]> then\n            set [player sx v] to [-15]\n        end\n    end\n    if <not <(PLAYER SX) = [0]>> then\n        if <<not <<key (right arrow v) pressed?> or <key (d v) pressed?>>> and <not <<key (left arrow v) pressed?> or <key (a v) pressed?>>>> then\n            if <(PLAYER SX) > [0]> then\n                change [player sx v] by (-.5)\n            else\n                change [player sx v] by (.5)\n            end\n        end\n    end\nend\n\nwhen I receive [new game v]\nforever\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        change [player sy v] by (23)\n        wait (.10) seconds\n        wait until <(touch) = [2]>\n    end\nend\n\n@limbs\n\nwhen I receive [position level v]\n\nswitch costume to (big v)\ngo to x: ((item (type) of [hands v]) - (item ((type) + (2)) of [hands v])) y: ((item (type) of [hands y v]) - (item ((type) + (2)) of [hands y v]))\npoint towards (blank v)\nset [flip v] to <(y position) > [0]>\nset [a v] to (distance to [blank v])\ngo to x: (item (type) of [hands v]) y: (item (type) of [hands y v])\nset [a v] to ((11) - ([floor v] of ((a) / (4)) ))\nif <(a) < [1]> then\n    set [a v] to [1]\nend\nif <<(type) > [3]> = (flip)> then\n    change [a v] by (11)\nend\nswitch costume to (a)\n\nwhen I receive [new game v]\nhide\n\nset [type v] to [4]\nwait (0.1) seconds\ngo to [front v] layer\ngo [backward v] (1) layers\nshow\ncreate clone of (_myself_ v)\nset [type v] to [1]\n\nwhen I receive [out of bounds v]\n\nhide\n\nwhen I receive [show v]\n\nshow\n\n@Head\n\nwhen I receive [position level v]\nswitch costume to (big v)\ngo to (player v)\nchange y by (4)\npoint towards (mouse-pointer v)\npoint in direction (((([abs v] of (direction) ) - (90)) * (0.5)) + (90))\nif <(mouse x) < [0]> then\n    point in direction ((0) - (direction))\n    switch costume to (left v)\nelse\n    switch costume to (right v)\nend\nif <(timer) > (blink time)> then\n    switch costume to ((costume [number v]) + (2))\n    if <(timer) > ((blink time) + (0.03))> then\n        Set Blink\n    end\nelse\n    if <([abs v] of (mouse x) ) < [64]> then\n        next costume\n    end\nend\n\nwhen I receive [out of bounds v]\nhide\n\nwhen I receive [new game v]\nshow\nSet Blink\n\nwhen I receive [show v]\nshow\n\ndefine Set Blink\nset [blink time v] to ((timer) + (pick random (0.8) to (7)))\n\nwhen I receive [head v]\nif <(head) > [0]> then\n    change [head v] by (-1)\nelse\n    set size to ((1.2) * (size)) %\nend\n\nwhen flag clicked\nset [head v] to [3]\nset size to (100) %\n\ngo to [front v] layer\n\n@Level\n\nwhen I receive [position level v]\nposition it\nset [t v] to (join (lx) (join [x] (join (ly) [x])))\nif <not <(costume) = (t)>> then\n    set [costume v] to (t)\n    switch costume to (costume)\n    if <(costume) = (costume [name v])> then\n        show\n    else\n        hide\n    end\nend\n\ndefine position (x) (y)\nif <(x) < [-464]> then\n    change [lx v] by (2)\n    position it\nelse\n    if <(x) > [464]> then\n        change [lx v] by (-2)\n        position it\n    else\n        if <(y) < [-344]> then\n            change [ly v] by (2)\n            position it\n        else\n            if <(y) > [344]> then\n                change [ly v] by (-2)\n                position it\n            else\n                go to x: (x) y: (y)\n            end\n        end\n    end\nend\n\ndefine position it\nposition (((lx) * (464)) - (CAMERA X)) (((ly) * (344)) - (CAMERA Y))\n\nwhen [p v] key pressed\nset [costume v] to []\n\nwhen I receive [new game v]\nset size to (100) %\nset [costume v] to []\nset [lx v] to [0]\nset [ly v] to [0]\ncreate clone of (_myself_ v)\nset [lx v] to [1]\ncreate clone of (_myself_ v)\nset [ly v] to [1]\ncreate clone of (_myself_ v)\nset [lx v] to [0]\n\nwhen I receive [centre v]\nposition it\nset [t v] to (join (lx) (join [x] (join (ly) [x])))\nif <not <(costume) = (t)>> then\n    set [costume v] to (t)\n    switch costume to (costume)\n    if <(costume) = (costume [name v])> then\n        show\n    else\n        hide\n    end\nend\n\n@Background\n\ndefine position it\nposition (((lx) * (448)) - ((CAMERA X) / (1.5))) (((ly) * (308)) - ((CAMERA Y) / (1.5)))\n\nwhen I receive [position level v]\nposition it\n\ndefine position (x) (y)\nif <(x) < [-448]> then\n    change [lx v] by (2)\n    position it\nelse\n    if <(x) > [448]> then\n        change [lx v] by (-2)\n        position it\n    else\n        if <(y) < [-308]> then\n            change [ly v] by (2)\n            position it\n        else\n            if <(y) > [308]> then\n                change [ly v] by (-2)\n                position it\n            else\n                go to x: (x) y: (y)\n            end\n        end\n    end\nend\n\nwhen I receive [new game v]\ngo to [back v] layer\nswitch costume to (background3 v)\nset [brightness v] effect to (0)\ngo to x: (0) y: (0)\nset [costume v] to []\nset [lx v] to [0]\nset [ly v] to [0]\ncreate clone of (_myself_ v)\nset [lx v] to [1]\ncreate clone of (_myself_ v)\nset [ly v] to [1]\ncreate clone of (_myself_ v)\nset [lx v] to [0]\n\n@Comment\n\nwhen I receive [position level v]\nposition it\nset [t v] to (join [] (join (lx) (join [x] (ly))))\nif <not <(costume) = (t)>> then\n    set [costume v] to (t)\n    switch costume to (costume)\n    if <(costume) = (costume [name v])> then\n        show\n        position it\n    else\n        hide\n    end\nend\n\ndefine position (x) (y)\nif <(x) < [-464]> then\n    change [lx v] by (2)\n    position it\nelse\n    if <(x) > [464]> then\n        change [lx v] by (-2)\n        position it\n    else\n        if <(y) < [-344]> then\n            change [ly v] by (2)\n            position it\n        else\n            if <(y) > [344]> then\n                change [ly v] by (-2)\n                position it\n            else\n                go to x: (x) y: (y)\n            end\n        end\n    end\nend\n\ndefine position it\nposition (((lx) * (464)) - ((CAMERA X) / (1.5))) (((ly) * (344)) - ((CAMERA Y) / (1.5)))\n\nwhen [p v] key pressed\nset [costume v] to []\n\nwhen I receive [new game v]\nset size to (100) %\nset [costume v] to []\nset [lx v] to [0]\nset [ly v] to [0]\ncreate clone of (_myself_ v)\nset [lx v] to [1]\ncreate clone of (_myself_ v)\nset [ly v] to [1]\ncreate clone of (_myself_ v)\nset [lx v] to [0]\n\nwait (1) seconds\n\n@Splash\n\nwhen flag clicked\nswitch costume to (splash v)\ngo to x: (0) y: (0)\npoint in direction (90)\ngo to [front v] layer\nshow\nwait (2) seconds\nset [sfx v] to [true]\nset [commentary v] to [true]\ngo to [front v] layer\nshow\nswitch costume to (background v)\ngo to x: (0) y: (0)\npoint in direction (90)\ncreate clone of (_myself_ v)\nswitch costume to (block v)\ngo to x: (0) y: (0)\ncreate clone of (_myself_ v)\nswitch costume to (hammer v)\ngo to x: (-41) y: (-311)\npoint in direction (180)\ncreate clone of (_myself_ v)\nhide\nswitch costume to (title v)\npoint in direction (90)\ngo to x: (0) y: (0)\ncreate clone of (_myself_ v)\nswitch costume to (sound effects v)\nset [menu y v] to [-81]\ncreate clone of (_myself_ v)\nswitch costume to (commentary v)\nset [menu y v] to [-108]\ncreate clone of (_myself_ v)\nswitch costume to (new game v)\nset [menu y v] to [-30]\ncreate clone of (_myself_ v)\nset [menu y v] to []\nswitch costume to (high score v)\nset [ghost v] effect to (100)\n\nwhen I start as a clone\nif <(costume [name v]) = [Hammer]> then\n    wait (0.5) seconds\n    repeat (8)\n        turn left (10) degrees\n    end\n    turn left (10) degrees\n    set [pitch v] effect to (0)\n    broadcast (splash - hit v)\n    forever\n        if <(mouse x) > [160]> then\n            if <(mouse y) > [110]> then\n                go to x: (0) y: (0)\n                switch costume to (highscore v)\n                broadcast (Show High Score Table v) and wait\n                repeat until <<mouse down?> and <(mouse x) > [-30]>>\n                    wait (0) seconds\n                end\n                broadcast (Hide HighScore Table v) and wait\n                switch costume to (hammer v)\n                go to x: (-41) y: (-311)\n            end\n        end\n        wait (0) seconds\n    end\nend\nif <(costume [name v]) = [White]> then\n    White Out and In <>\nend\nif <(costume [name v]) = [Background]> then\n    change y by (-1)\n    forever\n        repeat (28)\n            change y by (-1)\n        end\n        change y by (28)\n    end\nend\n\nwhen I receive [splash - hit v]\nif <(costume [number v]) > [1]> then\n    set [ghost v] effect to (100)\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\n\nwhen I receive [splash - hit v]\nif <(costume [number v]) > [6]> then\n    set [sy v] to (((costume [number v]) - (4)) / (2))\n    set [brightness v] effect to (-100)\n    set [ghost v] effect to (100)\n    change y by ((-12) * (sy))\n    wait (0.6) seconds\n    broadcast (Load High Score v) and wait\n    broadcast (Show Score v)\n    repeat (12)\n        change [ghost v] effect by (-10)\n        change y by (sy)\n    end\n    wait until <not <mouse down?>>\n    forever\n        if <<([abs v] of ((mouse x) - (45)) ) < [65]> and <([abs v] of ((mouse y) - (menu y)) ) < [13]>> then\n            set [brightness v] effect to (0)\n            if <mouse down?> then\n                if <(costume [name v]) = [New Game]> then\n                    set [pitch v] effect to (70)\n                    start sound [menurelease v]\n                    set [ghost v] effect to (100)\n                    switch costume to (white v)\n                    create clone of (_myself_ v)\n                    switch costume to (new game v)\n                    set [ghost v] effect to (0)\n                    stop [this script v]\n                end\n                set [t v] to < (costume [name v]) contains [Mute]?>\n                if <(t) = [true]> then\n                    switch costume to ((costume [number v]) - (1))\n                else\n                    next costume\n                end\n                if < (costume [name v]) contains [Sound Effects]?> then\n                    set [sfx v] to (t)\n                else\n                    set [commentary v] to (t)\n                end\n                wait until <not <mouse down?>>\n            end\n        else\n            set [brightness v] effect to (-100)\n            if <mouse down?> then\n                wait until <not <mouse down?>>\n            end\n        end\n        wait (0) seconds\n    end\nend\nif <(costume [number v]) = [6]> then\n    wait (0.6) seconds\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\n\nwhen I receive [new game v]\nif <not <(costume [name v]) = [White]>> then\n    hide\n    delete this clone\nend\n\nwhen I receive [win v]\nswitch costume to (black v)\nrepeat (300)\n    change [ghost v] effect by (-0.25)\nend\n\nwhen I receive [win v]\nwait (1) seconds\nswitch costume to (end title v)\ncreate clone of (_myself_ v)\nswitch costume to (stars v)\ncreate clone of (_myself_ v)\nswitch costume to (black v)\n\nwhen I start as a clone\nif <<(costume [name v]) = [end title]> or <(costume [name v]) = [world record]>> then\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\n    go to [front v] layer\n    repeat (30)\n        change [ghost v] effect by (-4)\n    end\nend\n\nwhen I receive [white out v]\nif <(costume [name v]) = [White]> then\n    White Out and In \nend\n\ndefine White Out and In <reset?>\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nif <reset?> then\n    broadcast (Reset v)\nelse\n    broadcast (New Game v)\nend\ngo to [front v] layer\nwait (0.5) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\n\nwhen I receive [win - record v]\nswitch costume to (black v)\nrepeat (300)\n    change [ghost v] effect by (-0.25)\nend\n\nwhen I receive [win - record v]\nwait (1) seconds\nswitch costume to (world record v)\ncreate clone of (_myself_ v)\nswitch costume to (stars v)\ncreate clone of (_myself_ v)\nswitch costume to (black v)\n\nwhen I start as a clone\nif <(costume [name v]) = [stars]> then\n    broadcast (time to front v)\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\n    go to [back v] layer\n    repeat (30)\n        change [ghost v] effect by (-4)\n        change y by (-1)\n    end\n    forever\n        change y by (-1)\n        if <(y position) < [-480]> then\n            change y by (480)\n        end\n    end\nend\n\n@Water\n\nwhen I receive [new game v]\ngo to x: (0) y: (-180)\nwait (0.4) seconds\ngo to [front v] layer\ngo [backward v] (1) layers\n\nwhen I receive [position level v]\ngo to x: (((((timer) * (30)) - (CAMERA X)) mod (480)) - (480)) y: (((-116) + ((10) * ([sin v] of ((timer) * (90)) ))) - ((CAMERA Y) / (1)))\n\n@Music\n\nwhen I receive [next monologue v]\nif <(music) = [0]> then\n    set [music v] to [12]\n    broadcast (Start Music v)\nend\n\nwhen I receive [start music v]\nrepeat until <(music) = [0]>\n    if <([talking v] of [narrator v]) = [1]> then\n        if <(music) < [12]> then\n            change [music v] by (0.2)\n            set volume to (music) %\n        end\n    else\n        if <(music) > [0]> then\n            change [music v] by (-0.2)\n            set volume to (music) %\n        end\n    end\n    wait (0) seconds\nend\n\nwhen I receive [new game v]\nset [music v] to [0]\n\nwhen I receive [start music v]\nwait (3) seconds\nset volume to (music) %\nrepeat until <not <([talking v] of [narrator v]) = [1]>>\n    play sound [Soul_and_Mind 48000 loop v] until done\nend\nset [music v] to [0]\nset volume to (0) %\n\n@Narrator\n\nwhen I receive [new game v]\nset [talking v] to [0]\nset [script no v] to [0]\nset [read until v] to [0]\nset [fall count v] to [0]\nset [stuck v] to [0]\nset [fullscreen issue v] to [0]\nhide\n\nwhen I receive [position level v]\nDetect Mouse Issues\nif <(PLAYER Y) > [10938]> then\n    talk to [12]\nelse\n    if <(PLAYER Y) > [9300]> then\n        talk to [11]\n    else\n        if <(PLAYER Y) > [8380]> then\n            talk to [10]\n        else\n            if <(PLAYER Y) > [7180]> then\n                talk to [9]\n            else\n                if <<(PLAYER Y) > [5633]> and <(PLAYER X) < [2183]>> then\n                    talk to [8]\n                else\n                    if <(PLAYER Y) > [5330]> then\n                        talk to [7]\n                    else\n                        if <<(PLAYER Y) > [4427]> and <(PLAYER X) > [2583]>> then\n                            talk to [6]\n                        else\n                            if <<(PLAYER Y) > [3710]> and <(PLAYER X) < [1960]>> then\n                                talk to [5]\n                            else\n                                if <(PLAYER Y) > [2993]> then\n                                    talk to [4]\n                                else\n                                    if <(PLAYER Y) > [1733]> then\n                                        talk to [3]\n                                    else\n                                        if <<(PLAYER X) > [2062]> and <(PLAYER Y) > [244]>> then\n                                            talk to [2]\n                                        else\n                                            if <<(PLAYER X) > [1500]> and <(PLAYER Y) > [254]>> then\n                                                talk to [1]\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nif <<(talking) > [0]> or <(COMMENTARY) = [false]>> then\n    stop [this script v]\nend\nif <(script no) < (read until)> then\n    change [script no v] by (1)\n    broadcast (next monologue v)\nend\n\nwhen I receive [next monologue v]\nset [talking v] to [1]\nplay sound (join [GOI M] (script no)) until done\nset [talking v] to [0]\n\nshow variable [debug v]\nforever\n    set [debug v] to (join ((mouse x) + (CAMERA X)) (join [, ] ((mouse y) + (CAMERA Y))))\nend\n\nwhen I receive [fall v]\nif <(COMMENTARY) = [true]> then\n    change [fall count v] by (1)\n    if <(fall count) < [25]> then\n        set [talking v] to [2]\n        play sound (join [Fall ] (fall count)) until done\n        set [talking v] to [0]\n    end\nend\n\ndefine Detect Mouse Issues\nif <<(mouse x) = (lmx)> and <(mouse y) = (lmy)>> then\n    if <([abs v] of (mouse y) ) > [170]> then\n        change [stuck v] by (1)\n    end\n    stop [this script v]\nend\nif <(stuck) > [3]> then\n    if <([abs v] of ((mouse x) - (lmx)) ) > [100]> then\n        change [fullscreen issue v] by (1)\n        if <[full screen remind v] contains (fullscreen issue)?> then\n            broadcast (F11 reminder v)\n        end\n    end\nend\nset [lmx v] to (mouse x)\nset [lmy v] to (mouse y)\nset [stuck v] to [0]\n\ndefine talk to (part)\nif <(part) > (read until)> then\n    set [read until v] to (part)\nend\n\nwhen I receive [f11 reminder v]\nif <(COMMENTARY) = [true]> then\n    go to x: (0) y: (0)\n    switch costume to (f11 v)\n    repeat (3)\n        show\n        wait (0.5) seconds\n        hide\n        wait (0.3) seconds\n    end\n    show\n    wait (16) seconds\n    hide\nend\n\n@Timer\n\nwhen I receive [splash - hit v]\nhide\nswitch costume to (d0 v)\nset size to (40) %\nwait (0.5) seconds\ngo to [front v] layer\nset [id v] to [1]\ngo to x: (220) y: (154)\ncreate clone of (_myself_ v)\nset [id v] to [2]\nchange x by (-21)\ncreate clone of (_myself_ v)\nset [id v] to [-3]\nchange x by (-15)\nswitch costume to (d' v)\ncreate clone of (_myself_ v)\nset [id v] to [3]\nchange x by (-15)\nswitch costume to (d0 v)\ncreate clone of (_myself_ v)\nset [id v] to [4]\nchange x by (-21)\nswitch costume to (d v)\ncreate clone of (_myself_ v)\nset [id v] to [-5]\nchange x by (-15)\ncreate clone of (_myself_ v)\nset [id v] to [5]\nchange x by (-15)\n\nwhen I receive [position level v]\nchar (item ([abs v] of (id) ) of [time v])\n\ndefine char (c)\nif <(id) < [0]> then\n    if <(c) = []> then\n        set [cost v] to [d]\n    else\n        set [cost v] to [d']\n    end\nelse\n    set [cost v] to (join [d] (c))\nend\nif <not <(cost) = (costume [name v])>> then\n    switch costume to (cost)\nend\n\nwhen I receive [show score v]\nset [ghost v] effect to (100)\nshow\nchar (item ([abs v] of (id) ) of [time v])\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [time to front v]\ngo to [front v] layer\n\n@Cloud List\n\ndefine write (val) to encoded\nset [letter # v] to [1]\nrepeat (length of (val))\n    set [c v] to (letter (letter #) of (val))\n    switch costume to (join (c) [_])\n    set [c v] to (item # of (c) in [codes v])\n    if <(costume [name v]) = [lower]> then\n        set [encoded v] to (join (encoded) (c))\n    else\n        set [encoded v] to (join (encoded) ((c) + (26)))\n        switch costume to (lower v)\n    end\n    change [letter # v] by (1)\nend\nset [encoded v] to (join (encoded) [00])\n\ndefine value = read from encoded\nset [value v] to []\nforever\n    set [idx v] to (join (letter (letter #) of (encoded)) (letter ((letter #) + (1)) of (encoded)))\n    change [letter # v] by (2)\n    if <(idx) < [1]> then\n        stop [this script v]\n    end\n    set [value v] to (join (value) (item (idx) of [codes v]))\nend\n\ndefine Begin Encode/Decode (encoded)\nset [encoded v] to (encoded)\nset [letter # v] to [1]\n\nwhen flag clicked\nswitch costume to (lower v)\nhide\n\nwhen I receive [cloud list - save v]\nhide\nSave\nshow\nwrite to cloud [0.1]\nhide\n\ndefine write number (val) to encoded\nset [encoded v] to (join (encoded) (join (length of (val)) (val)))\n\nwhen I receive [cloud list - load v]\nLoad\n\ndefine Save\nBegin Encode/Decode []\nset [cvar id v] to [1]\nrepeat ((length of [cloud list v]) / (2))\n    write (item (cvar id) of [cloud list v]) to encoded\n    change [cvar id v] by (1)\n    write number (item (cvar id) of [cloud list v]) to encoded\n    change [cvar id v] by (1)\nend\nset [idx v] to [1]\ndelete all of [cloud out v]\nset [c v] to []\nrepeat (length of (encoded))\n    set [c v] to (join (c) (letter (idx) of (encoded)))\n    change [idx v] by (1)\n    if <(length of (c)) > [255]> then\n        add (c) to [cloud out v]\n        set [c v] to []\n    end\nend\nif <(length of (c)) > [0]> then\n    add (c) to [cloud out v]\nend\n\ndefine write to cloud (wait)\nset [☁ cloud lock v] to (lock id)\nwait (wait) seconds\nif <not <(join [a] (☁ cloud list 1)) = (join [a] (item (1) of [cloud out v]))>> then\n    set [☁ cloud list 1 v] to (item (1) of [cloud out v])\n    wait (wait) seconds\nend\nif <not <(join [a] (☁ cloud list 2)) = (join [a] (item (2) of [cloud out v]))>> then\n    set [☁ cloud list 2 v] to (item (2) of [cloud out v])\n    wait (wait) seconds\nend\nif <not <(join [a] (☁ cloud list 3)) = (join [a] (item (3) of [cloud out v]))>> then\n    set [☁ cloud list 3 v] to (item (3) of [cloud out v])\n    wait (wait) seconds\nend\nif <not <(join [a] (☁ cloud list 4)) = (join [a] (item (4) of [cloud out v]))>> then\n    set [☁ cloud list 4 v] to (item (4) of [cloud out v])\n    wait (wait) seconds\nend\nif <not <(join [a] (☁ cloud list 5)) = (join [a] (item (5) of [cloud out v]))>> then\n    set [☁ cloud list 5 v] to (item (5) of [cloud out v])\n    wait (wait) seconds\nend\nif <not <(join [a] (☁ cloud list 6)) = (join [a] (item (6) of [cloud out v]))>> then\n    set [☁ cloud list 6 v] to (item (6) of [cloud out v])\n    wait (wait) seconds\nend\nif <not <(join [a] (☁ cloud list 7)) = (join [a] (item (7) of [cloud out v]))>> then\n    set [☁ cloud list 7 v] to (item (7) of [cloud out v])\n    wait (wait) seconds\nend\n\ndefine value = read number from encoded\nset [value v] to []\nset [idx v] to (letter (letter #) of (encoded))\nif <(idx) = []> then\n    stop [this script v]\nend\nchange [letter # v] by (1)\nrepeat (idx)\n    set [value v] to (join (value) (letter (letter #) of (encoded)))\n    change [letter # v] by (1)\nend\n\ndefine Load\ndelete all of [cloud list v]\nset [encoded v] to (☁ cloud list 1)\nset [encoded v] to (join (encoded) (☁ cloud list 2))\nset [encoded v] to (join (encoded) (☁ cloud list 3))\nset [encoded v] to (join (encoded) (☁ cloud list 4))\nset [encoded v] to (join (encoded) (☁ cloud list 5))\nset [encoded v] to (join (encoded) (☁ cloud list 6))\nset [encoded v] to (join (encoded) (☁ cloud list 7))\nBegin Encode/Decode (encoded)\nrepeat until <(letter #) > (length of (encoded))>\n    value = read from encoded\n    add (value) to [cloud list v]\n    value = read number from encoded\n    add (value) to [cloud list v]\nend\n\nwhen I receive [cloud - lock v]\nset [lock id v] to (pick random (0) to (10000000000))\nforever\n    read lock (☁ cloud lock)\n    set [value v] to (encoded)\n    set [encoded v] to []\n    repeat until <(value) = (encoded)>\n        wait (0.7) seconds\n        read lock (☁ cloud lock)\n    end\n    set [☁ cloud lock v] to (lock id)\n    read lock (lock id)\n    set [value v] to (encoded)\n    wait (0.7) seconds\n    read lock (☁ cloud lock)\n    if <(value) = (encoded)> then\n        set [☁ cloud lock v] to (lock id)\n        stop [other scripts in sprite v]\n        show\n        stop [this script v]\n    end\n    wait (pick random (0) to (2.0)) seconds\nend\n\ndefine read lock (lock)\nset [encoded v] to (join [lock] (☁ cloud list 2))\nset [encoded v] to (join (encoded) (☁ cloud list 2))\nset [encoded v] to (join (encoded) (☁ cloud list 3))\nset [encoded v] to (join (encoded) (☁ cloud list 4))\nset [encoded v] to (join (encoded) (☁ cloud list 5))\nset [encoded v] to (join (encoded) (☁ cloud list 6))\nset [encoded v] to (join (encoded) (☁ cloud list 7))\nset [encoded v] to (join (encoded) (lock))\n\nset [☁ cloud list 1 v] to []\nset [☁ cloud list 2 v] to []\n\nwhen I receive [cloud - lock v]\nswitch costume to (lower v)\nshow\ngo to x: (0) y: (0)\ngo to [front v] layer\nforever\n    wait (0.7) seconds\n    hide\n    wait (0.3) seconds\n    show\nend\n\n@High Score\n\nwhen I receive [show high score table v]\nbroadcast (CLOUD LIST - Load v) and wait\nShow Top 10\n\ndefine Show Top 10\ndelete all of [top 25 v]\nset [i v] to [1]\nrepeat (25)\n    format (i)\n    add (format) to [top 25 v]\n    change [i v] by (2)\nend\nhide list [top 25 v]\n\ndefine format (i)\nset [format v] to (item (i) of [cloud list v])\nif <(format) = []> then\n    stop [this script v]\nend\nset [format v] to (join [ ... ] (format))\nprepend format with (item ((i) + (1)) of [cloud list v])\n\ndefine prepend format with (time)\nset [t v] to ([floor v] of ((time) / (30)) )\nset [tx v] to ((t) mod (60))\nset [t v] to ([floor v] of ((t) / (60)) )\nif <(tx) < [10]> then\n    set [format v] to (join (join [0] (tx)) (format))\nelse\n    set [format v] to (join (join (letter (1) of (tx)) (letter (2) of (tx))) (format))\nend\nset [tx v] to ((t) mod (60))\nset [t v] to ([floor v] of ((t) / (60)) )\nset [format v] to (join ['] (format))\nif <(tx) < [10]> then\n    if <(t) > [0]> then\n        set [format v] to (join (join [0] (tx)) (format))\n    else\n        set [format v] to (join (tx) (format))\n    end\nelse\n    set [format v] to (join (join (letter (1) of (tx)) (letter (2) of (tx))) (format))\nend\nset [tx v] to ((t) mod (60))\nif <(t) > [0]> then\n    set [format v] to (join ['] (format))\n    set [format v] to (join (join (tx) [']) (format))\nend\n\nwhen I receive [save time to cloud v]\nset [☁ latest v] to (FRAME)\nif <<(round (☁ FASTEST)) < [10]> or <(FRAME) < (☁ FASTEST)>> then\n    wait (0.1) seconds\n    set [☁ fastest v] to (FRAME)\n    broadcast (Win - Record v)\nelse\n    broadcast (Win v)\nend\nbroadcast (CLOUD LIST - Load v) and wait\nset [invalidate v] to []\nSave to Top 10 (username) (FRAME)\nif <(invalidate) > [0]> then\n    wait (0.1) seconds\n    broadcast (CLOUD - LOCK v) and wait\n    broadcast (CLOUD LIST - Load v) and wait\n    save to cloud (username) (FRAME)\nend\n\ndefine save to cloud (user) (time)\nset [invalidate v] to []\nSave to Top 10 (user) (time)\nif <(invalidate) > [0]> then\n    broadcast (CLOUD LIST - Save v) and wait\nend\n\ndefine Save to Top 10 (user) (time)\nset [i v] to [1]\nrepeat (25)\n    if <<(item (i) of [cloud list v]) = []> or <(time) < (item ((i) + (1)) of [cloud list v])>> then\n        insert (time) at (i) of [cloud list v] \n        insert (user) at (i) of [cloud list v] \n        change [i v] by (2)\n        repeat until <<(i) > [50]> or <(item (i) of [cloud list v]) = (user)>>\n            change [i v] by (2)\n        end\n        delete (i) of [cloud list v]\n        delete (i) of [cloud list v]\n        set [invalidate v] to [true]\n        stop [this script v]\n    end\n    if <(item (i) of [cloud list v]) = (user)> then\n        stop [this script v]\n    end\n    change [i v] by (2)\nend\n\ndefine Save last 25 (user) (time)\nrepeat until <(length of [cloud list v]) > [20]>\n    add [] to [cloud list v]\nend\nset [i v] to [21]\nrepeat until <(i) > (length of [cloud list v])>\n    if <(item (i) of [cloud list v]) = (user)> then\n        delete (i) of [cloud list v]\n        delete (i) of [cloud list v]\n    else\n        change [i v] by (2)\n    end\nend\ninsert (time) at (21) of [cloud list v] \ninsert (user) at (21) of [cloud list v] \ndelete (((35) * (2)) + (1)) of [cloud list v]\ndelete (((35) * (2)) + (1)) of [cloud list v]\n\nbroadcast (CLOUD LIST - Load v) and wait\nShow Top 10\n\nbroadcast (CLOUD - LOCK v) and wait\nbroadcast (CLOUD LIST - Load v) and wait\nsave to cloud [26averyj] [2250]\n\nwhen flag clicked\nshow list [top 25 v]\n\nwhen I receive [new game v]\nshow list [top 25 v]\n\nwhen I receive [hide highscore table v]\nshow list [top 25 v]\n\nbroadcast (CLOUD - LOCK v) and wait\nbroadcast (CLOUD LIST - Load v) and wait\nsave to cloud [alex300] [5463]\n\nbroadcast (CLOUD - LOCK v) and wait\nbroadcast (CLOUD LIST - Load v) and wait\nsave to cloud [bobamafish] [4652]\n\n