Plains 2  a mobile friendly platformer 

Instructions: Welcome to plains 2 \nPlains 1 https://scratch.mit.edu/projects/562771967/\nreleased \ngreen flag \narrow keys to move \nor mouse \nor tap on mobile \nBlack is danger \npink is trampoline \nspike danger \nthere are some easter eggs \nlove\nfav\nadd to studios \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n:D

@Stage\n\n@Sprite2\n\nwhen flag clicked\nhide\nbroadcast (Start v) and wait\n\n@Clouds\n\nwhen flag clicked\nset [ghost v] effect to (50)\nhide\n\nwhen I start as a clone\ngo to [back v] layer\ngo to x: (200) y: (pick random (50) to (180))\nshow\nrepeat until <(x position) < [-200]>\n    change x by (-3)\n    if <<([costume name v] of [platform v]) > [6]> and <([costume name v] of [platform v]) < [11]>> then\n        hide\n        delete this clone\n    end\nend\nrepeat (10)\n    hide\n    delete this clone\nend\nif <(Level) = [8]> then\n    forever\n        hide\n    end\nend\n\nwhen I receive [dark v]\nhide\n\nwhen I receive [nonono v]\nshow\n\nwhen I receive [start v]\nforever\n    wait (2) seconds\n    create clone of (_myself_ v)\nend\n\n@words\n\nwhen I receive [start v]\nwait (1) seconds\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\nswitch costume to (level 1 v)\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nwait (1) seconds\nshow\n\nwhen I receive [start v]\nshow\nforever\n    go to [front v] layer\n    go [backward v] (1) layers\n    if <(Level) = [13]> then\n        forever\n            go to [back v] layer\n            stop [this script v]\n        end\n    end\nend\n\n@Trampolines\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nshow\n\n@player\n\nwhen I receive [start v]\nforever\n    if <<[240] < (x position)> and <(Dead) = [0]>> then\n        broadcast (NAXT LEVEL v)\n        change [level v] by (1)\n        reset\n    end\nend\n\nwhen flag clicked\nhide variable [xv v]\nhide variable [dead v]\nhide variable [level v]\nhide variable [yv v]\nhide\n\ndefine reset\nclear graphic effects\npoint in direction (90)\ngo to x: (-220) y: (-16)\nswitch costume to (1 v)\nset [dead v] to [0]\nset [xv v] to [0]\nset [yv v] to [0]\nset size to (20) %\nshow\n\ndefine Dead\nset [dead v] to [1]\nrepeat (25)\n    change [ghost v] effect by (4)\nend\nreset\n\nwhen I start as a clone\nswitch costume to (3 v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    change [color v] effect by (20)\n    change size by (-1.5)\nend\ndelete this clone\n\ndefine Tick\nshow\nset [dead v] to [0]\nset [level v] to [1]\nset size to (20) %\nreset\nforever\n    create clone of (_myself_ v)\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        switch costume to (1 v)\n        change [xv v] by (1)\n    end\n    if <<<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> and <(Dead) = [0]>> then\n        switch costume to (2 v)\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (.9))\n    change x by (Xv)\n    if <touching (platform v)?> then\n        change y by (2)\n        if <touching (platform v)?> then\n            change y by (2)\n            if <touching (platform v)?> then\n                change y by (2)\n                if <touching (platform v)?> then\n                    change y by (2)\n                    if <touching (platform v)?> then\n                        change y by (2)\n                        if <touching (platform v)?> then\n                            change x by ((Xv) * (-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) + (10))>>>> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-5]\n                                else\n                                    set [xv v] to [5]\n                                end\n                                set [yv v] to [13]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-0.8)\n    change y by (Yv)\n    if <touching (platform v)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching (platform v)?> then\n        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n            set [yv v] to [12]\n        end\n    end\n    change y by (1)\n    if <<touching (spike v)?> or <touching (lava v)?>> then\n        Dead\n    end\n    if <(y position) < [-180]> then\n        Dead\n    end\nend\n\nwhen I receive [start v]\nshow\nTick\n\nwhen I receive [1 v]\nreset\n\nwhen I receive [start v]\nshow\nforever\n    forever\n        if <touching (trampolines v)?> then\n            set [yv v] to [23]\n        end\n    end\nend\n\nwhen I receive [start v]\nshow\nforever\n    forever\n        if <touching (trampolines v)?> then\n            set [yv v] to [23]\n        end\n    end\nend\n\nwhen I start as a clone\nswitch costume to (3 v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    change [color v] effect by (20)\n    change size by (-1.5)\nend\ndelete this clone\n\n@spike\n\nwhen I receive [start v]\ngo to [back v] layer\nshow\nswitch costume to (1 v)\n\nwhen I receive [start v]\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\ngo to x: (35) y: (20)\nhide\n\nwhen flag clicked\nshow\nforever\n    if <(costume [number v]) = [13]> then\n        go to [back v] layer\n    end\nend\n\nwhen flag clicked\nhide\nset size to (100) %\n\nwhen [space v] key pressed\nhide\n\n@platform\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nshow\n\nwhen I receive [start v]\nshow\nforever\n    switch costume to (Level)\nend\n\n@Lava\n\nwhen I receive [start v]\nshow\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\nforever\n    glide (1.5) secs to x: (0) y: (25)\n    glide (1.5) secs to x: (0) y: (-10)\nend\n\nwhen flag clicked\nshow\nforever\n    if <not <(Level) = [50]>> then\n        go to [back v] layer\n    else\n        go to [front v] layer\n        stop [this script v]\n    end\nend\n\n@Skip button2\n\nwhen flag clicked\nhide\nset [skip v] to [0]\n\nwhen I receive [start v]\nshow\nshow\nset [skip v] to [1]\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (130) %\n    else\n        if <not <touching (mouse-pointer v)?>> then\n            set size to (100) %\n        end\n    end\nend\n\nwhen this sprite clicked\nif <(Skip) = [1]> then\n    if <not <(Level) = [14]>> then\n        change [level v] by (1)\n        broadcast (1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n