Squares a scrolling platformer

Instructions: Arrow keys to move. R to reset.\nThis took me so long to make so please like and star.\nTry to get to the blue portal without touching any red.\nYou can wall jump.\nWill add music soon

@Stage\n\n@Player\n\nwhen flag clicked\npoint in direction (90)\nset size to (112) %\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    broadcast (Tick v)\nend\n\ndefine Tick\nif <<<touching color (#ff0000)?> or <(Sy) > [614]>> or <key (r v) pressed?>> then\n    set [sx v] to [789]\n    set [sy v] to [300]\nend\nswitch costume to (costume1 v)\nif <key (right arrow v) pressed?> then\n    change [xv v] by (1)\nend\nif <key (left arrow v) pressed?> then\n    change [xv v] by (-1)\nend\nchange x by (Xv)\nset [xv v] to ((Xv) * (0.9))\nif <touching color (#000000)?> then\n    change y by (1)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change x by ((Xv) * (-1.1))\n                        change y by (-5)\n                        if <key (up arrow v) pressed?> then\n                            if <(Xv) > [0]> then\n                                set [xv v] to [-10]\n                            else\n                                set [xv v] to [10]\n                            end\n                            set [yv v] to [15]\n                        else\n                            set [xv v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange [yv v] by (-1)\nchange y by (Yv)\nif <touching color (#000000)?> then\n    change y by ((Yv) * (-1))\n    set [yv v] to [0]\nend\nchange y by (-1)\nif <key (up arrow v) pressed?> then\n    if <touching color (#000000)?> then\n        set [yv v] to [15]\n    end\nend\nchange y by (1)\nchange [sx v] by ((x position) * (-1))\nchange [sy v] by ((y position) * (-1))\ngo to x: (0) y: (0)\nif <touching color (#002cf7)?> then\n    broadcast (Next Level v)\nend\nif <<key (up arrow v) pressed?> and <<not <key (left arrow v) pressed?>> and <not <key (right arrow v) pressed?>>>> then\n    switch costume to (up v)\nend\nif <<key (left arrow v) pressed?> and <<not <key (up arrow v) pressed?>> and <not <key (right arrow v) pressed?>>>> then\n    switch costume to (left v)\nend\nif <<key (right arrow v) pressed?> and <<not <key (up arrow v) pressed?>> and <not <key (left arrow v) pressed?>>>> then\n    switch costume to (right v)\nend\nif <<key (right arrow v) pressed?> and <<key (up arrow v) pressed?> and <not <key (left arrow v) pressed?>>>> then\n    switch costume to (up right v)\nend\nif <<key (left arrow v) pressed?> and <<key (up arrow v) pressed?> and <not <key (right arrow v) pressed?>>>> then\n    switch costume to (up left v)\nend\nif <not <<key (left arrow v) pressed?> or <<key (up arrow v) pressed?> or <key (right arrow v) pressed?>>>> then\n    switch costume to (still v)\nend\nif <touching color (#fbff00)?> then\n    broadcast (warning v)\nend\nif <touching color (#9966ff)?> then\n    broadcast (warning 2 v)\nend\n\nwhen I receive [tick v]\nTick\n\n@Level\n\nwhen flag clicked\npoint in direction (90)\nswitch costume to (blank v)\nset size to (400) %\nswitch costume to (level 1 v)\np\nforever\n    go to x: (Sx) y: (Sy)\nend\n\ndefine p\nset [sx v] to [789]\nset [sy v] to [300]\n\nwhen I receive [next level v]\nnext costume\np\n\nwhen I receive [warning v]\nswitch costume to (level 11 v)\np\n\nwhen I receive [warning 2 v]\nswitch costume to (level 10 v)\np\n\n@Thumb Nail\n\nwhen flag clicked\ngo to [front v] layer\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\n\n