Odd Corridors - Platformer

Instructions: More of a demo/concept than a game. Have fun wandering around!

@Stage\n\n@bg\n\nwhen flag clicked\nswitch costume to (grid v)\ngo to x: (0) y: (0)\nset size to (100) %\nshow\ngo to [back v] layer\n\nwhen I receive [tick v]\ngo to x: (((() - (Cam X)) mod (40)) - ()) y: (((() - (Cam Y)) mod (40)) - (40))\n\n@Sprite1\n\nwhen flag clicked\nhide\nswitch costume to (1,0 v)\nclone [-1] [1]\nclone [-1] [0]\nclone [0] [0]\nclone [0] [1]\nclone [-2] [0]\nclone [-2] [10]\nclone [-1] [10]\nclone [0] [10]\nclone [0] [11]\nclone [-2] [11]\nclone [-1] [11]\nclone [1] [0]\nclone [1] [1]\nclone [1] [2]\nclone [2] [1]\nclone [3] [1]\n\nwhen I receive [tick v]\ngo to x: (((my x) * (480)) - (Cam X)) y: (((my y) * (360)) - (Cam Y))\nif <not <<(((my x) * (480)) - (Cam X)) = (x position)> and <(((my y) * (360)) - (Cam Y)) = (y position)>>> then\n    hide\nelse\n    show\nend\n\ndefine clone (x) (y)\nset [my x v] to (x)\nset [my y v] to (y)\nswitch costume to (join (my x) (join [,] (my y)))\nif <(costume [name v]) = (join (my x) (join [,] (my y)))> then\n    create clone of (_myself_ v)\nend\n\n@Player\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [cam x v] to [360]\nset [cam y v] to [320]\nset [xv v] to [0]\nset [yv v] to [0]\nset [x v] to [360]\nset [y v] to [320]\ngo to [front v] layer\nforever\n    go to x: ((X) - (Cam X)) y: ((Y) - (Cam Y))\n    if <key (left arrow v) pressed?> then\n        change [xv v] by (-4)\n    end\n    if <key (right arrow v) pressed?> then\n        change [xv v] by (4)\n    end\n    set [xv v] to ((Xv) * (0.7))\n    change x by (round (Xv))\n    if <touching color (#000000)?> then\n        Walls\n    end\n    change [yv v] by (-1)\n    if <<(In Air) < [4]> and <key (up arrow v) pressed?>> then\n        set [yv v] to [12]\n    end\n    change y by (round (Yv))\n    if <(In Air) < [10]> then\n        change [in air v] by (1)\n    end\n    if <touching color (#000000)?> then\n        Floors\n    end\n    set [x v] to ((x position) + (Cam X))\n    set [y v] to ((y position) + (Cam Y))\n    Magic\n    Camera\n    go to x: ((X) - (Cam X)) y: ((Y) - (Cam Y))\n    broadcast (tick v) and wait\nend\n\ndefine Walls\nif <not <key (q v) pressed?>> then\n    change y by (1)\n    if <touching color (#000000)?> then\n        change y by (-1)\n    end\n    repeat until <not <touching color (#000000)?>>\n        if <(Xv) > [0]> then\n            change x by (-1)\n        else\n            change x by (1)\n        end\n    end\n    set [xv v] to [0]\nend\n\ndefine Floors\nif <not <key (q v) pressed?>> then\n    repeat until <not <touching color (#000000)?>>\n        if <(Yv) > [0]> then\n            change y by (-1)\n        else\n            change y by (1)\n            set [in air v] to [0]\n        end\n    end\n    set [yv v] to [0]\nend\n\ndefine Magic\nif <not <key (w v) pressed?>> then\n    if <(X) > [1060]> then\n        change [x v] by (-120)\n        change [cam x v] by (-120)\n    end\n    if <<<(X) > [400]> and <[525] > (X)>> and <[-100] > (Y)>> then\n        change [y v] by (720)\n        change [cam y v] by (720)\n        change [x v] by (-60)\n        change [cam x v] by (-60)\n    end\n    if <<<(X) > [-60]> and <[-40] > (X)>> and <<[300] > (Y)> and <(Y) > [180]>>> then\n        change [y v] by (3600)\n        change [cam y v] by (3600)\n    end\n    if <<<(X) > [-40]> and <[-20] > (X)>> and <<[3900] > (Y)> and <(Y) > [3780]>>> then\n        change [y v] by (-3600)\n        change [cam y v] by (-3600)\n    end\n    if <<<(X) > [-1040]> and <[-970] > (X)>> and <<[3900] > (Y)> and <(Y) > [3780]>>> then\n        change [y v] by (-3600)\n        change [cam y v] by (-3600)\n        change [x v] by (720)\n        change [cam x v] by (720)\n    end\n    if <<<(X) > [-220]> and <[-160] > (X)>> and <<[300] > (Y)> and <(Y) > [180]>>> then\n        change [y v] by (3600)\n        change [cam y v] by (3600)\n        change [x v] by (-720)\n        change [cam x v] by (-720)\n    end\nend\n\ndefine Camera\nchange [cam x v] by (round (((X) - (Cam X)) / (4)))\nchange [cam y v] by (((Y) + (80)) - (Cam Y))\n\nchange [cam y v] by (-720)\nbroadcast (tick v)\n\n@Sprite2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nforever\n    go to [front v] layer\nend\n\n