Glitch - A Platformer

Instructions: ATTENTION: SEQUEL 1 https://scratch.mit.edu/projects/395712725/\nHi, welcome to probably my favorite platformer.\nMobile friendly\nwad\narrows\nhave fun\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\n\n\n\nle gasp you scrolled >:O

@Stage\n\n@Level\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\nforever\n    switch costume to (LV)\nend\n\nwhen I receive [end v]\nhide\n\n@player\n\nwhen I receive [start project v]\nforever\n    if <<[240] < (x position)> and <(dead?) = [0]>> then\n        broadcast (NAXT LEVEL v)\n        change [lv v] by (1)\n        reset\n    end\nend\n\nwhen flag clicked\nset [ended? v] to [0]\nhide variable [xv v]\nhide variable [dead? v]\nhide variable [lv v]\nhide variable [yv v]\nhide\nbroadcast (Start Project v)\n\nwhen I receive [start project v]\nset [dead? v] to [0]\nset [lv v] to [1]\nset size to (20) %\nreset\nforever\n    go to [front v] layer\n    if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> and <(dead?) = [0]>> then\n        switch costume to (1 v)\n        change [xv v] by (1)\n    end\n    if <<<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> and <(dead?) = [0]>> then\n        switch costume to (2 v)\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (.9))\n    change x by (Xv)\n    if <touching (level v)?> then\n        change y by (2)\n        if <touching (level v)?> then\n            change y by (2)\n        end\n        if <touching (level v)?> then\n            change y by (2)\n            if <touching (level v)?> then\n                change y by (2)\n                if <touching (level v)?> then\n                    change y by (2)\n                    if <touching (level v)?> then\n                        change x by ((Xv) * (-2))\n                        change y by (-5)\n                        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (10))>>>> then\n                            if <(Xv) > [0]> then\n                                set [xv v] to [-15]\n                            else\n                                set [xv v] to [15]\n                            end\n                            set [yv v] to [20]\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 (-0.8)\n    change y by (Yv)\n    if <touching (level v)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching (level v)?> then\n        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (10))>>>> then\n            set [yv v] to [12]\n        end\n    end\n    change y by (1)\n    if <touching (spikes v)?> then\n        Dead\n    end\n    if <(y position) < [-180]> then\n        Dead\n    end\n    if <touching color (#0077ff)?> then\n        broadcast (end v)\n        hide\n    end\n    if <touching color (#efff00)?> then\n        broadcast (coin v)\n    end\nend\n\nwhen I receive [start project v]\nset [lv v] to [1]\nforever\n    create clone of (_myself_ v)\nend\n\ndefine reset\nclear graphic effects\npoint in direction (90)\ngo to x: (-201) y: (30)\nswitch costume to (1 v)\nset [dead? v] to [0]\nset [xv v] to [0]\nset [yv v] to [0]\nset size to (20) %\nshow\n\ndefine Dead\nif <(ended?) = [0]> then\n    start sound [Crunch v]\n    set [dead? v] to [1]\n    repeat (25)\n        change [ghost v] effect by (4)\n    end\n    reset\nend\n\nwhen I start as a clone\nswitch costume to (3 v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-1.5)\nend\ndelete this clone\n\nif <touching (bouncy v)?> then\n    set [yv v] to [15]\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (100)\n\nwhen I receive [end v]\nset [ended? v] to [1]\nset [ghost v] effect to (0)\n\n@Spikes\n\nwhen flag clicked\nshow\nforever\n    switch costume to (LV)\nend\n\nwhen I receive [end v]\nhide\n\n@Coins\n\nwhen flag clicked\nset [ghost v] effect to (0)\nset [coins v] to [0]\nforever\n    if <(LV) = [1]> then\n        set [ghost v] effect to (0)\n        go to x: (125) y: (-96)\n        stop [this script v]\n    end\nend\n\nwhen I receive [coin v]\nstart sound [Coin v]\nchange [coins v] by (1)\nset [ghost v] effect to (100)\n\nwhen flag clicked\nset [ghost v] effect to (0)\nset [coins v] to [0]\nforever\n    if <(LV) = [2]> then\n        set [ghost v] effect to (0)\n        go to x: (-36) y: (-66)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (0)\nset [coins v] to [0]\nforever\n    if <(LV) = [3]> then\n        set [ghost v] effect to (0)\n        go to x: (23) y: (-78)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (0)\nset [coins v] to [0]\nforever\n    if <(LV) = [4]> then\n        set [ghost v] effect to (0)\n        go to x: (-107) y: (-86)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (0)\nset [coins v] to [0]\nforever\n    if <(LV) = [5]> then\n        set [ghost v] effect to (0)\n        go to x: (19) y: (-9)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (0)\nset [coins v] to [0]\nforever\n    if <(LV) = [6]> then\n        set [ghost v] effect to (0)\n        go to x: (99) y: (118)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (0)\nset [coins v] to [0]\nforever\n    if <(LV) = [7]> then\n        set [ghost v] effect to (0)\n        go to x: (0) y: (-4)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (0)\nset [coins v] to [0]\nforever\n    if <(LV) = [8]> then\n        set [ghost v] effect to (0)\n        go to x: (31) y: (-24)\n        stop [this script v]\n    end\nend\n\n@Level2\n\nwhen flag clicked\nhide\nswitch costume to (costume8 v)\nforever\n    if <(LV) = [8]> then\n        show\n    end\nend\n\nwhen I receive [end v]\nhide\n\n