Epic Scrolling Platformer

Instructions: Arrow keys or WAD.\n\nJust a simple fun scrolling platformer. Get to the blue portal. Don't touch red. \n

@Stage\n\nwhen flag clicked\nforever\n    play sound [250 v] until done\nend\n\n@Player\n\nwhen flag clicked\nset [xv v] to [0]\nset [yv v] to [0]\nset [scroll x v] to [230]\nset [scroll y v] to [0]\nset size to (50) %\nshow\nforever\n    Movement\nend\n\ndefine Movement\nforever\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [xv v] by (-1)\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [xv v] by (1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching color (#00ff0f)?> then\n        change y by (1)\n        if <touching color (#00ff0f)?> then\n            change y by (1)\n            if <touching color (#00ff0f)?> then\n                change y by (1)\n                if <touching color (#00ff0f)?> then\n                    change y by (1)\n                end\n                if <touching color (#00ff0f)?> then\n                    change y by (1)\n                    if <touching color (#00ff0f)?> then\n                        change x by ((Xv) * (-1))\n                        change y by (-5)\n                        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                            if <(Xv) > [0]> then\n                                set [xv v] to [-5]\n                            else\n                                set [xv v] to [5]\n                            end\n                            set [yv v] to [12]\n                        else\n                            set [xv v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <touching color (#00ff0f)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#00ff0f)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [yv v] to [12]\n        end\n    end\n    change y by (1)\n    change [scroll x v] by ((x position) * (-1))\n    change [scroll y v] by ((y position) * (-1))\n    go to x: (0) y: (0)\n    if <<touching color (#ff1212)?> or <(Scroll Y) > [500]>> then\n        repeat (3)\n            hide\n            wait (0.1) seconds\n            show\n            wait (0.1) seconds\n        end\n        set [scroll x v] to [230]\n        set [scroll y v] to [0]\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    if <touching color (#00b3ff)?> then\n        repeat (12)\n            turn right (30) degrees\n            change size by (-5)\n        end\n        set size to (50) %\n        broadcast (Next Level v)\n        set [scroll x v] to [230]\n        set [scroll y v] to [0]\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    if <touching color (#fffa00)?> then\n        set [yv v] to [19]\n    end\n    if <touching color (#f483ff)?> then\n        set [xv v] to [19]\n    end\n    if <touching color (#bb00ff)?> then\n        set [xv v] to [-19]\n    end\nend\n\ndefine Die\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nset [scroll x v] to [190]\nset [scroll y v] to [0]\n\n@Platforms\n\nwhen flag clicked\nswitch costume to (1 v)\nforever\n    go to x: (Scroll X) y: (Scroll Y)\nend\n\nwhen I receive [next level v]\nnext costume\n\n@Thumb\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\n\n