Elements 4:Earth || A Platformer

Instructions: You have wandered in the earth territory. Your mission is to escape.\n\nControls:\nUse the arrow keys to move.

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nforever\n    if <(Level) = [13]> then\n        switch backdrop to (backdrop2 v)\n    end\n    if <(Level) = [14]> then\n        switch backdrop to (backdrop3 v)\n    end\nend\n\n@Player\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nset [level v] to [1]\nReset Level\nforever\n    if <key (right arrow v) pressed?> then\n        change [x v] by (.9)\n    end\n    if <key (left arrow v) pressed?> then\n        change [x v] by (-.9)\n    end\n    set [x v] to ((x) * (.9))\n    change x by (x)\n    if <touching (ground v)?> then\n        change y by (1)\n        if <touching (ground v)?> then\n            change y by (1)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (1)\n                        if <touching (ground v)?> then\n                            change x by ((x) * (-1))\n                            change y by (-5)\n                            if <key (up arrow v) pressed?> then\n                                if <(x) > [0]> then\n                                    set [x v] to [-5]\n                                else\n                                    set [x v] to [5]\n                                end\n                                set [y v] to [13]\n                            else\n                                set [x v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y v] by (-0.8)\n    change y by (y)\n    if <touching (ground v)?> then\n        change y by ((y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <touching (ground v)?> then\n        if <key (up arrow v) pressed?> then\n            set [y v] to [12]\n        end\n    end\n    change y by (1)\n    if <<touching (spikes v)?> or <touching (death wheel v)?>> then\n        Die\n    end\n    if <touching (trampoline v)?> then\n        set [y v] to [17]\n    end\nend\n\ndefine Reset Level\nclear graphic effects\ngo to x: (-200) y: (0)\nset [x v] to [0]\nset [y v] to [0]\nshow\n\ndefine Die\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\nReset Level\n\nwhen [r v] key pressed\nReset Level\n\nwhen I receive [start v]\nforever\n    if <(x position) > [236]> then\n        Reset Level\n        change [level v] by (1)\n    end\nend\n\n@Ground\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\n    show\nend\n\nwhen flag clicked\nhide\n\n@Spikes\n\nwhen I receive [start v]\ngo to [back v] layer\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\n    show\nend\n\nwhen flag clicked\nhide\n\n@Words\n\nwhen I receive [start v]\ngo to [front v] layer\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\n    show\nend\n\nwhen flag clicked\nhide\n\n@Death Wheel\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\npoint in direction (90)\nhide\nforever\n    go to [back v] layer\n    turn right (5) degrees\n    if <(Level) = [3]> then\n        show\n        go to x: (0) y: (-75)\n    end\n    if <(Level) = [4]> then\n        go to x: (55) y: (50)\n    end\n    if <(Level) = [5]> then\n        hide\n    end\n    if <(Level) = [6]> then\n        show\n        go to x: (30) y: (-75)\n    end\n    if <(Level) = [7]> then\n        hide\n    end\nend\n\n@Logo\n\nwhen I receive [start v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\nshow\ngo to [front v] layer\ngo to x: (0) y: (30)\npoint in direction (90)\nset [ghost v] effect to (0)\nset size to (0) %\nrepeat (20)\n    change [ghost v] effect by (-5)\n    turn right (18) degrees\n    change size by (7)\nend\nwait (2) seconds\nbroadcast (Start v)\n\n@Screen\n\nwhen I receive [start v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\n\n@Name\n\nwhen I receive [start v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\nshow\nclear graphic effects\ngo to x: (-240) y: (-100)\nset size to (200) %\npoint in direction (90)\nreset timer\nrepeat (40)\n    move ((timer) * (9)) steps\nend\n\n@TN\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\nhide\n\n