Möbius - 2P Platformer

Instructions: Welcome to the weird world of Möbius strips. This is what happens if you lived on a 2D paper with a 3D twist in it.\n\nArrow Keys to move P1\nWASD to move P2\n\nIf I get enough loves I'll make this into a battle or tag game.

@Stage\n\n@Sprite3\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    go to [front v] layer\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\ngenerate\nset [scroll x 1 v] to [480]\nbroadcast (message1 v)\nforever\n    if <(scroll x 1) > [2400]> then\n        set [scroll x 1 v] to [480]\n    end\n    if <[480] > (scroll x 1)> then\n        set [scroll x 1 v] to [2400]\n    end\nend\n\nwhen I start as a clone\nset size to (104) %\nshow\n\ndefine generate\nset [id v] to [1]\nswitch costume to (parta v)\nrepeat (6)\n    create clone of (_myself_ v)\n    next costume\n    change [id v] by (1)\nend\n\nwhen I receive [position v]\ngo to x: (((id) * (480)) - (scroll x 1)) y: (85)\n\n@Sprite2\n\nwhen flag clicked\nhide\ngenerate\nset [scroll x 2 v] to [480]\nforever\n    if <(scroll x 2) > [2400]> then\n        set [scroll x 2 v] to [480]\n    end\n    if <[480] > (scroll x 2)> then\n        set [scroll x 2 v] to [2400]\n    end\nend\n\nwhen I start as a clone\nset size to (104) %\nshow\n\ndefine generate\nset [id v] to [1]\nswitch costume to (parta v)\nrepeat (6)\n    create clone of (_myself_ v)\n    next costume\n    change [id v] by (1)\nend\n\nwhen I receive [position2 v]\ngo to x: (((id) * (480)) - (scroll x 2)) y: (-85)\n\n@player1\n\nwhen I receive [message1 v]\nswitch costume to (costume1 v)\nset [id v] to [1]\nrepeat (5)\n    create clone of (_myself_ v)\n    change [id v] by (1)\nend\nset [id v] to [0]\ngo to x: (75) y: (50)\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <key (left arrow v) pressed?> then\n        change [xv v] by (-2)\n        point in direction (-90)\n    end\n    if <key (right arrow v) pressed?> then\n        change [xv v] by (2)\n        point in direction (90)\n    end\n    set [xv v] to ((xv) * (0.8))\n    change x by (round (xv))\n    Walls\n    change [yv v] by (-1)\n    if <<key (up arrow v) pressed?> and <(can jump?) = [1]>> then\n        set [yv v] to [9]\n    end\n    change y by (yv)\n    Floor\n    change [scroll x 1 v] by (round ((x position) / (4)))\n    change x by (() - (round ((x position) / (4))))\n    broadcast (position v)\n    set [p1 x v] to ((x position) + (scroll x 1))\n    set [p1 y v] to ((y position) + (-85))\nend\n\ndefine Walls\nif <touching color (#040404)?> then\n    change y by (4)\n    if <touching color (#040404)?> then\n        change y by (-4)\n        repeat until <not <touching color (#040404)?>>\n            change x by ((() - (xv)) / ([abs v] of (xv) ))\n        end\n        set [xv v] to [0]\n    else\n        repeat until <touching color (#040404)?>\n            change y by (-1)\n        end\n        change y by (1)\n    end\nend\n\ndefine Floor\nset [can jump? v] to [0]\nif <touching color (#040404)?> then\n    repeat until <not <touching color (#040404)?>>\n        change y by ((() - (yv)) / ([abs v] of (yv) ))\n    end\n    if <(yv) < [0]> then\n        set [can jump? v] to [1]\n    end\n    set [yv v] to [0]\nend\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nforever\n    point in direction ([direction v] of [player1 v])\n    if <(id) = [1]> then\n        go to x: ((P1 X) - (scroll x 2)) y: ((P1 Y) + (-85))\n    end\n    if <(id) = [2]> then\n        go to x: (((P1 X) - (scroll x 2)) + (1920)) y: ((P1 Y) + (-85))\n    end\n    if <(id) = [3]> then\n        go to x: (((P1 X) - (scroll x 2)) + (-1920)) y: ((P1 Y) + (-85))\n    end\n    if <(id) = [4]> then\n        go to x: (((P1 X) - (scroll x 2)) + (960)) y: ((() - (P1 Y)) + (-85))\n        switch costume to (costume2 v)\n    end\n    if <(id) = [5]> then\n        go to x: (((P1 X) - (scroll x 2)) + (-960)) y: ((() - (P1 Y)) + (-85))\n        switch costume to (costume2 v)\n    end\nend\n\n@player2\n\nwhen I receive [message1 v]\nswitch costume to (costume1 v)\nset [id v] to [1]\nrepeat (5)\n    create clone of (_myself_ v)\n    change [id v] by (1)\nend\nset [id v] to [0]\ngo to x: (100) y: (-135)\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <key (a v) pressed?> then\n        change [xv v] by (-2)\n        point in direction (-90)\n    end\n    if <key (d v) pressed?> then\n        change [xv v] by (2)\n        point in direction (90)\n    end\n    set [xv v] to ((xv) * (0.8))\n    change x by (round (xv))\n    Walls\n    change [yv v] by (-1)\n    if <<key (w v) pressed?> and <(can jump?) = [1]>> then\n        set [yv v] to [9]\n    end\n    change y by (yv)\n    Floor\n    change [scroll x 2 v] by (round ((x position) / (4)))\n    change x by (() - (round ((x position) / (4))))\n    broadcast (position2 v)\n    set [p2 x v] to ((x position) + (scroll x 2))\n    set [p2 y v] to ((y position) + (85))\nend\n\ndefine Walls\nif <touching color (#040404)?> then\n    change y by (4)\n    if <touching color (#040404)?> then\n        change y by (-4)\n        repeat until <not <touching color (#040404)?>>\n            change x by ((() - (xv)) / ([abs v] of (xv) ))\n        end\n        set [xv v] to [0]\n    else\n        repeat until <touching color (#040404)?>\n            change y by (-1)\n        end\n        change y by (1)\n    end\nend\n\ndefine Floor\nset [can jump? v] to [0]\nif <touching color (#040404)?> then\n    repeat until <not <touching color (#040404)?>>\n        change y by ((() - (yv)) / ([abs v] of (yv) ))\n    end\n    if <(yv) < [0]> then\n        set [can jump? v] to [1]\n    end\n    set [yv v] to [0]\nend\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nforever\n    point in direction ([direction v] of [player2 v])\n    if <(id) = [1]> then\n        go to x: ((P2 X) - (scroll x 1)) y: ((P2 Y) + (85))\n    end\n    if <(id) = [2]> then\n        go to x: (((P2 X) - (scroll x 1)) + (1920)) y: ((P2 Y) + (85))\n    end\n    if <(id) = [3]> then\n        go to x: (((P2 X) - (scroll x 1)) + (-1920)) y: ((P2 Y) + (85))\n    end\n    if <(id) = [4]> then\n        go to x: (((P2 X) - (scroll x 1)) + (960)) y: ((() - (P2 Y)) + (85))\n        switch costume to (costume2 v)\n    end\n    if <(id) = [5]> then\n        go to x: (((P2 X) - (scroll x 1)) + (-960)) y: ((() - (P2 Y)) + (85))\n        switch costume to (costume2 v)\n    end\nend\n\n