Elements 5:Sky || A Platformer

Instructions: You, explorer, have set foot in the Sky World. For some odd reason, it is connected directly to the earth.\n\nControls:\nUse the arrow keys to move.

@Stage\n\nwhen flag clicked\nswitch backdrop to (sky v)\nwait until <(Level) = [17]>\nswitch backdrop to (sky2 v)\nwait until <(Level) = [18]>\nswitch backdrop to (cave v)\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)?> 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 flag clicked\nforever\n    if <(x position) > [236]> then\n        Reset Level\n        change [level v] by (1)\n    end\nend\n\nwhen [r v] key pressed\nReset Level\n\n@Ground\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nforever\n    show\n    switch costume to (Level)\nend\n\n@Spikes\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nforever\n    show\n    switch costume to (Level)\nend\n\n@Words\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\ngo to [front v] layer\nforever\n    show\n    switch costume to (Level)\nend\n\n@Sprite2\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\nhide\nbroadcast (Start v)\n\n@Sprite3\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\nhide\n\n@Sprite4\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\nhide\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