Paper Platformer

Instructions: DOUBLE CLICK THE FLAG\n\nPaper -A Platformer-\n\nArrow keys to move. Down to crouch. Don't touch rips in the paper. The pink portals teleport you. Click the restart button to restart. Remember to heart, star and follow!\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nyeet

@Stage\n\nwhen flag clicked\nset volume to (75) %\nforever\n    play sound [TheFatRat & JJD - Prelude \(VIP Edit\) v] until done\nend\n\n@Sprite1\n\nwhen flag clicked\nset [ghost v] effect to (0)\nswitch costume to (costume v)\nshow\ngo to x: (-180) y: (-127)\nset [x v] to [0]\nset [y v] to [0]\nforever\n    if <key (right arrow v) pressed?> then\n        change [x v] by (0.5)\n    end\n    if <key (left arrow v) pressed?> then\n        change [x v] by (-0.5)\n    end\n    change x by (X)\n    set [x v] to ((X) * (0.9))\n    if <touching color (#676767)?> then\n        change y by (0.5)\n        if <touching color (#676767)?> then\n            change y by (0.5)\n            if <touching color (#676767)?> then\n                change y by (0.5)\n                if <touching color (#676767)?> then\n                    change y by (0.5)\n                    if <touching color (#676767)?> then\n                        change y by (0.5)\n                        if <touching color (#676767)?> then\n                            change y by (0.5)\n                            if <touching color (#676767)?> then\n                                change y by (0.5)\n                                if <touching color (#676767)?> then\n                                    change y by (0.5)\n                                    if <key (up arrow v) pressed?> then\n                                        if <[0] < (X)> then\n                                            set [x v] to [-7]\n                                        else\n                                            set [x v] to [7]\n                                        end\n                                        set [y v] to [10]\n                                    else\n                                        set [x v] to ((X) * (-1.3))\n                                        change x by (X)\n                                        set [x v] to [0]\n                                        change x by ((X) / (5))\n                                    end\n                                    change y by (-4)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y v] by (-0.5)\n    change y by (Y)\n    if <touching color (#676767)?> then\n        set [y v] to ((Y) * (-0.25))\n        change y by (Y)\n        if <touching color (#676767)?> then\n            change y by (Y)\n            if <touching color (#676767)?> then\n                change y by (Y)\n                if <touching color (#676767)?> then\n                    change y by (Y)\n                end\n            end\n        end\n    end\n    change y by (-1)\n    if <<key (up arrow v) pressed?> and <touching color (#676767)?>> then\n        set [y v] to [10]\n    end\n    change y by (1)\n    if <touching (rip \(get it\) v)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        go to x: (-180) y: (-127)\n        set [ghost v] effect to (0)\n    end\n    if <key (down arrow v) pressed?> then\n        switch costume to (costume1 v)\n    else\n        switch costume to (costume v)\n    end\n    if <touching (1 v)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        go to (2 v)\n        set [ghost v] effect to (0)\n        start sound [Pop v]\n    end\nend\n\nwhen I receive [next level v]\ngo to x: (-180) y: (-127)\n\ngo to x: (-180) y: (-127)\n\nwhen I receive [restart v]\ngo to x: (-180) y: (-127)\n\n@Sprite2\n\n@Sprite3\n\nwhen I receive [next level v]\nnext costume\nwait (0.5) seconds\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [10]> then\n        broadcast (portal v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [12]> then\n        broadcast (end v)\n        stop [this script v]\n    end\nend\n\n@rip (get it)\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\n@Sprite4\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    if <touching (sprite1 v)?> then\n        broadcast (next level v)\n    end\nend\n\n@1\n\nwhen flag clicked\nhide\n\nwhen I receive [portal v]\nshow\n\nwhen I receive [end v]\nhide\n\nwhen I receive [restart v]\n\n@2\n\nwhen flag clicked\nhide\n\nwhen I receive [portal v]\nshow\n\nwhen I receive [end v]\nhide\n\n@Sprite5\n\nwhen flag clicked\ngo to [front v] layer\nshow\nset [ghost v] effect to (100)\n\nset [ghost v] effect to (0)\n\n@restart\n\nwhen flag clicked\nset [ghost v] effect to (50)\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (20)\n        if <mouse down?> then\n            broadcast (restart v)\n        end\n    else\n        set [ghost v] effect to (50)\n    end\nend\n\n