Draw: The Platformer

Instructions: <------------- Grass ------------>\nHow to play: \n~ Use WASD or ARROW keys to move (if on mobile you can tap and drag) \n~ Try not to touch the red spikes and also try not to fall into the void. \n~ Try to beat the game fast and you might get the world record!\n\n[NOTE: This is the non-scrolling version of grass 3, the scrolling ver. had many frame rate issues.]\n\n[I continue this series to show how far I have grown on scratch over these past few years.]\n\nGrass 1: https://scratch.mit.edu/projects/361006173/\nGrass 2: https://scratch.mit.edu/projects/380301611/\nGrass 3: https://scratch.mit.edu/projects/604282960/\n(scrolling but laggy)\n\n\nCredits:\nMe - all code and sprites\nmusic:\n1 - Within The Sadness -1f1n1ty\n2 - Plo's Theme\n3 - the wind can be still\n4 - mines iccles\n\n\n\nwhy not drop me a follow ;)\n\n\n\n\n\n\n\n\n\n---------------------------------------\n#Game #Fun #happy #Moon #space #project #Thepugmen #Play #platformer #Platformer #Mobile #LOVE #Favorite #Music #Art #Animation #Games #Scratch #Space #Orange #Playing #Dodging #Play #Square #Cube #Thumbnail #Colors  #Cool #Awesome #Good #Great #Walking #Moving #Comment #Difficulty #city #Hard #Animations #All #Art #Music #Stories #Tutorials #explore

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [next level v]\nnext backdrop\n\n@Sprite1\n\nwhen flag clicked\nset [x vel v] to [0]\nset [y vel v] to [0]\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 vel 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)>>> then\n        change [x vel v] by (-1)\n    end\n    set [x vel v] to ((X vel) * (0.9))\n    change x by (X vel)\n    if <touching (level v)?> then\n        change y by (1)\n        if <touching (level v)?> then\n            change y by (1)\n            if <touching (level v)?> then\n                change y by (1)\n                if <touching (level v)?> then\n                    change y by (1)\n                    if <touching (level v)?> then\n                        change y by (1)\n                        if <touching (level v)?> then\n                            change y by (1)\n                            if <touching (level v)?> then\n                                change y by (1)\n                                if <touching (level v)?> then\n                                    change y by (-6)\n                                end\n                                change x by ((X vel) * (-1))\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 vel) > [0]> then\n                                        set [x vel v] to [-5]\n                                    else\n                                        set [x vel v] to [5]\n                                    end\n                                    set [y vel v] to [13]\n                                else\n                                    set [x vel v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y vel v] by (-0.8)\n    change y by (Y vel)\n    if <touching (level v)?> then\n        change y by ((Y vel) * (-1))\n        set [y vel v] to [0]\n    end\n    change y by (-1)\n    if <<touching (level v)?> and <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>>>> then\n        set [y vel v] to [12]\n    end\nend\n\nwhen flag clicked\nshow\ngo to [front v] layer\nswitch costume to (costume1 v)\n\nwhen flag clicked\nforever\n    if <(x position) = [358]> then\n        broadcast (Next level v)\n    end\nend\n\nwhen I receive [next level v]\ngo to x: (-57) y: (-40)\n\nwhen flag clicked\nforever\n    if <touching (slime v)?> then\n        go to x: (-57) y: (-40)\n    end\nend\n\nwhen flag clicked\nplay sound [Sunshine v] until done\n\nwhen flag clicked\ngo to x: (-57) y: (-40)\n\nwhen flag clicked\nset [level v] to [1]\n\nwhen I receive [next level v]\nchange [level v] by (1)\n\nwhen flag clicked\nforever\n    if <(y position) = [-196]> then\n        go to x: (-57) y: (-40)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (lasers v)?> then\n        go to x: (-57) y: (-40)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (lava v)?> then\n        go to x: (-57) y: (-40)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (machine v)?> then\n        go to x: (-57) y: (-40)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (saws v)?> then\n        go to x: (-57) y: (-40)\n    end\nend\n\nwhen flag clicked\nset [timer v] to [0]\n\nwhen flag clicked\nforever\n    wait (1) seconds\n    change [timer v] by (1)\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [11]> then\n        broadcast (Game Over v)\n    end\nend\n\nwhen I receive [game over v]\nstop [other scripts in sprite v]\n\n@Level\n\nwhen flag clicked\nshow\ngo to [front v] layer\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\n@Slime\n\nwhen flag clicked\nhide\ngo to [back v] layer\nclear graphic effects\n\nwhen flag clicked\nforever\n    if <(Level) = [2]> then\n        show\n        go to [front v] layer\n        switch costume to (costume2 v)\n        wait (0.3) seconds\n        repeat (11)\n            next costume\n        end\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        clear graphic effects\n        switch costume to (costume2 v)\n        wait (0.3) seconds\n        repeat (11)\n            next costume\n        end\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [3]> then\n        hide\n        go to [back v] layer\n        switch costume to (costume2 v)\n    end\nend\n\n@Lasers\n\nwhen flag clicked\nhide\ngo to [back v] layer\nclear graphic effects\n\nwhen flag clicked\nforever\n    if <(Level) = [4]> then\n        show\n        go to [back v] layer\n        switch costume to (costume2 v)\n        clear graphic effects\n    end\n    wait (0.5) seconds\n    repeat (5)\n        next costume\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    clear graphic effects\n    switch costume to (costume2 v)\n    wait (0.5) seconds\n    repeat (5)\n        next costume\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [5]> then\n        hide\n        go to [back v] layer\n        switch costume to (costume2 v)\n    end\nend\n\n@Lava\n\nwhen flag clicked\nhide\ngo to [back v] layer\nclear graphic effects\n\nwhen flag clicked\nforever\n    if <(Level) = [5]> then\n        show\n        go to [back v] layer\n        switch costume to (costume2 v)\n        clear graphic effects\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [6]> then\n        hide\n        go to [back v] layer\n        switch costume to (costume2 v)\n    end\nend\n\n@Machine\n\nwhen flag clicked\nhide\ngo to [back v] layer\nclear graphic effects\n\nwhen flag clicked\nforever\n    if <(Level) = [6]> then\n        show\n        go to [back v] layer\n        switch costume to (costume2 v)\n        clear graphic effects\n        wait (1) seconds\n        repeat (5)\n            next costume\n        end\n        wait (1) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [7]> then\n        hide\n        go to [back v] layer\n        switch costume to (costume2 v)\n    end\nend\n\n@Saws\n\nwhen flag clicked\nhide\ngo to [back v] layer\nclear graphic effects\n\nwhen flag clicked\nforever\n    if <(Level) = [7]> then\n        show\n        go to [back v] layer\n        switch costume to (costume1 v)\n        clear graphic effects\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [8]> then\n        hide\n        go to [back v] layer\n        switch costume to (costume1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [9]> then\n        show\n        go to [back v] layer\n        switch costume to (costume2 v)\n        clear graphic effects\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [10]> then\n        show\n        go to [back v] layer\n        switch costume to (costume3 v)\n        clear graphic effects\n    end\nend\n\n@Game Over\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nwhen flag clicked\nforever\n    if <(Level) = [11]> then\n        show\n        go to [front v] layer\n        switch costume to (costume1 v)\n    end\nend\n\nwhen flag clicked\nhide variable [timer v]\n\nwhen I receive [game over v]\nset [timer v] to (Timer)\nshow variable [timer v]\n\n@Thumbnail\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\n