Platformer

Instructions: Use the up button to jump and the left and right button (on your computer) to change direction. Do not fall into the red or touch the sharp brown spiky things because they just cause ur life to down by 1. If you touch the blue door then your on the next level. This is my second game I have made. The first one is called Chick VS Fox. Do Check it out.

@Stage\n\n@Pico Main Character\n\nwhen I receive [start level v]\nshow\nset [jumping v] to [false]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nforever\n    change [y velocity v] by (-1)\n    if <key (left arrow v) pressed?> then\n        if <(X Velocity) > [-10]> then\n            change [x velocity v] by (-2)\n        end\n        if <(costume [number v]) = [1]> then\n            switch costume to (2 v)\n        else\n            switch costume to (1 v)\n        end\n    end\n    if <key (right arrow v) pressed?> then\n        if <(X Velocity) < [10]> then\n            change [x velocity v] by (2)\n        end\n        if <(costume [number v]) = [3]> then\n            switch costume to (4 v)\n        else\n            switch costume to (3 v)\n        end\n    end\n    if <(X Velocity) > [0]> then\n        change [x velocity v] by (-1)\n    end\n    if <(X Velocity) < [0]> then\n        change [x velocity v] by (1)\n    end\n    change x by (X Velocity)\n    Move vertical\n    move horizontal \n    if <touching color (#0092be)?> then\n        broadcast (Next Level v)\n    end\n    if <<touching color (#d9c5a8)?> or <(y position) < [-179]>> then\n        broadcast (Start Level v)\n        change [life v] by (-1)\n    end\nend\n\nwhen flag clicked\nset [level v] to [1]\nbroadcast (Start Level v)\n\ndefine Move vertical\nchange y by (Y Velocity)\nif <touching color (#000000)?> then\n    if <(Y Velocity) > [0]> then\n        repeat until <not <touching color (#000000)?>>\n            change y by (-1)\n        end\n    else\n        repeat until <not <touching color (#000000)?>>\n            change y by (1)\n        end\n        set [jumping v] to [false]\n    end\n    set [y velocity v] to [0]\nend\n\nwhen [up arrow v] key pressed\nif <(jumping) = [false]> then\n    set [y velocity v] to [15]\n    set [jumping v] to [true]\nend\n\ndefine move horizontal \nif <touching color (#000000)?> then\n    if <(X Velocity) > [0]> then\n        repeat until <not <touching color (#000000)?>>\n            change x by (-2)\n        end\n    else\n        repeat until <not <touching color (#000000)?>>\n            change x by (2)\n        end\n    end\n    set [x velocity v] to [0]\nend\n\nwhen I receive [start level v]\nif <(Level) = [1]> then\n    go to x: (-157) y: (-99)\n    switch backdrop to (backdrop1 v)\nend\nif <(Level) = [2]> then\n    switch backdrop to (backdrop2 v)\n    go to x: (-198) y: (-103)\nend\nif <(Level) = [3]> then\n    switch backdrop to (backdrop3 v)\n    go to x: (-214) y: (151)\nend\nif <(Level) = [4]> then\n    switch backdrop to (backdrop4 v)\n    go to x: (-197) y: (-94)\n    if <touching color (#d9c5a8)?> then\n        go to x: (-197) y: (-94)\n    end\nend\nif <(Level) = [5]> then\n    switch backdrop to (backdrop5 v)\n    go to x: (-209) y: (147)\nend\nif <(Level) = [6]> then\n    switch backdrop to (backdrop6 v)\n    go to x: (-186) y: (147)\nend\nif <(Level) = [7]> then\n    hide\n    switch backdrop to (you winnnnn v)\n    stop [all v]\nend\n\nwhen I receive [next level v]\nchange [level v] by (1)\nstop [other scripts in sprite v]\nbroadcast (Start Level v)\n\nwhen I receive [start level v]\nif <(Life) = [0]> then\n    switch backdrop to (backdrop7 v)\n    hide\n    stop [all v]\nend\n\nwhen flag clicked\nset [life v] to [2]\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nwhen I receive [start level v]\nstop [other scripts in sprite v]\nif <(Level) = [3]> then\n    show\nelse\n    hide\nend\nMove Platform\n\ndefine Move Platform\ngo to x: (247) y: (-83)\nforever\n    glide (1) secs to x: (234) y: (118)\n    glide (1) secs to x: (247) y: (-83)\nend\n\n@Sprite2\n\nwhen I receive [start level v]\nstop [other scripts in sprite v]\nif <(Level) = [6]> then\n    show\nelse\n    hide\nend\nMove this platform\n\ndefine Move this platform\ngo to x: (-66) y: (116)\nforever\n    glide (1) secs to x: (-66) y: (116)\n    glide (1) secs to x: (0) y: (80)\nend\n\nwhen I receive [start level v]\nforever\n    if <(Level) = [7]> then\n        hide\n    end\nend\n\n@Level 6\n\nwhen I receive [start level v]\nstop [other scripts in sprite v]\nforever\n    hide\n    if <(Level) = [6]> then\n        show\n        Move Platform\n    else\n        hide\n    end\nend\n\ndefine Move Platform\nforever\n    show\n    go to x: (121) y: (-146)\n    wait (pick random (10) to (8)) seconds\n    hide\nend\n\nwhen backdrop switches to [you winnnnn v]\nhide\n\n