Cloud Multiplayer Scrolling Platformer
@Stage\n\nwhen flag clicked\nset [kick v] to [Untrue]\nset [moved v] to [20]\nwait until <(Kick) = [True]>\nset [on? v] to [0]\nset [on? 2 v] to [0]\nset [on? 3 v] to [0]\nset [on? 4 v] to [0]\nbroadcast (You have been booted. v) and wait\nstop [all v]\n\nwhen flag clicked\nforever\n    wait (1) seconds\n    change [moved v] by (-1)\n    if <(Moved) < [1]> then\n        set [kick v] to [True]\n    end\nend\n\nwhen flag clicked\nbroadcast (update1 v) and wait\nset [check v] to (item (3) of [dpkg v])\nwait (1) seconds\nbroadcast (update1 v) and wait\nif <(Check) = (item (3) of [dpkg v])> then\n    set [@playerslot v] to [1]\n    broadcast (start v)\nelse\n    broadcast (update2 v) and wait\n    set [check v] to (item (3) of [dpkg v])\n    wait (1) seconds\n    broadcast (update2 v) and wait\n    if <(Check) = (item (3) of [dpkg v])> then\n        set [@playerslot v] to [2]\n        broadcast (start v)\n    else\n        broadcast (update3 v) and wait\n        set [check v] to (item (3) of [dpkg 1 v])\n        wait (1) seconds\n        broadcast (update3 v) and wait\n        if <(Check) = ([x position v] of [p4 v])> then\n            set [@playerslot v] to [3]\n            broadcast (start v)\n        else\n            broadcast (update4 v) and wait\n            set [check v] to (item (3) of [dpkg 2 v])\n            wait (1) seconds\n            broadcast (update4 v) and wait\n            if <(Check) = (item (3) of [dpkg 2 v])> then\n                set [@playerslot v] to [4]\n                broadcast (start v)\n            else\n                broadcast (full v)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    set [checking position v] to (join (Xpos) (Ypos))\n    wait (2) seconds\n    if <(Checking Position) = (join (Xpos) (Ypos))> then\nend\n\nset [@playerslot v] to [2]\n\nif  then\nend\n\nset [shot? 4 v] to [False]\n\nwhen flag clicked\n\nwhen I receive [start v]\nforever\n    show variable [players v]\n    set [players v] to ((1) + ((item (6) of [dpkg v]) + ((item (6) of [dpkg 1 v]) + (item (6) of [dpkg 2 v]))))\nend\n\n@Cloud\n\ndefine chatTranslate (trns)\nset [translatedchar v] to []\ninitChar\nset [j v] to [0]\nset [fin v] to []\nrepeat (length of (trns))\n    change [j v] by (1)\n    set [i v] to [0]\n    repeat until <(letter (i) of (@charList)) = (letter (j) of (trns))>\n        change [i v] by (1)\n    end\n    if <(length of (i)) < [2]> then\n        set [add v] to (join [0] (i))\n    else\n        set [add v] to (i)\n    end\n    set [fin v] to (join (fin) (add))\nend\n\ndefine initChar\nset [@charlist v] to [ abcdefghijklmnopqrstuvwxyz1234567890<>_-ABCDEFGHIJKLMNOPQRSTUVWXYZ!.,?/\'";:-=+\)\(*&^%$#@{}\[\]\|`~]\n\ndefine saveData (_id) (x) (y) (username) (on?) (costume#) (direction)\nset [_encode v] to (join (join (join (x) [~]) (join (y) [~])) (join (join (pick random (10000) to (99999)) [~]) (join (join (username) [~]) (join (on?) (join [~] (join (costume#) (join [~] (join (direction) [~]))))))))\nchatTranslate (_encode)\nset [_encodetrns v] to (fin)\nif <(_id) = [1]> then\n    set [☁ p1 v] to (_encodeTRNS)\nelse\n    if <(_id) = [2]> then\n        set [☁ p2 v] to (_encodeTRNS)\n    else\n        if <(_id) = [3]> then\n            set [☁ p3 v] to (_encodeTRNS)\n        else\n            if <(_id) = [4]> then\n                set [☁ p4 v] to (_encodeTRNS)\n            end\n        end\n    end\nend\n\ndefine update (data)\ninitChar\nset [p v] to [1]\nset [retrns v] to []\nrepeat ((length of (data)) / (2))\n    set [retrns v] to (join (retrns) (letter (join (letter (p) of (data)) (letter ((p) + (1)) of (data))) of (@charList)))\n    change [p v] by (2)\nend\n\ndefine dpkg (data)\ndelete (all) of [dpkg v]\nset [i v] to [0]\nset [addtoarray v] to []\nrepeat until <(i) > ((length of (data)) - (1))>\n    change [i v] by (1)\n    if <(letter (i) of (data)) = [~]> then\n        add (addToArray) to [dpkg v]\n        set [addtoarray v] to []\n    else\n        set [addtoarray v] to (join (addToArray) (letter (i) of (data)))\n    end\nend\n\ndefine decodeData (_id)\nif <<<(_id) = [1]> or <(_id) = [2]>> or <(_id) = [3]>> then\n    if <(_id) = [1]> then\n        update (☁ P1)\n    end\n    if <(_id) = [2]> then\n        update (☁ P2)\n    end\n    set [rtrns_data v] to (retrns)\n    dpkg (RTRNS_Data)\nend\n\nwhen I receive [update2 v]\ndecodeData (2)\n\nwhen I receive [update1 v]\ndecodeData (1)\n\nwhen flag clicked\nset [@playerslot v] to [0]\nforever\n    if <(@PlayerSlot) = [1]> then\n        decodeData (2)\n        Decoding Data [3]\n        Decoding Data 2 [4]\n        saveData (1) (round (Xpos)) (round (Ypos)) (username) (On?) ([costume # v] of [p1 v]) ([direction v] of [p1 v])\n    end\n    if <(@PlayerSlot) = [2]> then\n        decodeData (1)\n        Decoding Data [3]\n        Decoding Data 2 [4]\n        saveData (2) (round (Xpos)) (round (Ypos)) (username) (On? 2) ([costume # v] of [p2 v]) ([direction v] of [p2 v])\n    end\n    if <(@PlayerSlot) = [3]> then\n        decodeData (1)\n        Decoding Data [2]\n        Decoding Data 2 [4]\n        saveData (3) (round (Xpos)) (round (Ypos)) (username) (On? 3) ([costume # v] of [p3 v]) ([direction v] of [p3 v])\n    end\n    if <(@PlayerSlot) = [4]> then\n        Decoding Data 2 [1]\n        decodeData (2)\n        Decoding Data [3]\n        saveData (4) (round (Xpos)) (round (Ypos)) (username) (On? 4) ([costume # v] of [p4 v]) ([direction v] of [p4 v])\n    end\n    Decode Shot Data\n    Save Shooting Data (Shot?) (Shot? 2) (Shot? 3) (Shot? 4)\nend\n\ndefine Decoding Data (p)\nif <<(p) = [3]> or <(p) = [2]>> then\n    if <(p) = [3]> then\n        update (☁ P3)\n    end\n    if <(p) = [2]> then\n        update (☁ P2)\n    end\n    set [rtrns_data v] to (retrns)\n    DPKG 1 (RTRNS_Data)\nend\n\ndefine DPKG 1 (data)\ndelete (all) of [dpkg 1 v]\nset [i v] to [0]\nset [addtoarray v] to []\nrepeat until <(i) > ((length of (data)) - (1))>\n    change [i v] by (1)\n    if <(letter (i) of (data)) = [~]> then\n        add (addToArray) to [dpkg 1 v]\n        set [addtoarray v] to []\n    else\n        set [addtoarray v] to (join (addToArray) (letter (i) of (data)))\n    end\nend\n\nwhen I receive [update3 v]\nDecoding Data [3]\n\nwhen I receive [kick find v]\nif <(@PlayerSlot) = [1]> then\n    broadcast (Checking 1 v) and wait\nelse\n    if <(@PlayerSlot) = [2]> then\n        broadcast (Checking 2 v) and wait\n    else\n        if <(@PlayerSlot) = [3]> then\n            broadcast (Checking 3 v) and wait\n        else\n            if <(@PlayerSlot) = [4]> then\n                broadcast (Checking 4 v) and wait\n            end\n        end\n    end\nend\n\nwhen I receive [checking 1 v]\nbroadcast (update2 v) and wait\nset [check v] to (item (3) of [dpkg v])\nwait (1) seconds\nbroadcast (update2 v) and wait\nif <(Check) = (item (3) of [dpkg v])> then\n    saveData [2] [12] [12] [12] [0] [] []\nend\n\nwhen I receive [checking 1 v]\nbroadcast (update3 v) and wait\nset [checking v] to (item (3) of [dpkg 1 v])\nwait (1) seconds\nbroadcast (update3 v) and wait\nif <(Checking) = (item (3) of [dpkg 1 v])> then\n    saveData [3] [12] [12] [12] [0] [] []\nend\n\nwhen I receive [checking 2 v]\nbroadcast (update1 v) and wait\nset [check v] to (item (3) of [dpkg v])\nwait (1) seconds\nbroadcast (update1 v) and wait\nif <(Check) = (item (3) of [dpkg v])> then\n    saveData [1] [12] [12] [12] [0] [] []\nend\n\nwhen I receive [checking 2 v]\nbroadcast (update3 v) and wait\nset [checking v] to (item (3) of [dpkg 1 v])\nwait (1) seconds\nbroadcast (update3 v) and wait\nif <(Checking) = (item (3) of [dpkg 1 v])> then\n    saveData [3] [12] [12] [12] [0] [] []\nend\n\nwhen I receive [special updated  v]\nDecoding Data [2]\n\nwhen I receive [checking 3 v]\nbroadcast (update1 v) and wait\nset [chack v] to (item (3) of [dpkg v])\nwait (1) seconds\nbroadcast (update1 v) and wait\nif <(Chack) = (item (3) of [dpkg v])> then\n    saveData [1] [12] [12] [12] [0] [] []\nend\n\nwhen I receive [checking 3 v]\nbroadcast (Special Updated  v) and wait\nset [checking v] to (item (3) of [dpkg 1 v])\nwait (1) seconds\nbroadcast (Special Updated  v) and wait\nif <(Checking) = (item (3) of [dpkg 1 v])> then\n    saveData [2] [12] [12] [12] [0] [] []\nend\n\nwhen I receive [start v]\nforever\n    broadcast (Kick Find v) and wait\nend\n\nwait (5) seconds\n\ndefine Decoding Data 2 (data player)\nif <<(data player) = [4]> or <(data player) = [1]>> then\n    if <(data player) = [4]> then\n        update (☁ P4)\n    end\n    if <(data player) = [1]> then\n        update (☁ P1)\n    end\n    set [rtrns_data v] to (retrns)\n    DPKG 2 (RTRNS_Data)\nend\n\ndefine DPKG 2 (data)\ndelete (all) of [dpkg 2 v]\nset [i v] to [0]\nset [addtoarray v] to []\nrepeat until <(i) > ((length of (data)) - (1))>\n    change [i v] by (1)\n    if <(letter (i) of (data)) = [~]> then\n        add (addToArray) to [dpkg 2 v]\n        set [addtoarray v] to []\n    else\n        set [addtoarray v] to (join (addToArray) (letter (i) of (data)))\n    end\nend\n\nwhen I receive [update4 v]\nDecoding Data 2 [4]\n\nwhen I receive [checking 2 v]\nbroadcast (update4 v) and wait\nset [chack v] to (item (3) of [dpkg 2 v])\nwait (1) seconds\nbroadcast (update4 v) and wait\nif <(Chack) = (item (3) of [dpkg 2 v])> then\n    saveData [4] [12] [12] [12] [1] [] []\nend\n\nwhen I receive [checking 1 v]\nbroadcast (update4 v) and wait\nset [chack v] to (item (3) of [dpkg 2 v])\nwait (1) seconds\nbroadcast (update4 v) and wait\nif <(Chack) = (item (3) of [dpkg 2 v])> then\n    saveData [4] [12] [12] [12] [0] [] []\nend\n\nwhen I receive [checking 3 v]\nbroadcast (update4 v) and wait\nset [check v] to (item (3) of [dpkg 2 v])\nwait (1) seconds\nbroadcast (update4 v) and wait\nif <(Check) = (item (3) of [dpkg 2 v])> then\n    saveData [4] [12] [12] [12] [0] [] []\nend\n\nwhen I receive [checking 4 v]\nbroadcast (Special Update. v) and wait\nset [checking v] to (item (3) of [dpkg 2 v])\nwait (1) seconds\nbroadcast (Special Update. v) and wait\nif <(Checking) = (item (3) of [dpkg 2 v])> then\n    saveData [1] [12] [12] [12] [0] [] []\nend\n\nwhen I receive [checking 4 v]\nbroadcast (update2 v) and wait\nset [check v] to (item (3) of [dpkg v])\nwait (1) seconds\nbroadcast (update2 v) and wait\nif <(Check) = (item (3) of [dpkg v])> then\n    saveData [2] [12] [12] [12] [0] [] []\nend\n\nwhen I receive [special update. v]\nDecoding Data 2 [1]\n\nwhen I receive [checking 4 v]\nbroadcast (update3 v) and wait\nset [chack v] to (item (3) of [dpkg 1 v])\nwait (1) seconds\nbroadcast (update3 v) and wait\nif <(Chack) = (item (3) of [dpkg 1 v])> then\n    saveData [3] [12] [12] [12] [0] [] []\nend\n\ndefine Save Shooting Data (show 1?) (show 2?) (show 3?) (show 4?)\nchatTranslate (join (show 1?) (join [~] (join (show 2?) (join [~] (join (show 3?) (join [~] (join (show 4?) [~])))))))\nset [☁ shot v] to (fin)\n\nset [rtrns_data v] to []\n\ndpkg []\n\ndefine Depackage Shot Data (data)\ndelete (all) of [shot data v]\nset [change v] to [0]\nset [arrayadd v] to []\nrepeat until <(Change) > ((length of (data)) - (1))>\n    change [change v] by (1)\n    if <(letter (Change) of (data)) = [~]> then\n        add (Arrayadd) to [shot data v]\n        set [arrayadd v] to []\n    else\n        set [arrayadd v] to (join (Arrayadd) (letter (Change) of (data)))\n    end\nend\n\ndefine Decode Shot Data\nGun Update (☁ Shot)\nDepackage Shot Data (Returns)\n\nset [_encode v] to (retrns)\n\ndefine Gun Update (data)\ninitChar\nset [p v] to [1]\nset [returns v] to []\nrepeat ((length of (data)) / (2))\n    set [returns v] to (join (Returns) (letter (join (letter (p) of (data)) (letter ((p) + (1)) of (data))) of (@charList)))\n    change [p v] by (2)\nend\n\n@P1\n\ndefine Key Presses\nif <key (left arrow v) pressed?> then\n    point in direction (-90)\n    if <(XVel) > [-8]> then\n        change [xvel v] by (-2)\n    end\n    next costume\nelse\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n        if <(XVel) < [8]> then\n            change [xvel v] by (2)\n        end\n        next costume\n    else\n        if <(XVel) > [0]> then\n            change [xvel v] by (-1)\n        else\n            if <(XVel) < [0]> then\n                change [xvel v] by (1)\n            end\n        end\n    end\nend\nif <not <(XVel) = [0]>> then\n    change x by (XVel)\n    if <touching (level v)?> then\n        set [steps v] to [0]\n        repeat until <<not <touching (level v)?>> or <(Steps) > [7]>>\n            change [steps v] by (1)\n            change y by (1)\n        end\n        if <(Steps) > [7]> then\n            change y by ((Steps) * (-1))\n            change x by ((XVel) * (-1))\n        end\n    end\nend\n\ndefine Gravity\nchange y by (Yvel)\nif <touching (level v)?> then\n    if <(Yvel) > [0]> then\n        change y by ((Yvel) * (-1))\n        set [yvel v] to [0]\n    else\n        if <key (up arrow v) pressed?> then\n            set [yvel v] to [12]\n        else\n            set [yvel v] to [0]\n        end\n        set [steps v] to [0]\n        repeat until <<not <touching (level v)?>> or <(Steps) > [20]>>\n            change y by (1)\n            change [steps v] by (1)\n        end\n        if <(Steps) > [20]> then\n            change y by ((Steps) * (-1))\n        end\n    end\nelse\n    if <(Yvel) > [-21]> then\n        change [yvel v] by (-1)\n    end\nend\n\nwhen [timer v] > (Check_Time)\nset [on? v] to [0]\nwait (5) seconds\n\nwhen flag clicked\nforever\n    set [check_time v] to ((timer) + (0.1))\nend\n\nwhen flag clicked\nset [username v] to (username)\nset [on? v] to [1]\nforever\n    if <(@PlayerSlot) = [1]> then\n        Movement\n        think (username)\n    else\n        think (item (4) of [dpkg v])\n        if <(item (5) of [dpkg v]) = [1]> then\n            show\n        else\n            if <(item (5) of [dpkg v]) = [0]> then\n                hide\n            end\n        end\n        switch costume to (item (6) of [dpkg v])\n        point in direction (item (7) of [dpkg v])\n    end\nend\n\ngo to x: (0) y: (0)\n\ndefine Movement\nset rotation style [left-right v]\nKey Presses\nGravity\nif <<touching (mouse-pointer v)?> and <mouse down?>> then\n    change [xpos v] by ((x position) / (5))\n    change [ypos v] by ((y position) / (5))\nelse\n    change [xpos v] by (x position)\n    change [ypos v] by (y position)\nend\ngo to x: (0) y: (0)\nbroadcast (tick v) and wait\n\nforever\n\nwhen flag clicked\nset [shot? v] to [False]\nbroadcast (boot v) and wait\nset [inbathroom v] to [0]\ngo to [front v] layer\ngo [backward v] (2) layers\nset [yvel v] to [0]\nshow\ngo to x: (0) y: (0)\n\ngo to x: (0) y: (0)\n\nbroadcast (Movement v) and wait\n\nwhen I receive [movement v]\nMovement 1\n\ndefine Movement 1\n\nwhen I receive [start v]\nif <(@PlayerSlot) = [1]> then\n    set [xpos v] to [0]\n    set [ypos v] to [0]\n    go to x: ([x position v] of [teleporter v]) y: ([y position v] of [teleporter v])\nend\n\nwhen I receive [tick v]\nif <(@PlayerSlot) = [1]> then\n\nwhen I receive [tick v]\n\nwhen flag clicked\nforever\n    if <(@PlayerSlot) = [1]> then\n        if <key (space v) pressed?> then\n            set [shot? v] to [True]\n            wait (0.2) seconds\n            set [shot? v] to [False]\n        else\n            set [shot? v] to [False]\n        end\n    end\nend\n\n@P2\n\nchange x by (((x position) - ((item (1) of [dpkg v]) - (Xpos))) / (-5))\nchange y by (((y position) - ((item (2) of [dpkg v]) - (Ypos))) / (-5))\n\ndefine Key Presses\nif <key (left arrow v) pressed?> then\n    point in direction (-90)\n    next costume\n    if <(XVel) > [-8]> then\n        change [xvel v] by (-2)\n    end\nelse\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n        next costume\n        if <(XVel) < [8]> then\n            change [xvel v] by (2)\n        end\n    else\n        if <(XVel) > [0]> then\n            change [xvel v] by (-1)\n        else\n            if <(XVel) < [0]> then\n                change [xvel v] by (1)\n            end\n        end\n    end\nend\nif <not <(XVel) = [0]>> then\n    change x by (XVel)\n    if <touching (level v)?> then\n        set [steps v] to [0]\n        repeat until <<not <touching (level v)?>> or <(Steps) > [7]>>\n            change [steps v] by (1)\n            change y by (1)\n        end\n        if <(Steps) > [7]> then\n            change y by ((Steps) * (-1))\n            change x by ((XVel) * (-1))\n        end\n    end\nend\n\ndefine Gravity\nchange y by (Yvel)\nif <touching (level v)?> then\n    if <(Yvel) > [0]> then\n        change y by ((Yvel) * (-1))\n        set [yvel v] to [0]\n    else\n        if <key (up arrow v) pressed?> then\n            set [yvel v] to [12]\n        else\n            set [yvel v] to [0]\n        end\n        set [steps v] to [0]\n        repeat until <<not <touching (level v)?>> or <(Steps) > [20]>>\n            change y by (1)\n            change [steps v] by (1)\n        end\n        if <(Steps) > [20]> then\n            change y by ((Steps) * (-1))\n        end\n    end\nelse\n    if <(Yvel) > [-21]> then\n        change [yvel v] by (-1)\n    end\nend\n\nwhen flag clicked\nset [username v] to (username)\nset [on? 2 v] to [1]\nforever\n    if <(@PlayerSlot) = [2]> then\n        Movement\n        think (username)\n    else\n        think (item (4) of [dpkg v])\n        if <(item (5) of [dpkg v]) = [1]> then\n            show\n        else\n            if <(item (5) of [dpkg v]) = [0]> then\n                hide\n            end\n        end\n        switch costume to (item (6) of [dpkg v])\n        point in direction (item (7) of [dpkg v])\n    end\nend\n\nwhen [timer v] > (Check_Time)\nset [on? 2 v] to [0]\nwait (5) seconds\n\nwhen flag clicked\nforever\n    set [check_time v] to ((timer) + (0.1))\nend\n\nwhen flag clicked\nbroadcast (boot v) and wait\nset [inbathroom v] to [0]\ngo to [front v] layer\ngo [backward v] (2) layers\nset [yvel v] to [0]\nshow\ngo to x: (0) y: (0)\n\nchange x by (10)\nchange y by (((y position) - (10)) / (-5))\n\ndefine Other Movement\n\nwhen I receive [movement v]\n\nOther Movement\n\nbroadcast (Movement v) and wait\n\ndefine Movement\nset rotation style [left-right v]\nKey Presses\nGravity\nif <<touching (mouse-pointer v)?> and <mouse down?>> then\n    change [xpos v] by ((x position) / (5))\n    change [ypos v] by ((y position) / (5))\nelse\n    change [xpos v] by (x position)\n    change [ypos v] by (y position)\nend\ngo to x: (0) y: (0)\nbroadcast (tick v) and wait\n\nwhen I receive [start v]\nif <(@PlayerSlot) = [2]> then\n    set [xpos v] to [0]\n    set [ypos v] to [0]\n    go to x: ([x position v] of [teleporter v]) y: ([y position v] of [teleporter v])\nend\n\nwhen I receive [tick v]\nif <(@PlayerSlot) = [2]> then\n\nwhen I receive [tick v]\n\nwhen flag clicked\nforever\n    if <(@PlayerSlot) = [2]> then\n        if <key (space v) pressed?> then\n            set [shot? 2 v] to [True]\n            wait (0.2) seconds\n        else\n            set [shot? 2 v] to [False]\n        end\n    end\nend\n\n@P3\n\ndefine Key Presses\nif <key (left arrow v) pressed?> then\n    point in direction (-90)\n    next costume\n    if <(XVel) > [-8]> then\n        change [xvel v] by (-2)\n    end\nelse\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n        next costume\n        if <(XVel) < [8]> then\n            change [xvel v] by (2)\n        end\n    else\n        if <(XVel) > [0]> then\n            change [xvel v] by (-1)\n        else\n            if <(XVel) < [0]> then\n                change [xvel v] by (1)\n            end\n        end\n    end\nend\nif <not <(XVel) = [0]>> then\n    change x by (XVel)\n    if <touching (level v)?> then\n        set [steps v] to [0]\n        repeat until <<not <touching (level v)?>> or <(Steps) > [7]>>\n            change [steps v] by (1)\n            change y by (1)\n        end\n        if <(Steps) > [7]> then\n            change y by ((Steps) * (-1))\n            change x by ((XVel) * (-1))\n        end\n    end\nend\n\ndefine Gravity\nchange y by (Yvel)\nif <touching (level v)?> then\n    if <(Yvel) > [0]> then\n        change y by ((Yvel) * (-1))\n        set [yvel v] to [0]\n    else\n        if <key (up arrow v) pressed?> then\n            set [yvel v] to [12]\n        else\n            set [yvel v] to [0]\n        end\n        set [steps v] to [0]\n        repeat until <<not <touching (level v)?>> or <(Steps) > [20]>>\n            change y by (1)\n            change [steps v] by (1)\n        end\n        if <(Steps) > [20]> then\n            change y by ((Steps) * (-1))\n        end\n    end\nelse\n    if <(Yvel) > [-21]> then\n        change [yvel v] by (-1)\n    end\nend\n\nwhen flag clicked\nbroadcast (boot v) and wait\nset [inbathroom v] to [0]\ngo to [front v] layer\ngo [backward v] (2) layers\nset [yvel v] to [0]\nshow\ngo to x: (0) y: (0)\n\nchange x by (((x position) - (10)) / (-5))\nchange y by (((y position) - (10)) / (-5))\n\nwhen I receive [movement v]\nif <(@PlayerSlot) = [3]> then\n\ndefine Movement 2\n\nbroadcast (Movement v) and wait\n\nwhen I receive [start v]\nif <(@PlayerSlot) = [3]> then\n    set [xpos v] to [0]\n    set [ypos v] to [0]\n    go to x: ([x position v] of [teleporter v]) y: ([y position v] of [teleporter v])\nend\n\nwhen I receive [tick v]\nif <(@PlayerSlot) = [3]> then\n\nchange x by (((x position) - (round (() - (Xpos)))) / (-5))\nchange y by (((y position) - (round (() - (Ypos)))) / (-5))\n\nwhen I receive [tick v]\n\nwhen flag clicked\nset [username v] to (username)\nset [on? 3 v] to [1]\nforever\n    if <(@PlayerSlot) = [3]> then\n        Movement\n        think (username)\n    else\n        think (item (4) of [dpkg 1 v])\n        if <(item (5) of [dpkg 1 v]) = [1]> then\n            show\n        else\n            if <(item (5) of [dpkg 1 v]) = [0]> then\n                hide\n            end\n        end\n        switch costume to (item (6) of [dpkg 1 v])\n        point in direction (item (7) of [dpkg 1 v])\n    end\nend\n\nwhen flag clicked\nforever\n    set [check_time v] to ((timer) + (0.1))\nend\n\nwhen [timer v] > (Check_Time)\nset [on? 3 v] to [0]\nwait (5) seconds\n\nwhen flag clicked\nforever\n    if <(@PlayerSlot) = [3]> then\n        if <key (space v) pressed?> then\n            set [shot? 3 v] to [True]\n            wait (0.2) seconds\n        else\n            set [shot? 3 v] to [False]\n        end\n    end\nend\n\ndefine Movement\nset rotation style [left-right v]\nKey Presses\nGravity\nif <<touching (mouse-pointer v)?> and <mouse down?>> then\n    change [xpos v] by ((x position) / (5))\n    change [ypos v] by ((y position) / (5))\nelse\n    change [xpos v] by (x position)\n    change [ypos v] by (y position)\nend\ngo to x: (0) y: (0)\nbroadcast (tick v) and wait\n\n@P4\n\ndefine Gravity\nchange y by (Yvel)\nif <touching (level v)?> then\n    if <(Yvel) > [0]> then\n        change y by ((Yvel) * (-1))\n        set [yvel v] to [0]\n    else\n        if <key (up arrow v) pressed?> then\n            set [yvel v] to [12]\n        else\n            set [yvel v] to [0]\n        end\n        set [steps v] to [0]\n        repeat until <<not <touching (level v)?>> or <(Steps) > [20]>>\n            change y by (1)\n            change [steps v] by (1)\n        end\n        if <(Steps) > [20]> then\n            change y by ((Steps) * (-1))\n        end\n    end\nelse\n    if <(Yvel) > [-21]> then\n        change [yvel v] by (-1)\n    end\nend\n\ndefine Key Presses\nif <key (left arrow v) pressed?> then\n    point in direction (-90)\n    next costume\n    if <(XVel) > [-8]> then\n        change [xvel v] by (-2)\n    end\nelse\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n        next costume\n        if <(XVel) < [8]> then\n            change [xvel v] by (2)\n        end\n    else\n        if <(XVel) > [0]> then\n            change [xvel v] by (-1)\n        else\n            if <(XVel) < [0]> then\n                change [xvel v] by (1)\n            end\n        end\n    end\nend\nif <not <(XVel) = [0]>> then\n    change x by (XVel)\n    if <touching (level v)?> then\n        set [steps v] to [0]\n        repeat until <<not <touching (level v)?>> or <(Steps) > [7]>>\n            change [steps v] by (1)\n            change y by (1)\n        end\n        if <(Steps) > [7]> then\n            change y by ((Steps) * (-1))\n            change x by ((XVel) * (-1))\n        end\n    end\nend\n\nwhen flag clicked\nbroadcast (boot v) and wait\nset [inbathroom v] to [0]\ngo to [front v] layer\ngo [backward v] (2) layers\nset [yvel v] to [0]\nshow\ngo to x: (0) y: (0)\n\nwhen I receive [start v]\nif <(@PlayerSlot) = [4]> then\n    set [xpos v] to [0]\n    set [ypos v] to [0]\n    go to x: ([x position v] of [teleporter v]) y: ([y position v] of [teleporter v])\nend\n\nwhen I receive [tick v]\nif <(@PlayerSlot) = [3]> then\n\nchange x by (((x position) - (10)) / (-5))\nchange y by (((y position) - (10)) / (-5))\n\nwhen I receive [tick v]\n\nset [shot? 4 v] to [False]\n\nwhen flag clicked\nforever\n    if <(@PlayerSlot) = [4]> then\n        if <key (space v) pressed?> then\n            set [shot? 4 v] to [True]\n            wait (0.2) seconds\n        else\n            set [shot? 4 v] to [False]\n        end\n    end\nend\n\nwhen flag clicked\nset [username v] to (username)\nset [on? 4 v] to [1]\nforever\n    if <(@PlayerSlot) = [4]> then\n        Movement\n        think (username)\n    else\n        think (item (4) of [dpkg 2 v])\n        if <(item (5) of [dpkg 2 v]) = [1]> then\n            show\n        else\n            if <(item (5) of [dpkg 2 v]) = [0]> then\n                hide\n            end\n        end\n        switch costume to (item (6) of [dpkg 2 v])\n        point in direction (item (7) of [dpkg 2 v])\n    end\nend\n\nwhen flag clicked\nforever\n    set [check_time v] to ((timer) + (0.1))\nend\n\nwhen [timer v] > (Check_Time)\nset [on? 4 v] to [0]\nwait (5) seconds\n\ndefine Movement\nset rotation style [left-right v]\nKey Presses\nGravity\nif <<touching (mouse-pointer v)?> and <mouse down?>> then\n    change [xpos v] by ((x position) / (5))\n    change [ypos v] by ((y position) / (5))\nelse\n    change [xpos v] by (x position)\n    change [ypos v] by (y position)\nend\ngo to x: (0) y: (0)\nbroadcast (tick v) and wait\n\n@BannerStatus\n\nwhen flag clicked\nshow\nclear graphic effects\ngo to x: (0) y: (0)\ngo to [front v] layer\n\nwhen flag clicked\nswitch costume to (connecting v)\n\nwhen I receive [start v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [full v]\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nswitch costume to (full v)\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nclear graphic effects\n\n@Thumbnail\n\nwhen flag clicked\nset size to (100) %\ngo to [front v] layer\nclear graphic effects\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\n\nsaveData [3] [12] [12] [12] [0]\n\n@Cloud Chat\n\ndefine Send (message)\nadd (join (join (username) [: ]) (message)) to [chat v]\n\nwhen flag clicked\nset [c v] to [ abcdefghijklmnopqrstuvwxyz1234567890<>_ABCDEFGHIJKLMNOPQRSTUVWXYZ-!.,?/\'";:-=+\)\(*&^%$#@{}\[\]\|`~]\n\ndefine Encode\nset [i v] to [0]\nset [☁ chatting cloud data v] to []\nrepeat (length of (Chat))\n    change [i v] by (1)\n    set [j v] to [0]\n    repeat (length of (item (I) of [chat v]))\n        change [j v] by (1)\n        set [k v] to [0]\n        repeat until <<(letter (j) of (item (I) of [chat v])) = (letter (k) of (c))> or <(k) > (length of (c))>>\n            change [k v] by (1)\n        end\n        if <(k) > (length of (c))> then\n            set [k v] to (length of (c))\n        end\n        if <(k) < [10]> then\n            set [☁ chatting cloud data v] to (join (☁ Chatting Cloud Data) (join [0] (k)))\n        else\n            set [☁ chatting cloud data v] to (join (☁ Chatting Cloud Data) (k))\n        end\n    end\n    set [☁ chatting cloud data v] to (join (☁ Chatting Cloud Data) [00])\nend\n\ndefine Decode\nset [i v] to [1]\ndelete all of [chat v]\nadd [] to [chat v]\nrepeat ((length of (☁ Chatting Cloud Data)) / (2))\n    if <(join (letter (I) of (☁ Chatting Cloud Data)) (letter ((I) + (1)) of (☁ Chatting Cloud Data))) = [00]> then\n        add [] to [chat v]\n    else\n        replace item (last) of [chat v] with (join (item (last) of [chat v]) (letter (join (letter (I) of (☁ Chatting Cloud Data)) (letter ((I) + (1)) of (☁ Chatting Cloud Data))) of (c)))\n    end\n    change [i v] by (2)\nend\ndelete (last) of [chat v]\n\nwhen flag clicked\nshow list [chat v]\nshow list [whitelist v]\ngo to x: (189) y: (-155)\nhide\n\nshow\ngo to [front v] layer\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (0)\n        if <mouse down?> then\n            hide list [chat v]\n            hide list [whitelist v]\n            ask [Type the letter of the number representing the sentence.] and wait\n            Send (item (answer) of [whitelist v])\n            Encode\n            show list [chat v]\n            show list [whitelist v]\n        end\n    else\n        set [brightness v] effect to (-10)\n    end\nend\n\nwhen I receive [start v]\n\ndelete all of [chat v]\nset [☁ chatting cloud data v] to []\n\ndelete (all) of [chat v]\n\nDecode\n\ndelete (1) of [active check v]\n\nDecode\n\n@Level\n\nwhen flag clicked\nset size to (133) %\n\nwhen I receive [tick v]\ngo to x: ((Xpos) * (-1)) y: ((Ypos) * (-1))\n\nwhen I receive [boot v]\nset [xpos v] to [0]\nset [ypos v] to [0]\ngo to x: (0) y: (0)\nshow\nset size to (133) %\nswitch costume to (level v)\ngo [backward v] (5) layers\n\n@Other Edge.\n\nwhen I receive [tick v]\nshow\ngo to [front v] layer\n\n@Teleporter\n\nwhen flag clicked\nforever\nend\n\nwhen I receive [tick v]\ngo to x: ((Xpos) * (-1)) y: (((Ypos) * (-1)) + (-60))\nnext costume\n\n@Shots\n\nwhen flag clicked\n\nwhen I receive [tick v]\n\nwhen I start as a clone\nset [move v] to [2]\nshow\nif <(Shot ID) = [11]> then\n    repeat until <touching (level v)?>\n        wait (0.1) seconds\n        go to x: (((Xpos) - (-1)) + (Move)) y: ((Ypos) - (-1))\n        change [move v] by (2)\n    end\nend\nif <(Shot ID) = [12]> then\n    repeat until <touching (level v)?>\n        wait (0.1) seconds\n        go to x: ((round ((item (1) of [dpkg v]) - (Xpos))) + (Move)) y: (round ((item (2) of [dpkg v]) - (Ypos)))\n        change [move v] by (2)\n    end\nend\nset [move v] to [0]\ndelete this clone\n\nmove (10) steps\n\nhide\nif <(item (1) of [shot data v]) = [true]> then\n    if <(@PlayerSlot) = [1]> then\n        go to x: ((Xpos) - (-1)) y: ((Ypos) - (-1))\n        set [shot id v] to [11]\n        create clone of (_myself_ v)\n    end\n    if <(@PlayerSlot) = [2]> then\n        go to x: (round ((item (1) of [dpkg v]) - (Xpos))) y: (round ((item (2) of [dpkg v]) - (Ypos)))\n        set [shot id v] to [12]\n        create clone of (_myself_ v)\n    end\n    if <(@PlayerSlot) = [3]> then\n        go to x: (round ((item (1) of [dpkg v]) - (Xpos))) y: (round ((item (2) of [dpkg v]) - (Ypos)))\n        set [shot id v] to [12]\n        create clone of (_myself_ v)\n    end\n    if <(@PlayerSlot) = [4]> then\n        go to x: (round ((item (1) of [dpkg v]) - (Xpos))) y: (round ((item (2) of [dpkg v]) - (Ypos)))\n        set [shot id v] to [12]\n        create clone of (_myself_ v)\n    end\nend\n\nchange x by (Xpos)\nchange y by (Ypos)\n\nwhen I receive [tick v]\n\ngo to x: (0) y: (0)\n\nif <(item (2) of [shot data v]) = [true]> then\n    if <(@PlayerSlot) = [1]> then\n        go to x: ((Xpos) - (-1)) y: ((Ypos) - (-1))\n        set [shot id v] to [2]\n        create clone of (_myself_ v)\n    end\n    if <(@PlayerSlot) = [2]> then\n        go to x: (round ((item (1) of [dpkg v]) - (Xpos))) y: (round ((item (2) of [dpkg v]) - (Ypos)))\n        set [shot id v] to [2]\n        create clone of (_myself_ v)\n    end\nend\n\n
Instructions:\nArrows keys to move.\nRemember to press the green flag three \nFull screen recommended.\n\nThings to add:\n1. Variable in the top right corner to tell you who else is playing. (E.g. Players = 3)\n2. Bosses\n3. Players have guns, and can collect power ups to upgrade.