The Desert - A Platformer

Instructions: Double click the flag.\n\nInstructions:\n- Arrow Keys to move\n- Avoid spikes and lava\n- Wall jumping included\n- Press S to skip a level\n- Enjoy!

@Stage\n\nwhen flag clicked\nforever\n    play sound [Honeycomb Highway - Sonic Lost World \[OST\] v] until done\nend\n\n@Player\n\nwhen flag clicked\ngo to x: (-200) y: (0)\npoint in direction (90)\nset rotation style [left-right v]\nset [x v] to [0]\nset [y v] to [0]\nforever\n    Player Movement\nend\n\ndefine Player Movement\nchange [y v] by (-1)\nswitch costume to (idle v)\nif <key (right arrow v) pressed?> then\n    change [x v] by (1)\n    switch costume to (walk v)\n    point in direction (90)\nend\nif <key (left arrow v) pressed?> then\n    change [x v] by (-1)\n    switch costume to (walk v)\n    point in direction (-90)\nend\nset [x v] to ((x) * (0.88))\nchange x by (x)\nchange y by (y)\nGround Collisions\nWall Collisions\nif <(x position) > [220]> then\n    broadcast (Next Level v)\nend\nif <(y position) < [-176]> then\n    broadcast (Reset v)\nend\nif <touching (danger v)?> then\n    broadcast (Reset v)\nend\n\ndefine Ground Collisions\nif <<touching (ground v)?> or <touching (moving platform v)?>> then\n    repeat ([ceiling v] of ([abs v] of (y) ) )\n        if <<touching (ground v)?> or <touching (moving platform v)?>> then\n            change y by (((y) / ([abs v] of (y) )) * (-1))\n        end\n    end\n    if <<key (up arrow v) pressed?> and <not <(y) > [0]>>> then\n        set [y v] to [12]\n    else\n        set [y v] to [0]\n    end\nend\n\ndefine Wall Collisions\nif <<(x) > [0]> and <touching (ground v)?>> then\n    change x by ((0) - (x))\n    set [x v] to [0]\n    if <key (up arrow v) pressed?> then\n        set [y v] to [12]\n        if <(x) > [0]> then\n            set [x v] to [12]\n        else\n            set [x v] to [-12]\n        end\n    else\n        set [x v] to [0]\n    end\nelse\n    if <<(x) < [0]> and <touching (ground v)?>> then\n        change x by ((0) - (x))\n        set [x v] to [0]\n        if <key (up arrow v) pressed?> then\n            set [y v] to [12]\n            if <(x) > [0]> then\n                set [x v] to [-12]\n            else\n                set [x v] to [12]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\nend\n\nwhen I receive [next level v]\ngo to x: (-200) y: (0)\n\nwhen I receive [reset v]\ngo to x: (-200) y: (0)\n\nwhen [s v] key pressed\nbroadcast (Next Level v)\nwait until <not <key (s v) pressed?>>\n\n@Ground\n\nwhen I receive [next level v]\nchange [level v] by (1)\nnext costume\n\nwhen flag clicked\nset [level v] to [1]\nswitch costume to (level 1 v)\n\n@Danger\n\nwhen flag clicked\nswitch costume to (level 1 v)\n\nwhen I receive [next level v]\nnext costume\n\n@Moving Platform\n\nwhen flag clicked\nhide\nforever\n    if <(level) = [14]> then\n        show\n        Move Platform\n        go to x: (-73) y: (83)\n    else\n        hide\n    end\nend\n\ndefine Move Platform\nwait (1) seconds\nrepeat (50)\n    set [platform x v] to [5]\n    change x by (platform x)\nend\nwait (1) seconds\nrepeat (50)\n    set [platform x v] to [-5]\n    change x by (platform x)\nend\nif <not <(level) = [14]>> then\n    hide\n    stop [other scripts in sprite v]\n    stop [this script v]\nend\n\n@Text\n\nwhen flag clicked\nswitch costume to (costume1 v)\nforever\n    if <touching (player v)?> then\n        set [ghost v] effect to (25)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen I receive [next level v]\nnext costume\n\n@Clouds\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\n    wait (4) seconds\nend\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (25)\nset [spawn point v] to (pick random (1) to (2))\ngo to [back v] layer\nif <(spawn point) = [1]> then\n    go to x: (-240) y: (pick random (130) to (150))\n    repeat until <(x position) > [220]>\n        change x by (1)\n    end\n    delete this clone\nelse\n    go to x: (240) y: (pick random (130) to (150))\n    repeat until <(x position) < [-220]>\n        change x by (-1)\n    end\n    delete this clone\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to [front v] layer\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\n\n