PLATFORMER⎮Wonderland Valley
@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nrepeat (100)\n    clear sound effects\n    play sound [Garden v] until done\n    repeat (2)\n        clear sound effects\n        play sound [Emotional Piano v] until done\n    end\n    clear sound effects\n    play sound [Medieval2 v] until done\n    repeat (2)\n        clear sound effects\n        play sound [Medieval1 v] until done\n    end\nend\n\nrepeat (2)\n\nwhen I receive [next level v]\nnext backdrop\n\n@Sprite1\n\nwhen flag clicked\nswitch costume to (costume1 v)\nset [ghost v] effect to (30)\ngo to x: (-180) y: (0)\nset rotation style [left-right v]\nset [speed y v] to [0]\nforever\n    change [speed y v] by (-1)\n    change y by (speed y)\n    touch ground <(speed y) > [0]>\n    if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [xv v] by (-0.7)\n    end\n    if <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [xv v] by (0.7)\n    end\n    set [xv v] to ((xv) * (0.9))\n    change x by (xv)\n    if <<<(falling) < [3]> and <<key (w v) pressed?> or <key (up arrow v) pressed?>>> or <<((mouse y) - (y position)) > [50]> and <mouse down?>>> then\n        set [speed y v] to [12]\n    end\n    if <(y position) < [-180]> then\n        go to x: (-180) y: (0)\n        -\n    end\n    if <(y position) < [-180]> then\n        go to x: (-180) y: (0)\n        -\n    end\n    if <touching (bouncy v)?> then\n        set [speed y v] to [20]\n    end\n    if <(x position) > [235]> then\n        broadcast (next level v)\n    end\n    if <(x position) < [-235]> then\n        broadcast (pre lev v)\n    end\nend\n\ndefine touch ground <up?>\nchange [falling v] by (1)\nrepeat until <not <touching (ground v)?>>\n    if <up?> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [falling v] to [0]\n    end\n    set [speed y v] to [0]\nend\n\ndefine walk (speed)\nset [slope v] to [0]\nchange [xv v] by (speed)\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 y by ((0) - (slope))\nend\n\nwhen I receive [next level v]\ngo to x: (-190) y: (-61)\n\ndefine -\nrepeat (3)\n    hide\n    wait (0.07) seconds\n    show\n    wait (0.07) seconds\nend\n\nchange x by (speed)\n\nwalk [5]\n\nwhen I receive [pre lev v]\ngo to x: (200) y: (-61)\n\n@ground\n\nwhen flag clicked\nswitch costume to (costume1 v)\nset [ghost v] effect to (60)\ngo to x: (0) y: (0)\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [pre lev v]\nswitch costume to ((costume [number v]) - (1))\n\n@effect \n\nwhen flag clicked\nswitch costume to (1 v)\nset [ghost v] effect to (50)\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [pre lev v]\nswitch costume to ((costume [number v]) - (1))\n\nset [ghost v] effect to (50)\n\n@background\n\nwhen flag clicked\ngo to [back v] layer\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [pre lev v]\nswitch costume to ((costume [number v]) - (1))\n\n@Sprite2\n\nwhen flag clicked\nhide\n\n@Sprite3\n\nwhen flag clicked\nhide\n\nset [ghost v] effect to (40)\n\n@Sprite4\n\nwhen flag clicked\nhide\n\n