[Easier] Super Hard || A Multiplayer Scrolling Platformer
@Stage\n\nwhen flag clicked\nforever\n    play sound [Unlimited v] until done\nend\n\n@Player\n\nwhen flag clicked\nset [max players v] to [4]\nset [my player # v] to [0]\nbroadcast (setup - opponents v) and wait\nswitch backdrop to (joining v)\nbroadcast (load v)\nbroadcast (join game v) and wait\nif <(My Player #) > [0]> then\n    switch backdrop to (joined v)\n    wait (1) seconds\n    switch backdrop to (blank v)\n    broadcast (begin v)\nelse\n    switch backdrop to (full v)\n    stop [all v]\nend\n\ndefine write (val) to encoded\nset [letter # v] to [1]\nrepeat (length of (val))\n    set [encoded v] to (join (encoded) (item # of (letter (letter #) of (val)) in [code v]))\n    change [letter # v] by (1)\nend\nset [encoded v] to (join (encoded) [00])\n\nwhen I receive [begin v]\nforever\n    if <(My Player #) > [0]> then\n        send cloud data\n    end\nend\n\ndefine set cloud # (player) to (value)\nif <(player) = [1]> then\n    set [☁ p1 v] to (value)\nelse\n    if <(player) = [2]> then\n        set [☁ p2 v] to (value)\n    else\n        if <(player) = [3]> then\n            set [☁ p3 v] to (value)\n        else\n            set [☁ p4 v] to (value)\n        end\n    end\nend\n\ndefine send cloud data\nset [encoded v] to []\nwrite (username) to encoded\nwrite (round ((timer) * (10))) to encoded\nwrite ((x position) + (SCROLL X)) to encoded\nwrite ((y position) + (SCROLL Y)) to encoded\nset cloud # (My Player #) to (encoded)\n\ngo to (mouse-pointer v)\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\ndefine Game On\nset [checkpoint v] to [0]\nset [player2: x v] to [0]\nset [player2: y v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nhide variable [collected v]\nhide variable [collected max v]\nhide variable [exit v]\nhide variable [in air v]\nhide variable [level v]\nhide variable [mouse v]\nhide variable [scroll x v]\nhide variable [scroll y v]\nhide variable [sx v]\nhide variable [sy v]\nhide variable [player2: x v]\nhide variable [player2: y v]\npoint in direction (90)\nclear graphic effects\nset size to (100) %\nshow\nif <(Checkpoint) = [0]> then\n    set [x v] to [0]\n    set [y v] to [0]\nelse\n    if <(Checkpoint) = [1]> then\n        set [x v] to [1080]\n        set [y v] to [0]\n    end\nend\n\nwhen I receive [green flag v]\ngo to x: (0) y: (0)\nhide\n\ndefine Game - Win!\nrepeat (50)\n    point towards (exit v)\n    turn right (65) degrees\n    move ((distance to [exit v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nhide\nwait (1) seconds\nchange [level v] by (1)\nset [exit v] to []\n\nwhen I receive [play game v]\nforever\n    change [color v] effect by (25)\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Game On\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (Tick v)\n    end\n    if <(EXIT) = [win]> then\n        Game - Win!\n    else\n        Game - Die\n    end\nend\n\ndefine Tick\nif <key (left arrow v) pressed?> then\n    change [sx v] by (-2)\nend\nif <key (right arrow v) pressed?> then\n    change [sx v] by (2)\nend\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nset [sx v] to ((sx) * (0.8))\nif <key (up arrow v) pressed?> then\n    if <(in air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nchange [sy v] by (-2)\nChange player y by (sy)\nPosition\nTest - Die\nchange [scroll x v] by (round (((Player2: x) - (SCROLL X)) / (3)))\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((Player2: y) - (SCROLL Y)) / (15)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(Player2: y) < [-180]> then\n    set [exit v] to [die]\nend\n\ndefine Game - Die\nhide\n\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\n\nwait (0.5) seconds\n\ndefine Change player y by (sy)\nchange [player2: y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platforms v)?>>\n    if <(sy) > [0]> then\n        change [player2: y v] by (-1)\n    else\n        change [player2: y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Change Player x by (sx)\nchange [player2: x v] by (sx)\nPosition\nif <touching (platforms v)?> then\n    repeat (12)\n        change [player2: y v] by (1)\n        Position\n        if <not <touching (platforms v)?>> then\n            stop [this script v]\n        end\n    end\n    change [player2: y v] by (-12)\n    repeat until <not <touching (platforms v)?>>\n        if <(sx) > [0]> then\n            change [player2: x v] by (-1)\n        else\n            change [player2: x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Test - Die\nif <touching (danger v)?> then\n    set [exit v] to [Die]\nend\n\ndefine Position\ngo to x: ((Player2: x) - (SCROLL X)) y: ((Player2: y) - (SCROLL Y))\n\nwhen flag clicked\nforever\n    if <key (left arrow v) pressed?> then\n        switch costume to (player2 v)\n    end\n    if <key (right arrow v) pressed?> then\n        switch costume to (player v)\n    end\nend\n\nwhen I receive [begin v]\nforever\n    Bounce\nend\n\ndefine Bounce\nif <touching (bounce pad v)?> then\n    set [sy v] to [23]\nend\n\nwhen flag clicked\n\nforever\n    if <<touching (spikes v)?> or <touching (_edge_ v)?>> then\n        broadcast (die v)\n    end\nend\n\nwhen I receive [die v]\n\nforever\n\ngo to x: (0) y: (0)\n\ngo to (checkpoint v)\n\nwhen flag clicked\nforever\n    if  then\n        broadcast (Check 1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if  then\n        Game - Die\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (end v)?> then\n        broadcast (End v)\n    end\nend\n\n@Opponents\n\ndefine begin decode of (encoded)\nset [encoded v] to (encoded)\nset [letter # v] to [1]\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 [code v]))\nend\n\ndefine setup players\nset [color v] effect to (90)\nhide\nset [offline v] to [100]\nset [player # v] to [1]\nrepeat ((MAX PLAYERS) - (1))\n    create clone of (_myself_ v)\n    change [player # v] by (1)\nend\n\nwhen I receive [begin v]\nforever\n    if <(My Player #) = (player #)> then\n        set [offline v] to [100]\n        hide\n    else\n        tick\n    end\nend\n\ndefine value = cloud # (player)\nif <(player) = [1]> then\n    set [value v] to (☁ P1)\nelse\n    if <(player) = [2]> then\n        set [value v] to (☁ P2)\n    else\n        if <(player) = [3]> then\n            set [value v] to (☁ P3)\n        else\n            set [value v] to (☁ P4)\n        end\n    end\nend\n\nwhen I receive [setup - opponents v]\nsetup players\n\ndefine tick\nvalue = cloud # (player #)\nif <(join [A] (value)) = (last value)> then\n    change [offline v] by (1)\n    if <(offline) = [100]> then\n        hide\n    end\nelse\n    set [last value v] to (join [A] (value))\n    if <(offline) > [99]> then\n        show\n    end\n    set [offline v] to [0]\nend\nbegin decode of (value)\nvalue = read from encoded\nsay (join (player #) (join [: ] (value)))\nvalue = read from encoded\nvalue = read from encoded\nset x to ((value) - (SCROLL X))\nvalue = read from encoded\nset y to ((value) - (SCROLL Y))\n\nwhen I receive [join game v]\nvalue = cloud # (player #)\nset [last value v] to (join [A] (value))\nwait (3) seconds\nvalue = cloud # (player #)\nif <(join [A] (value)) = (last value)> then\n    set [my player # v] to (player #)\nend\n\n\n\nwhen flag clicked\nforever\n    if <<(y position) > [-160]> or <(y position) < [160]>> then\n        switch costume to (player v)\n    end\n    if <<(x position) > [-230]> or <(x position) < [230]>> then\n        switch costume to (player v)\n    end\n    if <<(y position) > [160]> or <(y position) < [-160]>> then\n    end\n    if <<(x position) > [230]> or <(x position) < [-230]>> then\n    end\nend\n\nswitch costume to (player2 v)\n\nswitch costume to (player2 v)\n\n@Loading\n\nwhen flag clicked\nhide\n\nwhen I receive [load v]\nshow\ngo to x: (5) y: (-24)\nforever\n    turn right (15) degrees\n    if <(backdrop [number v]) > [2]> then\n        hide\n        stop [this script v]\n    end\nend\n\n@Platforms\n\nwhen I receive [green flag v]\nset [level v] to [1]\nhide\n\nwhen I receive [tick v]\nposition ((Platforms: x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [platforms: x v] to [0]\nset [platforms: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (forest v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [160]\n    Clone at x: [-360] y: [0]\n    Clone at x: [-360] y: [10]\n    Clone at x: [-250] y: [20]\n    Clone at x: [360] y: [80]\n    Clone at x: [700] y: [300]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [360]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [0] y: [360]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n            end\n        end\n    end\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\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [platforms: x v] by (x)\nchange [platforms: y v] by (y)\nnext costume\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\nforever\n    go to [front v] layer\nend\n\n@Bounce Pad\n\nwhen I receive [green flag v]\nset [level v] to [1]\nhide\n\nwhen I receive [tick v]\nposition ((Platforms: x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [platforms: x v] to [0]\nset [platforms: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (forest v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [0] y: [360]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n            end\n        end\n    end\nend\n\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [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\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [platforms: x v] by (x)\nchange [platforms: y v] by (y)\nnext costume\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nhide\n\n@Spikes\n\nwhen I receive [green flag v]\nset [level v] to [1]\nhide\n\nwhen I receive [tick v]\nposition ((Platforms: x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [platforms: x v] to [0]\nset [platforms: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (forest v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [160]\n    Clone at x: [-360] y: [0]\n    Clone at x: [-360] y: [10]\n    Clone at x: [-250] y: [20]\n    Clone at x: [360] y: [80]\n    Clone at x: [700] y: [300]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [360]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [0] y: [360]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n            end\n        end\n    end\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\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [platforms: x v] by (x)\nchange [platforms: y v] by (y)\nnext costume\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    hide\nend\n\n@grassland\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\nshow\ngo to [back v] layer\n\n@End\n\nwhen I receive [green flag v]\nset [level v] to [1]\nhide\n\nwhen I receive [tick v]\nposition ((Platforms: x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [platforms: x v] to [0]\nset [platforms: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (forest v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [160]\n    Clone at x: [-360] y: [0]\n    Clone at x: [-360] y: [10]\n    Clone at x: [-250] y: [20]\n    Clone at x: [360] y: [80]\n    Clone at x: [700] y: [300]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [360]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [0] y: [360]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n            end\n        end\n    end\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\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [platforms: x v] by (x)\nchange [platforms: y v] by (y)\nnext costume\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\nforever\n    go to [front v] layer\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\nforever\n    show\n    go to [front v] layer\n    stop [all v]\nend\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\nshow\ngo to [front v] layer\n\n
This is the easier version of my Super Hard Platformer game!