Goodbye: A Platformer

Instructions: Welcome to Goodbye: A platformer! All levels 100% possible! DOUBLE CLICK FLAG TO START!\n \nInstructions: Arrow keys, WASD, and touchscreen to move! \nHit R to restart and S to skip\nAvoid all spikes and acid (the green stuff)!

@Stage\n\n@Player\n\nwhen flag clicked\nswitch backdrop to (backdrop2 v)\nhide\n\ndefine Platformer Physics\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > [0]>>> then\n    change [x velocity v] by (1)\n    switch costume to (right v)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < [0]>>> then\n    change [x velocity v] by (-1)\n    switch costume to (left v)\nend\nchange x by (X Velocity)\nif <touching (level v)?> then\n    change y by (1)\nend\nif <touching (level v)?> then\n    change y by (1)\nend\nif <touching (level v)?> then\n    change y by (1)\nend\nif <touching (level v)?> then\n    change y by (1)\nend\nif <touching (level v)?> then\n    change x by ((X Velocity) * (-1))\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > [0]>>> then\n        set [y velocity v] to [9]\n        if <(X Velocity) > [0]> then\n            set [x velocity v] to [-7]\n        else\n            set [x velocity v] to [7]\n        end\n    else\n        set [x velocity v] to [0]\n    end\nelse\n    set [x velocity v] to ((X Velocity) * (0.8500))\nend\nchange y by (Y Velocity)\nif <touching (level v)?> then\n    change y by ((Y Velocity) * (-1))\n    set [y velocity v] to [0]\n    if <(Jumping Lock) = [1]> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > [0]>>> then\n            set [y velocity v] to [12]\n            set [jumping lock v] to [0]\n        end\n    end\nelse\n    change [y velocity v] by (-1)\n    set [jumping lock v] to [1]\nend\nif <(x position) > [235]> then\n    change [levels v] by (1)\n    broadcast (Next Level v)\nend\nif <touching (spikes v)?> then\n    set [x velocity v] to [0]\n    set [y velocity v] to [0]\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    broadcast (Restart v)\n    repeat (20)\n        change [ghost v] effect by (-5)\n    end\nend\nif <touching (portal v)?> then\n    go to (second portal v)\nend\nif <key (r v) pressed?> then\n    set [x velocity v] to [0]\n    set [y velocity v] to [0]\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    broadcast (Restart v)\n    repeat (20)\n        change [ghost v] effect by (-5)\n    end\n    wait until <not <key (r v) pressed?>>\nend\nif <key (s v) pressed?> then\n    change [levels v] by (1)\n    broadcast (Next Level v)\n    wait until <not <key (s v) pressed?>>\nend\nif <touching (trampoline v)?> then\n    set [y velocity v] to [20]\nend\ncreate clone of (_myself_ v)\n\nwhen [timer v] > (Timer)\nswitch backdrop to (backdrop1 v)\nhide\n\nwhen I start as a clone\nswitch costume to (trail v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-4)\nend\ndelete this clone\n\nwhen I receive [next level v]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\ngo to x: (-208) y: (-52)\nswitch costume to (right v)\n\nwhen I receive [restart v]\nswitch costume to (right v)\ngo to x: (-208) y: (-52)\n\nwhen flag clicked\nforever\n    set [timer v] to ((timer) + (0.1))\nend\n\nwhen flag clicked\ngo to [front v] layer\nset size to (100) %\nswitch backdrop to (backdrop1 v)\nshow\nswitch costume to (right v)\ngo to x: (-208) y: (-52)\nset [timer v] to [0.1]\nset [levels v] to [1]\nforever\n    Platformer Physics\nend\n\nwhen flag clicked\nforever\n    play sound [Juice WRLD - Lucid DreamsThe Theorist Piano Cover v] until done\nend\n\n@Fading Screen\n\nwhen [timer v] > (Timer)\nhide\n\nwhen I receive [fade v]\nset [ghost v] effect to (100)\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nbroadcast (Intro Done v)\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\n\n@Level\n\nwhen [timer v] > (Timer)\nhide\n\nwhen flag clicked\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\ngo to [front v] layer\ngo [backward v] (1) layers\nswitch costume to (level 1 v)\nshow\ngo to x: (0) y: (0)\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\nwhen [timer v] > (Timer)\nshow\n\n@Komisch Effect\n\nwhen I start as a clone\nshow\ngo to [back v] layer\nset [ghost v] effect to (pick random (45) to (90))\nset size to (pick random (40) to (70)) %\ngo to x: (240) y: (pick random (180) to (-180))\nglide (pick random (1.0) to (3.0)) secs to x: (-240) y: (pick random (180) to (-180))\ndelete this clone\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\n    wait (0.2) seconds\nend\n\n@Spikes\n\nwhen I receive [next level v]\nnext costume\n\nwhen [timer v] > (Timer)\nhide\n\nwhen flag clicked\ngo to [front v] layer\ngo [backward v] (3) layers\nswitch costume to (1 v)\nshow\n\n@Portal\n\nwhen I start as a clone\nrepeat (10)\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\nwhen I receive [next level v]\nnext costume\n\nwhen [timer v] > (Timer)\nhide\n\nwhen flag clicked\ngo to [back v] layer\nset [ghost v] effect to (50)\ngo to x: (-100) y: (-42)\nswitch costume to (1 v)\nshow\nforever\n    create clone of (_myself_ v)\n    set size to (70) %\n    turn right (4) degrees\nend\n\n@Second Portal\n\nwhen I start as a clone\nrepeat (10)\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\nwhen I receive [next level v]\nnext costume\n\nwhen [timer v] > (Timer)\nhide\n\nwhen flag clicked\ngo to [back v] layer\nset [ghost v] effect to (50)\ngo to x: (156) y: (-46)\nswitch costume to (1 v)\nshow\nforever\n    create clone of (_myself_ v)\n    set size to (70) %\n    turn left (4) degrees\nend\n\n@Trampoline\n\nwhen I receive [next level v]\nnext costume\n\nwhen [timer v] > (Timer)\nhide\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\ngo to [front v] layer\ngo [backward v] (2) layers\n\n@Story\n\nwhen [timer v] > (Timer)\nhide\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\ngo to [front v] layer\ngo [backward v] (4) layers\nswitch costume to (1 v)\ngo to x: (0) y: (0)\nshow\n\n@Toxic Factory\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\ngo to [back v] layer\nswitch costume to (1 v)\ngo to x: (0) y: (0)\nshow\ngo to [back v] layer\n\nwhen [timer v] > (Timer)\nhide\n\nwhen I receive [next level v]\nnext costume\n\n