Lights || A platformer

Instructions: Hello!\nWelcome to this platformer (my first platformer) called "Lights".\n                                      --History--\nAs it says in the game, the Earth is in complete darkness. Your mission will be to collect the 7 colored lights so that light can return to our planet.\n                                --How to play-- \nTo move you can use the arrow keys or a, w and d.\n\nHope you enjoy it and good luck!\n\nDon't forget to love and fave this project and follow me! 

@Stage\n\n@Player\n\nwhen flag clicked\nshow\nset [the level v] to [1]\nbroadcast (Next Level v)\nforever\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [x velocity v] by (-1.5)\n        Slope\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [x velocity v] by (1.5)\n        Slope\n    end\n    set [x velocity v] to ((X velocity) * (0.85))\n    change x by (X velocity)\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (-4)\n        change x by (([y position v] of [ground v]) * (-1))\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            if <(X velocity) > [0]> then\n                set [x velocity v] to [-10]\n            else\n                set [x velocity v] to [10]\n            end\n            set [y velocity v] to [15]\n        else\n            set [x velocity v] to [0]\n        end\n    end\n    change [y velocity v] by (-1)\n    change y by (Y velocity)\n    if <touching (ground v)?> then\n        change y by ((Y velocity) - ((Y velocity) * (2)))\n        set [y velocity v] to [0]\n    end\n    change y by (-1)\n    if <<touching (ground v)?> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        set [y velocity v] to [15]\n    end\n    change y by (1)\n    if <(x position) > [239]> then\n        broadcast (Next Level v) and wait\n        change [the level v] by (1)\n    end\n    if <touching (spikes v)?> then\n        broadcast (Reset v)\n        create clone of (_myself_ v)\n    else\n        if <touching (lava v)?> then\n            broadcast (Reset v)\n        end\n    end\nend\n\nwhen I start as a clone\nclear graphic effects\nrepeat (10)\n    change [ghost v] effect by (10)\n    change y by (5)\n    turn right (5) degrees\nend\ndelete this clone\n\nwhen I receive [next level v]\nbroadcast (Reset v)\n\nwhen I receive [reset v]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\ngo to x: (-216) y: (40)\n\nwhen flag clicked\nforever\n    switch costume to (player v)\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        switch costume to (player 4 v)\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        switch costume to (player 2 v)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        switch costume to (player 3 v)\n    end\nend\n\ndefine Slope\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 (join [-] (X velocity))\n    change y by ((0) - (Slope))\nend\n\nwhen flag clicked\nforever\n    if <touching (trampoline v)?> then\n        change [y velocity v] by (30)\n        wait until <not <touching (trampoline v)?>>\n        change [y velocity v] by (0)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<touching (lights 1 v)?> and <not <([costume # v] of [lights 1 v]) = [7]>>> then\n        broadcast (Next Level v) and wait\n        change [the level v] by (1)\n    else\n        if <(The Level) = [21]> then\n            if <<touching (lights 1 v)?> and <([costume # v] of [lights 1 v]) = [7]>> then\n                broadcast (End v)\n                hide\n                stop [other scripts in sprite v]\n            end\n        end\n    end\nend\n\n@Player Trail\n\nwhen flag clicked\ngo to [back v] layer\nshow\nforever\n    point in direction ([direction v] of [player v])\n    switch costume to ([costume name v] of [player v])\n    go to x: ([x position v] of [player v]) y: ([y position v] of [player v])\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nrepeat (10)\n    change [ghost v] effect by (21)\nend\ndelete this clone\n\nwhen I receive [scroll v]\nhide\ndelete this clone\n\nwhen I receive [end v]\nforever\n    go to [back v] layer\n    hide\n    stop [other scripts in sprite v]\n    delete this clone\nend\n\n@Ground\n\nwhen flag clicked\nhide\nforever\n    switch costume to (The Level)\nend\n\nwhen I receive [next level v]\ngo to x: (0) y: (0)\nshow\n\nwhen flag clicked\nforever\n    play sound [Alone - Alan Walker v] until done\nend\n\nwhen I receive [end v]\nhide\n\n@Lava\n\nwhen flag clicked\nforever\n    set y to (Magma)\n    switch costume to (The Level)\nend\n\nwhen flag clicked\nshow\ngo to [back v] layer\ngo to x: (0) y: (0)\nforever\n    set [magma v] to [0]\n    repeat (10)\n        change [magma v] by (1)\n    end\n    repeat (20)\n        change [magma v] by (-1)\n    end\n    repeat (10)\n        change [magma v] by (1)\n    end\nend\n\nwhen I receive [end v]\nhide\nstop [other scripts in sprite v]\n\n@Moon\n\nwhen flag clicked\nshow\nforever\n    go to [back v] layer\nend\n\nwhen I receive [end v]\nhide\n\n@Text\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\nforever\n    switch costume to (The Level)\nend\n\nwhen I receive [end v]\nhide\n\n@Spikes\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\ngo to [back v] layer\nforever\n    switch costume to (The Level)\nend\n\nwhen flag clicked\nforever\n    repeat (20)\n        change y by (0.5)\n    end\n    repeat (20)\n        change y by (-0.5)\n    end\nend\n\nwhen I receive [end v]\nhide\nstop [other scripts in sprite v]\n\n@Lights 1\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (0)\n    hide\n    if <(The Level) = [6]> then\n        show\n        switch costume to (1 v)\n        go to x: (-205) y: (141)\n        set size to (90) %\n        if <touching (player v)?> then\n            hide\n        end\n    end\n    if <(The Level) = [8]> then\n        show\n        switch costume to (2 v)\n        go to x: (205) y: (-73)\n        set size to (90) %\n        if <touching (player v)?> then\n            hide\n        end\n    end\n    if <(The Level) = [11]> then\n        show\n        switch costume to (3 v)\n        go to x: (211) y: (85)\n        set size to (90) %\n        if <touching (player v)?> then\n            hide\n        end\n    end\n    if <(The Level) = [13]> then\n        show\n        switch costume to (4 v)\n        go to x: (200) y: (-68)\n        set size to (90) %\n        if <touching (player v)?> then\n            hide\n        end\n    end\n    if <(The Level) = [16]> then\n        show\n        switch costume to (5 v)\n        go to x: (198) y: (40)\n        set size to (90) %\n        if <touching (player v)?> then\n            hide\n        end\n    end\n    if <(The Level) = [18]> then\n        show\n        switch costume to (6 v)\n        go to x: (210) y: (114)\n        set size to (90) %\n        if <touching (player v)?> then\n            hide\n        end\n    end\n    if <(The Level) = [21]> then\n        show\n        switch costume to (7 v)\n        go to x: (215) y: (-68)\n        set size to (90) %\n        if <touching (player v)?> then\n            hide\n        end\n    end\nend\n\nwhen I receive [end v]\nforever\n    hide\nend\n\n@Lights 2\n\nwhen flag clicked\nhide\nwait until <(The Level) = [4]>\ngo to [back v] layer\nshow\nset size to (45) %\ngo to x: (-130) y: (143)\nswitch costume to (1 v)\nrepeat (6)\n    create clone of (_myself_ v)\n    change x by (25)\n    next costume\nend\n\nwhen I receive [end v]\nhide\n\n@Trampoline\n\nwhen flag clicked\nshow\nforever\n    go to x: (0) y: (0)\n    switch costume to (The Level)\nend\n\nwhen I receive [end v]\nhide\n\n@Fundido\n\nwhen flag clicked\nhide\nclear graphic effects\n\nwhen I receive [end v]\ngo to x: (0) y: (0)\nswitch costume to (black v)\ngo to [front v] layer\nshow\nchange [ghost v] effect by (100)\nrepeat (4)\n    change [ghost v] effect by (-25)\n    wait (0) seconds\nend\nwait (0.15) seconds\nrepeat (4)\n    change [ghost v] effect by (25)\n    wait (0) seconds\nend\nset [ghost v] effect to (0)\nshow\nswitch costume to (lights v)\nwait (3) seconds\nswitch costume to (black v)\ngo to [front v] layer\nshow\nchange [ghost v] effect by (100)\nrepeat (4)\n    change [ghost v] effect by (-25)\n    wait (0) seconds\nend\nwait (0.15) seconds\nrepeat (4)\n    change [ghost v] effect by (25)\n    wait (0) seconds\nend\nset [ghost v] effect to (0)\nshow\nswitch costume to (lights 2 v)\nwait (3) seconds\nswitch costume to (black v)\ngo to [front v] layer\nshow\nchange [ghost v] effect by (100)\nrepeat (4)\n    change [ghost v] effect by (-25)\n    wait (0) seconds\nend\nwait (0.15) seconds\nrepeat (4)\n    change [ghost v] effect by (25)\n    wait (0) seconds\nend\nset [ghost v] effect to (0)\nswitch costume to (earth v)\nshow\nwait (3) seconds\nswitch costume to (black v)\ngo to [front v] layer\nshow\nchange [ghost v] effect by (100)\nrepeat (4)\n    change [ghost v] effect by (-25)\n    wait (0) seconds\nend\nwait (0.15) seconds\nrepeat (4)\n    change [ghost v] effect by (25)\n    wait (0) seconds\nend\nset [ghost v] effect to (0)\nshow\nswitch costume to (earth 2 v)\nwait (3) seconds\nswitch costume to (black v)\ngo to [front v] layer\nshow\nchange [ghost v] effect by (100)\nrepeat (4)\n    change [ghost v] effect by (-25)\n    wait (0) seconds\nend\nwait (0.15) seconds\nrepeat (4)\n    change [ghost v] effect by (25)\n    wait (0) seconds\nend\nset [ghost v] effect to (0)\nshow\nforever\n    switch costume to (end v)\n    go to [front v] layer\n    go [backward v] (1) layers\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nset [ghost v] effect to (100)\n\n