Geometry dash online platformer v1
@Stage\n\nwhen flag clicked\nswitch backdrop to (oh hi :\) v)\nclear graphic effects\nswitch backdrop to (\(: v)\nclear graphic effects\nbroadcast (Start v)\nbroadcast (init v) and wait\n\nwhen [m v] key pressed\nset [mouse v] to (join ((CAM X) + (mouse x)) (join [:] ((CAM Y) + (mouse y))))\n\nwhen flag clicked\nforever\n    play sound (pick random (2) to (14)) until done\nend\n\nwhen I receive [tick v]\nset [color v] effect to (COLOR_____)\nif <(Player X) > [800]> then\n    set [color_____ v] to [50]\nelse\n    if <(Player X) > [600]> then\n        set [color_____ v] to [100]\n    else\n        if <(Player X) > [211]> then\n            set [color_____ v] to [180]\n        else\n            set [color_____ v] to [130]\n        end\n    end\nend\n\nwhen I receive [tick v]\nset [volume v] to (Volume)\nset volume to (Volume) %\n\n@Player\n\ndefine Player x collisions (sx)\nchange [player x v] by (sx)\nPosition\nif <<<touching (floor2 v)?> or <touching (background2 v)?>> or <<touching (level v)?> or <touching (background3 v)?>>> then\n    repeat (24)\n        change [player y v] by (1)\n        Position\n        if <not <<<touching (floor2 v)?> or <touching (background2 v)?>> or <<touching (level v)?> or <touching (background3 v)?>>>> then\n            stop [this script v]\n        end\n    end\n    change [player y v] by (-24)\n    repeat until <not <<<touching (floor2 v)?> or <touching (background2 v)?>> or <<touching (level v)?> or <touching (background3 v)?>>>>\n        point in direction ((round ((direction) / (90))) * (09))\n        set [right or left v] to [0]\n        if <(sx) > [0]> then\n            change [player x v] by (-1)\n        else\n            change [player x v] by (1)\n        end\n        Position\n        set [::sx v] to [0]\n    end\nend\n\ndefine Player y collisions (sy)\nchange [player y v] by (sy)\nchange [::in air v] by (1)\nPosition\nif <(mode) = [1]> then\n    if <(left and right for ship) > [0]> then\n        if <(gravity) > [0]> then\n            switch costume to (ship3 v)\n        else\n            switch costume to (ship2 v)\n        end\n    else\n        if <(gravity) > [0]> then\n            switch costume to (ship4 v)\n        else\n            switch costume to (ship01 v)\n        end\n    end\nend\nif <(mode) = [0]> then\n    turn right ((((8.03) * ((0) - (gravity))) * (([abs v] of (right or left) ) / (right or left))) * (Backwards)) degrees\nelse\n    if <(mode) = [1]> then\n        if <(([abs v] of (left and right for ship) ) / (left and right for ship)) > [0]> then\n            point in direction (((::sy) * (-4)) + (90))\n        else\n            point in direction (((::sy) * (4)) + (90))\n        end\n    end\nend\nif <<<touching (level v)?> or <touching (background3 v)?>> or <<touching (floor2 v)?> or <touching (background2 v)?>>> then\n    if <(mode) = [0]> then\n        point in direction ((round ((direction) / (90))) * (09))\n    end\n    if <(mode) = [1]> then\n        point in direction (90)\n    end\n    if <(mode) = [2]> then\n        switch costume to (icon \(5\)2 v)\n        change [:::sd v] by (((<<key (right arrow v) pressed?> or <key (d v) pressed?>> - <<key (left arrow v) pressed?> or <key (a v) pressed?>>) * (3)) * (Backwards))\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <key (space v) pressed?>> then\n            change [ball gravity v] by (1)\n            if <((ball gravity) mod (2)) = [0]> then\n                set [gravity v] to [1]\n            else\n                set [gravity v] to [-1]\n            end\n        end\n    end\n    repeat until <not <<<touching (level v)?> or <touching (background3 v)?>> or <<touching (floor2 v)?> or <touching (background2 v)?>>>>\n        if <(sy) > [0]> then\n            change [player y v] by (-1)\n            if <(gravity) > [0]> then\n                set [::in air v] to [0]\n            end\n        else\n            change [player y v] by (1)\n            if <(gravity) < [0]> then\n                set [::in air v] to [0]\n            end\n        end\n        Position\n        set [::sy v] to [0]\n    end\n    if <(mode) = [2]> then\n        switch costume to (icon \(5\) v)\n    end\nend\n\ndefine Position\ngo to x: ((Player X) - (CAM X)) y: ((Player Y) - (CAM Y))\n\ndefine Reset\nset [player x v] to [-200]\nset [player y v] to [0]\nset [cam x v] to [0]\nset [cam y v] to [0]\nset [gravity v] to [-1]\nset [speed v] to [1.5]\nset [right or left v] to [0]\nset [exit v] to [ ]\nset [jumping? v] to [0]\nset [jump v] to [9]\nset [health bar v] to [100]\nset [left and right for ship v] to [1]\nset [backwards v] to [1]\nset [mode v] to [0]\nset [:::sd v] to [0]\nset [ball gravity v] to [1]\ngo to x: (0) y: (0)\nswitch costume to (cat v)\nset [color v] effect to (0)\nshow\n\ndefine Player physics || speed (speed) Gravity (gravity) (jump height)\nchange [::sx v] by ((<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(x position) < (mouse x)>>> - <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>>) * (speed))\nchange [right or left v] by ((<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(x position) < (mouse x)>>> - <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>>) * (1))\nset [::sx v] to ((::sx) * (0.8))\nPlayer x collisions ((::sx) * (Backwards))\nif <(mode) = [0]> then\n    change [::sy v] by (gravity)\nelse\n    change [::sy v] by ((gravity) / (2))\nend\nPlayer y collisions (::sy)\nset [:::sd v] to ((:::sd) * (0.8))\nturn right (:::sd) degrees\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<key (space v) pressed?> or <<mouse down?> and <(mouse y) > [50]>>>> then\n    if <(mode) = [0]> then\n        if <(::in air) < [4]> then\n            if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(x position) < (mouse x)>>> and <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>>> then\n                change [right or left v] by ((<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(x position) < (mouse x)>>> - <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>>) * (1))\n            else\n                set [right or left v] to [0]\n            end\n            if <(gravity) < [0]> then\n                set [::sy v] to (jump height)\n            else\n                set [::sy v] to ((jump height) * (-1))\n            end\n        end\n    end\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<key (space v) pressed?> or <mouse down?>>> then\n    if <(mode) = [1]> then\n        if <(gravity) < [0]> then\n            change [::sy v] by (1.2)\n        else\n            change [::sy v] by (-1.2)\n        end\n    end\nend\nif <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n    change [jumping? v] by (1)\nelse\n    set [jumping? v] to [0]\nend\nif <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n    if <touching (orbs v)?> then\n        if <(jUMPING?) < [4]> then\n            set [::sy v] to (((12) * (gravity)) * (-1))\n            change [jumping? v] by (1)\n        end\n    end\nend\nchange [cam x v] by (round (((Player X) - (CAM X)) / (5)))\nif <(CAM X) < [-35]> then\n    set [cam x v] to [-35]\nend\nchange [cam y v] by (round (((Player Y) - (CAM Y)) / (5)))\nif <(CAM Y) < [0]> then\n    set [cam y v] to [0]\nend\nif <[152] < (CAM Y)> then\n    set [cam y v] to [152]\nend\ngo to [front v] layer\nif <touching (yellow pad v)?> then\n    set [::sy v] to (((17) * (gravity)) * (-1))\nend\nif <touching (spikes v)?> then\n    set [exit v] to [die]\nend\nif <(Health bar) < [1]> then\n    set [exit v] to [die]\nend\nchange [health bar v] by ((0.1) * <(Health bar) < [100]>)\nif <touching (gravity portal ↑ v)?> then\n    set [gravity v] to [1]\nend\nif <touching (gravity portal ↓ v)?> then\n    set [gravity v] to [-1]\nend\nif <touching (ship portal v)?> then\n    set [mode v] to [1]\nend\nif <touching (cube portal v)?> then\n    set [mode v] to [0]\nend\nif <touching (mirror portal 1 2 v)?> then\n    set [backwards v] to [1]\nend\nif <touching (cube portal2 v)?> then\n    set [mode v] to [2]\nend\nPosition\n\nset [health bar v] to [0]\n\nwhen I receive [start v]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Reset\n    set [_clone v] to [0]\n    set [clones v] to [0]\n    repeat until <(Exit) > [ ]>\n        broadcast (update v)\n        set [shake x v] to (CAM X)\n        set [shake y v] to (CAM Y)\n    end\n    broadcast (shake v)\n    broadcast (Die v) and wait\n    Reset\n    show\nend\n\nwhen I receive [tick v]\nif <not <(join [▶] (Chat)) = [▶]>> then\n    say (join [▶] (Chat))\nelse\n    say []\nend\n\nwhen I receive [die v]\nhide\nrepeat (20)\n    change [shake x v] by (pick random (-15) to (15))\n    change [shake y v] by (pick random (-15) to (15))\n    change [cam x v] by (((Shake X) - (CAM X)) / (3))\n    change [cam y v] by (((Shake Y) - (CAM Y)) / (3))\n    if <(CAM Y) < [0]> then\n        set [cam y v] to [0]\n    end\n    broadcast (Tick v) and wait\nend\n\nwhen I receive [tick v]\nif <(Backwards) = [1]> then\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        set [left and right for ship v] to [1]\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>> then\n        set [left and right for ship v] to [-1]\n    end\nelse\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        set [left and right for ship v] to [-1]\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>> then\n        set [left and right for ship v] to [1]\n    end\nend\n\nwhen I receive [tick v]\nif <(mode) = [0]> then\n    switch costume to (cat v)\nend\nif <(mode) = [2]> then\n    switch costume to (icon \(5\) v)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [update v]\nif <(_clone) = [0]> then\n    change [~tick v] by (1)\n    if <(~Tick) > [999]> then\n        set [~tick v] to [0]\n    end\n    Player physics || speed (speed) Gravity (gravity) (jump)\n    broadcast (Tick v) and wait\nend\n\nset [_clone v] to [0]\n\n@Online Multiplayer Engine 2.0 by XShrunk\n\ndefine Init\ndelete all of [@players v]\ndelete all of [@ids v]\ndelete all of [@playeroffset v]\ndelete all of [#checkactive v]\ndelete all of [#checkvalue v]\ndelete all of [#cloudlist v]\ndelete all of [clouddata v]\nadd (join [=] (☁ Cloud1)) to [clouddata v]\nadd (join [=] (☁ Cloud2)) to [clouddata v]\nadd (join [=] (☁ Cloud3)) to [clouddata v]\nadd (join [=] (☁ Cloud4)) to [clouddata v]\nadd (join [=] (☁ Cloud5)) to [clouddata v]\nadd (join [=] (☁ Cloud6)) to [clouddata v]\nadd (join [=] (☁ Cloud7)) to [clouddata v]\nadd (join [=] (☁ Cloud8)) to [clouddata v]\nset [@id v] to (([floor v] of ((days since 2000) * (100000000)) ) mod (1000))\n\ndefine Process Cloud (id) (var)\nif <(var) = (item (id) of [clouddata v])> then\n    stop [this script v]\nend\nreplace item (id) of [clouddata v] with (var)\nDecode (var)\nif <<(item (2) of [decoded v]) = (username)> and <(item (5) of [decoded v]) = (@ID)>> then\n    stop [this script v]\nend\nFind Player (item (2) of [decoded v]) (item (5) of [decoded v])\nif <(~i) = [0]> then\n    set [~i v] to (item # of [] in [@players v])\n    if <(~i) = [0]> then\n        New Player\n    else\n        replace item (~i) of [@players v] with (item (2) of [decoded v])\n        replace item (~i) of [@ids v] with (item (5) of [decoded v])\n    end\nend\nset [~j v] to [1]\nrepeat (length of [decoded v])\n    replace item ((((~i) - (1)) * (&MaxElements)) + (~j)) of [#cloudlist v] with (item (~j) of [decoded v])\n    change [~j v] by (1)\nend\n\ndefine Read Cloud\nProcess Cloud [1] (join [=] (☁ Cloud1))\nProcess Cloud [2] (join [=] (☁ Cloud2))\nProcess Cloud [3] (join [=] (☁ Cloud3))\nProcess Cloud [4] (join [=] (☁ Cloud4))\nProcess Cloud [5] (join [=] (☁ Cloud5))\nProcess Cloud [6] (join [=] (☁ Cloud6))\nProcess Cloud [7] (join [=] (☁ Cloud7))\nProcess Cloud [8] (join [=] (☁ Cloud8))\n\ndefine Decode (clouddata)\ndelete all of [decoded v]\nset [~temp v] to []\nset [~i v] to [2]\nrepeat (((length of (clouddata)) - (1)) / (2))\n    switch costume to (join (letter (~i) of (clouddata)) (letter ((~i) + (1)) of (clouddata)))\n    if <(costume [number v]) = [1]> then\n        add (~temp) to [decoded v]\n        set [~temp v] to []\n    else\n        set [~temp v] to (join (~temp) (costume [name v]))\n    end\n    change [~i v] by (2)\nend\n\ndefine Encode\nset [~temp v] to []\nset [~i v] to [1]\nrepeat (length of [#playerlist v])\n    set [~j v] to [1]\n    repeat (length of (item (~i) of [#playerlist v]))\n        switch costume to (letter (~j) of (item (~i) of [#playerlist v]))\n        if <(costume [number v]) < [10]> then\n            set [~temp v] to (join (~temp) (join [0] (costume [number v])))\n        else\n            set [~temp v] to (join (~temp) (costume [number v]))\n        end\n        change [~j v] by (1)\n    end\n    set [~temp v] to (join (~temp) [01])\n    change [~i v] by (1)\nend\n\ndefine SaveToCloud (playerid)\nSavePlayer\nEncode\nif <(playerid) < [6]> then\n    if <(playerid) < [3]> then\n        if <(playerid) = [1]> then\n            set [☁ cloud1 v] to (~temp)\n        else\n            set [☁ cloud2 v] to (~temp)\n        end\n    else\n        if <(playerid) = [3]> then\n            set [☁ cloud3 v] to (~temp)\n        else\n            if <(playerid) = [4]> then\n                set [☁ cloud4 v] to (~temp)\n            else\n                set [☁ cloud5 v] to (~temp)\n            end\n        end\n    end\nelse\n    if <(playerid) < [8]> then\n        if <(playerid) = [6]> then\n            set [☁ cloud6 v] to (~temp)\n        else\n            set [☁ cloud7 v] to (~temp)\n        end\n    else\n        if <(playerid) = [8]> then\n            set [☁ cloud8 v] to (~temp)\n        end\n    end\nend\n\nwhen I receive [update v]\nUpdatePlayersList [1]\nRead Cloud\nSaveToCloud (pick random (1) to (length of [clouddata v]))\nCountPlayers\nUpdatePlayersList [0]\n\ndefine CountPlayers\nset [#playersonline v] to [1]\nset [~i v] to [1]\nrepeat (length of [@players v])\n    if <(item (~i) of [#checkactive v]) = [1]> then\n        change [#playersonline v] by (1)\n    end\n    change [~i v] by (1)\nend\nif <(#PlayersOnline) > [1]> then\n    hide\nelse\n    if <(username) = []> then\n        switch costume to (log in v)\n    else\n        if <(☁ Online) = [0]> then\n            switch costume to (new v)\n        else\n            switch costume to (alone v)\n        end\n    end\n    show\nend\ngo to [front v] layer\nif <(☁ Online) < [0]> then\n    switch costume to (offline v)\n    show\n    stop [all v]\nend\nif <<not <(Version) = (☁ Online)>> and <(☁ Online) > [0]>> then\n    switch costume to (update v)\n    show\n    stop [all v]\nend\n\nwhen I receive [init v]\nInit\n\ndefine UpdatePlayersList (first)\nif <(first) = [1]> then\n    set [~c v] to [0]\n    repeat (length of [@players v])\n        if <not <<(item (((~c) * (&MaxElements)) + (2)) of [#cloudlist v]) = (username)> and <(item (((~c) * (&MaxElements)) + (5)) of [#cloudlist v]) = (@ID)>>> then\n            if <(item ((~c) + (1)) of [@playeroffset v]) = [0]> then\n                replace item ((~c) + (1)) of [#checkvalue v] with (item (((~c) * (&MaxElements)) + (1)) of [#cloudlist v])\n            end\n            replace item ((~c) + (1)) of [@playeroffset v] with ((item ((~c) + (1)) of [@playeroffset v]) + (1))\n        end\n        change [~c v] by (1)\n    end\nelse\n    set [~c v] to [0]\n    repeat (length of [@players v])\n        if <not <<(item (((~c) * (&MaxElements)) + (2)) of [#cloudlist v]) = (username)> and <(item (((~c) * (&MaxElements)) + (5)) of [#cloudlist v]) = (@ID)>>> then\n            if <<not <(item ((~c) + (1)) of [#checkvalue v]) = (item (((~c) * (&MaxElements)) + (1)) of [#cloudlist v])>> or <(item ((~c) + (1)) of [@playeroffset v]) > [99]>> then\n                if <<(item ((~c) + (1)) of [#checkvalue v]) = (item (((~c) * (&MaxElements)) + (1)) of [#cloudlist v])> or <(item (((~c) * (&MaxElements)) + (5)) of [#cloudlist v]) = [X]>> then\n                    replace item ((~c) + (1)) of [#checkactive v] with [0]\n                    replace item ((~c) + (1)) of [@players v] with []\n                    replace item ((~c) + (1)) of [@ids v] with []\n                else\n                    replace item ((~c) + (1)) of [#checkactive v] with [1]\n                end\n                replace item ((~c) + (1)) of [@playeroffset v] with [0]\n            end\n        end\n        change [~c v] by (1)\n    end\nend\n\ndefine EmptyCloud\nset [☁ cloud1 v] to []\nwait (0.1) seconds\nset [☁ cloud2 v] to []\nwait (0.1) seconds\nset [☁ cloud3 v] to []\nwait (0.1) seconds\nset [☁ cloud4 v] to []\nwait (0.1) seconds\nset [☁ cloud5 v] to []\nwait (0.1) seconds\nset [☁ cloud6 v] to []\nwait (0.1) seconds\nset [☁ cloud7 v] to []\nwait (0.1) seconds\nset [☁ cloud8 v] to []\n\nwhen flag clicked\nhide\nset [last v] to [1]\nset [version v] to [1]\nif <(username) = [darkstar52]> then\n    wait (0.1) seconds\n    set [☁ online v] to (Version)\nend\nif <(#PlayersOnline) > [0]> then\n    replace item (5) of [#playerlist v] with [X]\n    repeat (10)\n        SaveToCloud (pick random (1) to (length of [clouddata v]))\n    end\nend\nset [#playersonline v] to [0]\n\ndefine SavePlayer\ndelete all of [#playerlist v]\nadd (~Tick) to [#playerlist v]\nadd (username) to [#playerlist v]\nadd ((round ((Player X) * (10))) / (10)) to [#playerlist v]\nadd ((round ((Player Y) * (10))) / (10)) to [#playerlist v]\nadd (@ID) to [#playerlist v]\nadd (Chat) to [#playerlist v]\nadd ([direction v] of [player v]) to [#playerlist v]\nadd (Health bar) to [#playerlist v]\nadd ([costume # v] of [player v]) to [#playerlist v]\nset [&maxelements v] to [9]\n\nset [☁ online v] to [0]\n\ndefine New Player\nadd (item (2) of [decoded v]) to [@players v]\nadd (item (5) of [decoded v]) to [@ids v]\nadd [0] to [@playeroffset v]\nadd [0] to [#checkactive v]\nadd [0] to [#checkvalue v]\nrepeat (&MaxElements)\n    add [0] to [#cloudlist v]\nend\ncreate clone of (others v)\n\ndefine Find Player (name) (id)\nset [~i v] to [0]\nrepeat (length of [@players v])\n    change [~i v] by (1)\n    if <<(item (~i) of [@players v]) = (name)> and <(item (~i) of [@ids v]) = (id)>> then\n        stop [this script v]\n    end\nend\nset [~i v] to [0]\n\n@level\n\nwhen I receive [tick v]\nPosition ((x) - (CAM X)) ((y) - (CAM Y))\npoint in direction (90)\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nset [clone# v] to [0]\nswitch costume to (level 1 1 v)\nCreate clone [260] [0]\nCreate clone [420] [0]\nCreate clone [420] [0]\n\ndefine Create clone (x) (y)\nchange [clone# v] by (1)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nset [x2 v] to (x)\nset [hidden door v] to [0]\nnext costume\n\nset rotation style [left-right v]\n\nwhen I start as a clone\npoint in direction (-90)\n\nset [backwards v] to [-1]\n\ngo to x: (x) y: (y)\n\nset [backwards v] to [-1]\n\n@others\n\nwhen I start as a clone\ngo to x: (0) y: (0)\nset [color v] effect to (0)\nchange [clones v] by (1)\nset [_clone v] to (clones)\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\n    say []\nend\n\ndefine Chat (username) (chat)\nif <(chat) = []> then\n    say (username)\nelse\n    say (join [▶] (chat))\nend\n\ndefine Pen bar (x) (y) (hp)\nerase all\npen up\nset pen color to (#b6b6b6)\nset [x v] to (x)\nset [y v] to (y)\ngo to x: ((x) - (25)) y: ((y) + (25))\nset pen size to (10)\nrepeat (50)\n    change x by (1)\n    pen down\nend\ngo to x: ((x) - (25)) y: ((y) + (25))\npen up\nset pen (color v) to ((hp) / (3))\nset pen (saturation v) to (100)\nset pen (brightness v) to (100)\nrepeat ((hp) / (2))\n    change x by (1)\n    pen down\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [update v]\nif <(item (_clone) of [#checkactive v]) = [1]> then\n    set [x v] to (item ((((_clone) - (1)) * (&MaxElements)) + (3)) of [#cloudlist v])\n    set [y v] to (item ((((_clone) - (1)) * (&MaxElements)) + (4)) of [#cloudlist v])\n    Position ((x) - (CAM X)) ((y) - (CAM Y))\n    Chat (item ((((_clone) - (1)) * (&MaxElements)) + (2)) of [#cloudlist v]) (item ((((_clone) - (1)) * (&MaxElements)) + (6)) of [#cloudlist v])\n    point in direction ((item ((((_clone) - (1)) * (&MaxElements)) + (7)) of [#cloudlist v]) * (Backwards))\n    switch costume to (item ((((_clone) - (1)) * (&MaxElements)) + (9)) of [#cloudlist v])\n    show\n    go to [front v] layer\nelse\n    hide\nend\n\n@Background\n\nwhen I receive [tick v]\nPosition ((((CAM X) * (-0.5)) mod (480)) - (240)) [0]\ngo to [back v] layer\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\n\n@Chat\n\nwhen I receive [start v]\ngo to x: (-184) y: (6)\nset [chatted v] to [0]\nset [chat v] to []\nhide\nforever\n    if <key (t v) pressed?> then\n        broadcast (chat v) and wait\n        wait until <not <key (t v) pressed?>>\n    end\n    if <key (space v) pressed?> then\n        hide\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen I receive [chat v]\nrepeat until <(chatted) = [1]>\n    show\n    if <key (space v) pressed?> then\n        set [chatted v] to [1]\n    end\n    if <key (1 v) pressed?> then\n        set [chat v] to (item (1) of [chat v])\n        set [chatted v] to [1]\n        wait (2) seconds\n        set [chat v] to []\n    end\n    if <key (2 v) pressed?> then\n        set [chat v] to (item (2) of [chat v])\n        set [chatted v] to [1]\n        wait (2) seconds\n        set [chat v] to []\n    end\n    if <key (3 v) pressed?> then\n        set [chat v] to (item (3) of [chat v])\n        set [chatted v] to [1]\n        wait (2) seconds\n        set [chat v] to []\n    end\n    if <key (4 v) pressed?> then\n        set [chat v] to (item (4) of [chat v])\n        set [chatted v] to [1]\n        wait (2) seconds\n        set [chat v] to []\n    end\n    if <key (5 v) pressed?> then\n        set [chat v] to (item (5) of [chat v])\n        set [chatted v] to [1]\n        wait (2) seconds\n        set [chat v] to []\n    end\n    if <key (6 v) pressed?> then\n        set [chat v] to (item (6) of [chat v])\n        set [chatted v] to [1]\n        wait (2) seconds\n        set [chat v] to []\n    end\n    if <key (7 v) pressed?> then\n        set [chat v] to (item (7) of [chat v])\n        set [chatted v] to [1]\n        wait (2) seconds\n        set [chat v] to []\n    end\nend\nhide\nset [chatted v] to [0]\n\nwhen I receive [tick v]\ngo to [front v] layer\n\n@floor\n\nwhen I receive [tick v]\nPosition ((((CAM X) * (-1)) mod (480)) - (240)) ((y) - (CAM Y))\ngo to [front v] layer\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\ngo to [back v] layer\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [-155]\n\n@Background3\n\nwhen I receive [tick v]\nPosition [0] ((y) - (CAM Y))\nset [color v] effect to (COLOR_____)\ngo [forward v] (1) layers\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\ngo to [back v] layer\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [-153]\n\nwhen flag clicked\nset [color v] effect to (COLOR_____)\n\n@No solid tiles\n\nwhen I receive [tick v]\nPosition ((x) - (CAM X)) ((y) - (CAM Y))\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level 1 1 v)\nCreate clone [280] [0]\nCreate clone [320] [0]\nCreate clone [520] [0]\n\ndefine Create clone (x) (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@spikes\n\nwhen I receive [tick v]\nPosition ((x) - (CAM X)) ((y) - (CAM Y))\ngo to [back v] layer\npoint in direction (90)\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\ngo to [front v] layer\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level 1 1 v)\nCreate clone [260] [0]\n\ndefine Create clone (x) (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@effect1\n\nwhen I receive [die v]\nshow\nswitch costume to (costume1 v)\nset [ghost v] effect to (0)\nset size to (50) %\nsetup clones\nrepeat (20)\n    go to (player v)\n    change size by (15)\n    change [ghost v] effect by (5)\nend\nhide\n\nwhen I start as a clone\nswitch costume to (costume2 v)\npoint in direction (pick random (-180) to (180))\nset size to (pick random (25) to (100)) %\ndelete all of [clone item v]\nadd (pick random (5) to (10)) to [clone item v]\nadd (pick random (2) to (7)) to [clone item v]\nadd (pick random (7) to (10)) to [clone item v]\nrepeat (item (1) of [clone item v])\n    move (item (2) of [clone item v]) steps\n    change [ghost v] effect by (item (3) of [clone item v])\nend\ndelete this clone\n\ndefine setup clones\nrepeat (20)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [die v]\nrepeat (20)\n    change [cam x v] by (pick random (-35) to (35))\n    change [cam y v] by (pick random (-35) to (35))\nend\n\nwhen I receive [orb touch v]\nset size to (50) %\nshow\nset [ghost v] effect to (0)\nswitch costume to (costume1 v)\nrepeat (7)\n    change size by (25)\n    change [ghost v] effect by (10)\n    go to x: ((ORB TOUCH X) - (CAM X)) y: ((ORB TOUCH Y) - (CAM Y))\nend\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [orb touch2 v]\nset size to (50) %\nshow\nset [ghost v] effect to (0)\nswitch costume to (costume3 v)\nrepeat (7)\n    change size by (25)\n    change [ghost v] effect by (10)\n    go to x: ((ORB TOUCH X) - (CAM X)) y: ((ORB TOUCH Y) - (CAM Y))\nend\nhide\n\n@fake spikes\n\nwhen I receive [tick v]\nPosition ((x) - (CAM X)) ((y) - (CAM Y))\ngo to [back v] layer\npoint in direction (90)\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level 1 1 v)\n\ndefine Create clone (x) (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nCreate clone [0] [0]\n\n@Orbs\n\nwhen I receive [tick v]\nPosition ((x) - (CAM X)) ((y) - (CAM Y))\nif <(costume [number v]) = [2]> then\n    set size to (((loudness) / (1)) + (50)) %\n    if <<touching (player v)?> and <([jumping? v] of [player v]) < [4]>> then\n        set [orb touch x v] to ((x position) + (CAM X))\n        set [orb touch y v] to ((y position) + (CAM Y))\n        broadcast (Orb touch v) and wait\n    end\nelse\n    set size to (((loudness) / (1.7)) + (100)) %\nend\npoint in direction (90)\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level 1 1 v)\nCreate clone [281] [42]\nCreate clone [281] [100]\n\ndefine Create clone (x) (y)\nswitch costume to (level 1 1 v)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nswitch costume to (level 1 2 v)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\n@Pen bar\n\ndefine Pen bar (x) (y) (hp)\npen up\nset pen color to (#b6b6b6)\nset [x v] to (x)\nset [y v] to (y)\ngo to x: ((x) - (25)) y: ((y) + (25))\nset pen size to (10)\nrepeat (50)\n    change x by (1)\n    pen down\nend\ngo to x: ((x) - (25)) y: ((y) + (25))\npen up\nset pen (color v) to ((hp) / (3))\nset pen (saturation v) to (100)\nset pen (brightness v) to (100)\nrepeat ((hp) / (2))\n    change x by (1)\n    pen down\nend\n\nwhen I receive [tick v]\nerase all\n\nPen bar ([x position v] of [player v]) ([y position v] of [player v]) (Health bar)\n\n@Yellow pad\n\nwhen I receive [tick v]\nPosition ((x) - (CAM X)) ((y) - (CAM Y))\nset size to (100) %\nset [touching? v] to [0]\nif <<touching (player v)?> and <(touching?) = [0]>> then\n    set [orb touch x v] to ((x position) + (CAM X))\n    set [orb touch y v] to ((y position) + (CAM Y))\n    broadcast (Orb touch v)\n    set [touching? v] to [1]\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level 1 1 v)\nCreate clone [540] [0]\n\ndefine Create clone (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\n@Gravity portal ↑\n\nwhen I receive [tick v]\nPosition ((x) - (CAM X)) ((y) - (CAM Y))\nset size to (100) %\nset [touching? v] to [0]\nset rotation style [left-right v]\nif <<touching (player v)?> and <(touching?) = [0]>> then\n    set [orb touch x v] to ((x position) + (CAM X))\n    set [orb touch y v] to ((y position) + (CAM Y))\n    broadcast (Orb touch v)\n    set [touching? v] to [1]\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (4515024_200x130 v)\npoint in direction (-90)\nCreate clone [140] [175]\npoint in direction (90)\nCreate clone [672] [130]\n\ndefine Create clone (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\n@Gravity portal ↓\n\nwhen I receive [tick v]\nPosition ((x) - (CAM X)) ((y) - (CAM Y))\nset size to (100) %\nset [touching? v] to [0]\nif <<touching (player v)?> and <(touching?) = [0]>> then\n    set [orb touch x v] to ((x position) + (CAM X))\n    set [orb touch y v] to ((y position) + (CAM Y))\n    broadcast (orb touch2 v)\n    set [touching? v] to [1]\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level 1 1 v)\npoint in direction (-90)\nCreate clone [31] [175]\npoint in direction (90)\nCreate clone [799] [130]\n\ndefine Create clone (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\n@Ship portal\n\nwhen I receive [tick v]\nPosition ((x) - (CAM X)) ((y) - (CAM Y))\nset size to (100) %\nset [touching? v] to [0]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level 1 1 v)\npoint in direction (90)\nCreate clone [600] [130]\n\ndefine Create clone (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nif <<touching (player v)?> and <(touching?) = [0]>> then\n    set [orb touch x v] to ((x position) + (CAM X))\n    set [orb touch y v] to ((y position) + (CAM Y))\n    broadcast (orb touch2 v)\n    set [touching? v] to [1]\nend\n\n@cube portal\n\nwhen I receive [tick v]\nPosition ((x) - (CAM X)) ((y) - (CAM Y))\nset size to (100) %\nset [touching? v] to [0]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\npoint in direction (90)\nCreate clone [476] [75]\nCreate clone [1000] [-50]\n\ndefine Create clone (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nif <<touching (player v)?> and <(touching?) = [0]>> then\n    set [orb touch x v] to ((x position) + (CAM X))\n    set [orb touch y v] to ((y position) + (CAM Y))\n    broadcast (orb touch2 v)\n    set [touching? v] to [1]\nend\n\n@floor2\n\nwhen I receive [tick v]\nif <([mode v] of [player v]) = [0]> then\n    hide\nelse\n    show\n    Position ((((CAM X) * (-1)) mod (480)) - (240)) ((y) - (CAM Y))\n    go to [front v] layer\nend\n\ngo to [front v] layer\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\ngo to [back v] layer\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [270]\n\n@Background2\n\nwhen I receive [tick v]\nif <([mode v] of [player v]) = [0]> then\n    hide\nelse\n    show\n    Position [0] ((y) - (CAM Y))\n    set [color v] effect to (COLOR_____)\n    go [forward v] (1) layers\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\ngo to [back v] layer\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [268]\n\nwhen flag clicked\nset [color v] effect to (COLOR_____)\n\n@mirror portal 1 \n\nwhen I receive [tick v]\nPosition ((x) - (CAM X)) ((y) - (CAM Y))\nset size to (100) %\nif <touching (player v)?> then\n    set [backwards v] to [-1]\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\npoint in direction (90)\nCreate clone [900] [-55]\n\ndefine Create clone (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nif <<touching (player v)?> and <(touching?) = [0]>> then\n    set [orb touch x v] to ((x position) + (CAM X))\n    set [orb touch y v] to ((y position) + (CAM Y))\n    broadcast (orb touch2 v)\n    set [touching? v] to [1]\nend\n\n@mirror portal 1 2\n\nwhen I receive [tick v]\nPosition ((x) - (CAM X)) ((y) - (CAM Y))\nset size to (100) %\nset [color v] effect to (75)\nset [touching? v] to [0]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\npoint in direction (90)\nCreate clone [1400] [-55]\n\ndefine Create clone (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\n@cube portal2\n\nwhen I receive [tick v]\nPosition ((x) - (CAM X)) ((y) - (CAM Y))\nset size to (100) %\nset [touching? v] to [0]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nset [color v] effect to (140)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\npoint in direction (90)\nCreate clone [800] [130]\n\ndefine Create clone (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nif <<touching (player v)?> and <(touching?) = [0]>> then\n    set [orb touch x v] to ((x position) + (CAM X))\n    set [orb touch y v] to ((y position) + (CAM Y))\n    broadcast (orb touch2 v)\n    set [touching? v] to [1]\nend\n\n@grenade\n\nwhen flag clicked\nset [pressed v] to [1]\n\nwhen flag clicked\nforever\n    if <key (space v) pressed?> then\n        change [pressed v] by (1)\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen I receive [tick v]\ngo to [front v] layer\ngo to x: (((Player X) + (20)) - (CAM X)) y: ((Player Y) - (CAM Y))\nif <((pressed) mod (2)) = [0]> then\n    show\nelse\n    hide\nend\n\n
WASD OR ARROW KEYS TO MOVE\noops sorry for CAPS\nEnjoy!!!\nEARLY ALPHA V2.0!!!!!:\nhttps://scratch.mit.edu/projects/726280405/\ncreate new levels