Glitch - A Platformer (Part 2)

Instructions: Use WASD  or arrows keys to move.\nThe other instructions you should know from Part 1.\n\nPart 1:\nhttps://scratch.mit.edu/projects/339152686/\n\nSorry for releasing it so late, I was just very busy with school :(

@Stage\n\nwhen flag clicked\nbroadcast (Start v)\nforever\n    play sound [TheFatRat_-_Xenogenesis_ v] until done\nend\n\n@Ground\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nforever\n    if <(costume [number v]) = [13]> then\n        set [last level? v] to [True]\n    end\nend\n\n@Glitch\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\n\n@Player\n\ndefine Touch Ground <up?>\nchange [falling? v] by (1)\nrepeat until <not <touching (ground v)?>>\n    if <up?> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [falling? v] to [0]\n    end\n    set [speed y v] to [0]\nend\nchange y by (-1)\n\ndefine Walk (direction) (speed)\npoint in direction (direction)\nchange x by (speed)\nset [slope v] to [0]\nrepeat until <<(slope) = [8]> or <not <touching (ground v)?>>>\n    change y by (1)\n    change [slope v] by (1)\nend\nif <(slope) = [8]> then\n    change x by ((0) - (speed))\n    change y by ((0) - (slope))\nend\n\nwhen I receive [start v]\nset size to (75) %\ngo to [front v] layer\nset rotation style [left-right v]\npoint in direction (90)\ngo to x: (-180) y: (-120)\nset [ghost v] effect to (0)\nshow\nset [speed y v] to [0]\nset [falling? v] to [10]\nforever\n    switch costume to (player v)\n    change [speed y v] by (-1)\n    change y by (speed y)\n    Touch Ground <(speed y) > [0]>\n    if <touching (virus v)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        set [speed y v] to [0]\n        go to x: (-180) y: (-120)\n        set [ghost v] effect to (0)\n    end\n    if <touching color (#0068ff)?> then\n        if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n            Walk (-90) (-10)\n        end\n        if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n            Walk (90) (10)\n        end\n    else\n        if <touching color (#ff00e3)?> then\n            if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n                Walk (-90) (-2)\n            end\n            if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                Walk (90) (2)\n            end\n        else\n            if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n                Walk (-90) (-6)\n            end\n            if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                Walk (90) (6)\n            end\n        end\n    end\n    if <<<key (s v) pressed?> or <key (down arrow v) pressed?>> and <(falling?) < [3]>> then\n        set [speed y v] to [15]\n    end\n    if <touching color (#ff9700)?> then\n        set [speed y v] to [20]\n    end\n    if <(y position) < [-179]> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        set [speed y v] to [0]\n        go to x: (-180) y: (-120)\n        set [ghost v] effect to (0)\n    end\n    if <(x position) > [219]> then\n        broadcast (Next level v)\n    end\nend\n\nwhen I receive [next level v]\ngo to x: (-180) y: (-120)\n\n@Text\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\n\n@Virus\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\n\n@Other\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\n\n@Skip\n\nwhen I receive [start v]\ngo to x: (-210) y: (-157.5)\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (20)\n        if <(Last Level?) = [False]> then\n            if <mouse down?> then\n                broadcast (Next Level v)\n                wait (0.5) seconds\n            end\n        end\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\n@Restart\n\nwhen I receive [start v]\ngo to x: (-150) y: (-157.5)\nset [last level? v] to [False]\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (20)\n        if <mouse down?> then\n            broadcast (Start v)\n            wait (0.5) seconds\n        end\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\nhide variable [last level? v]\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\ngo to [front v] layer\nforever\n    go to [front v] layer\nend\n\nshow\ngo to [front v] layer\ngo to x: (0) y: (0)\nclear graphic effects\n\n