Adventure 2 - A Mobile Platformer

Instructions: PC:\nWASD or Arrow keys\n\nMobile:\nClick the screen

@Stage\n\nwhen flag clicked\nswitch backdrop to (adventure time again v)\nforever\n    if <(Level) = [13]> then\n        switch backdrop to (hills of denturinia v)\n    end\nend\n\n@Player\n\nwhen flag clicked\npoint in direction (90)\nset [level v] to [1]\nReset Level\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [x v v] by (.9)\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [x v v] by (-.9)\n    end\n    set [x v v] to ((X v) * (0.9))\n    change x by (X v)\n    if <touching (ground v)?> then\n        change y by (2)\n        if <touching (ground v)?> then\n            change y by (2)\n            if <touching (ground v)?> then\n                change y by (2)\n                if <touching (ground v)?> then\n                    change y by (2)\n                    if <touching (ground v)?> then\n                        change y by (2)\n                        if <touching (ground v)?> then\n                            change x by ((X v) * (-2))\n                            change y by (-5)\n                            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n                                if <(X v) > [0]> then\n                                    set [x v v] to [-5]\n                                else\n                                    set [x v v] to [5]\n                                end\n                                set [y v v] to [13]\n                            else\n                                set [x v v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y v v] by (-0.8)\n    change y by (Y v)\n    if <touching (ground v)?> then\n        change y by ((Y v) * (-1))\n        set [y v v] to [0]\n    end\n    change y by (-1)\n    if <touching (ground v)?> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n            change [y v v] by (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\nend\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nswitch costume to (player2 v)\nrepeat (10)\n    change [ghost v] effect by (5)\n    change size by (-5)\nend\ndelete this clone\n\ndefine Reset Level\nswitch costume to (player1 v)\nclear graphic effects\ngo to x: (-200) y: (30)\nset [x v v] to [0]\nset [y v v] to [0]\nset size to (100) %\nshow\n\nwhen flag clicked\nforever\n    if <(x position) > [240]> then\n        broadcast (Next Costume v)\n        change [level v] by (1)\n        Reset Level\n    end\nend\n\ndefine Die\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nReset Level\n\n@Ground\n\nwhen flag clicked\npoint in direction (90)\nswitch costume to (ground1 v)\nshow\nforever\n    go to x: (0) y: (0)\nend\n\nwhen I receive [next costume v]\nnext costume\n\n@Spikes\n\nwhen flag clicked\npoint in direction (90)\nswitch costume to (spikes1 v)\nshow\nforever\n    go to x: (0) y: (0)\nend\n\nwhen I receive [next costume v]\nnext costume\n\n@Text\n\nwhen flag clicked\npoint in direction (90)\nswitch costume to (text1 v)\nshow\ngo to [front v] layer\nforever\n    go to x: (0) y: (0)\nend\n\nwhen I receive [next costume v]\nnext costume\n\n@Clouds\n\nwhen flag clicked\nset [ghost v] effect to (25)\nset [brightness v] effect to (0)\nhide\nforever\n    wait (2.5) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\ngo to [back v] layer\ngo to x: (200) y: (pick random (60) to (170))\nswitch costume to (pick random (1) to (3))\nshow\nrepeat until <(x position) < [-200]>\n    change x by (-3)\nend\nrepeat (10)\n    hide\n    delete this clone\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [13]> then\n        set [brightness v] effect to (-45)\n    end\nend\n\n@Death Wheel\n\nwhen flag clicked\npoint in direction (90)\nhide\nforever\n    go to [back v] layer\n    turn right (5) degrees\n    if <(Level) = [7]> then\n        go to x: (80) y: (-67)\n        show\n    end\n    if <(Level) = [8]> then\n        go to x: (-190) y: (82)\n    end\n    if <(Level) = [9]> then\n        go to x: (5) y: (-30)\n    end\n    if <(Level) = [10]> then\n        hide\n    end\n    if <(Level) = [14]> then\n        show\n        go to x: (188) y: (-53)\n    end\n    if <(Level) = [15]> then\n        hide\n    end\nend\n\n@TN\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n@Campfire\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [1]> then\n        hide\n        hide\n        hide\n        hide\n    end\n    if <(Level) = [17]> then\n        go to x: (0) y: (0)\n        show\n    end\n    if <(Level) = [18]> then\n        hide\n    end\nend\n\n