Spray - A Platformer

Instructions: Part 2: https://scratch.mit.edu/projects/342517054/\nFollow me or \nInvincibility\nFire doesn’t hurt\nCreepers don’t hurt\nDon’t touch lava\n4 in “what the community is loving” not bad\n24th in explore not bad\n\nLevel 1 has a tutorial to get you started.\n\nFirst 300 to love and comment win chance to be added  to the credit crew!\n\n---------- IPad, tablet, and mobile friendly ---------\n\n-----------------------Search Tags-----------------------\n#games #minecraft  #platformer #platform #music #1  #animation #atomicmagicnumber  #episode #mobile\n#Halloween #Platformer #Games #Cute #Scary #Trick #Or #Treat #Why #Are #You #Still #Reading? #Just #Love #And #Favorite #art #music #stories #tutorials #

@Stage\n\nwhen flag clicked\nbroadcast (lol v)\nforever\n\nwhen flag clicked\nset volume to (100) %\nforever\n    if <key (m v) pressed?> then\n        if <(volume) = [100]> then\n            broadcast (stopp musikk v)\n        else\n            broadcast (lol v)\n            set [sang v] to [yes]\n        end\n    end\n    wait until <not <key (m v) pressed?>>\nend\n\nset volume to (0) %\n\nbroadcast (lol v)\nwait (0.000000000000001) seconds\nset volume to (100) %\n\nwhen I receive [lol v]\n\nrepeat until <(volume) = [0]>\n    play sound [TheFatRat - Fly Away feat v] until done\nend\n\nwhen flag clicked\nforever\n    if <(volume) = [0]> then\n        stop all sounds\n    end\nend\n\nwhen I receive [stopp musikk v]\nset [musikk på v] to [0]\nrepeat until <(musikk på) = (pick random (1) to (1))>\n    set [volume v] to [0]\n    stop all sounds\nend\nset [volume v] to [100]\n\nwhen flag clicked\nforever\n    set volume to (volume) %\nend\n\nwhen flag clicked\nset [volume v] to [100]\n\nwhen I receive [lol v]\nset [musikk på v] to [1]\n\nwhen I receive [lol v]\nforever\n    if <(sang) = [yes]> then\n        stop all sounds\n        play sound [Super Mario Bros v] until done\n    end\nend\n\n@Player\n\nwhen flag clicked\nshow\nset [level v] to [1]\nbroadcast (Reset v)\nforever\n    set rotation style [left-right v]\n    go to [back v] layer\n    if <<(x position) > [230]> and <not <(Level) = [15]>>> then\n        broadcast (Reset v)\n        broadcast (Transition v)\n        change [level v] by (1)\n    end\n    if <touching (spikes v)?> then\n        broadcast (Reset v)\n        create clone of (_myself_ v)\n    end\n    platform physics (12.5) (-1) (0.7) (2)\nend\n\nwhen flag clicked\nset [walk v] to [5]\nforever\n    change [walk v] by (1)\n    if <(Walk) > [4]> then\n        set [walk v] to [2]\n    end\n    wait (0.05) seconds\nend\n\ndefine platform physics (jump height) (gravity) (friction) (movement speed)\nswitch costume to (hitbox v)\nchange y by (y vel)\nif <<touching (level v)?> or <touching (invis blocks v)?>> then\n    repeat ([abs v] of (y vel) )\n        if <<touching (level v)?> or <touching (invis blocks v)?>> then\n            change y by ((-1) * (([abs v] of (y vel) ) / (y vel)))\n        end\n    end\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <not <(y vel) > [0]>>> then\n        set [y vel v] to ((jump height) * (1.1))\n    else\n        set [y vel v] to [0]\n    end\nelse\n    change [y vel v] by (gravity)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [x vel v] by (movement speed)\n    point in direction (90)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [x vel v] by ((-1) * (movement speed))\n    point in direction (-90)\nend\nchange x by (x vel)\nif <<touching (level v)?> or <touching (invis blocks v)?>> then\n    set [old y v] to (y position)\n    repeat ([abs v] of (x vel) )\n        if <<touching (level v)?> or <touching (invis blocks v)?>> then\n            change y by (1)\n        end\n    end\n    if <<touching (level v)?> or <touching (invis blocks v)?>> then\n        set y to (old y)\n        repeat ([ceiling v] of ([abs v] of (x vel) ) )\n            if <<touching (level v)?> or <touching (invis blocks v)?>> then\n                change x by ((-1) * (([abs v] of (x vel) ) / (x vel)))\n            end\n        end\n        set [x vel v] to [0]\n    end\nend\nset [x vel v] to ((x vel) * (friction))\nswitch costume to (costume1 v)\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n    switch costume to (Walk)\nend\nif <(y vel) > [1]> then\n    switch costume to (costume1 v)\nend\nif <(y vel) < [-3]> then\n    switch costume to (costume1 v)\nend\nif <touching (trampoline v)?> then\n    set [y vel v] to [20]\nend\n\nwhen I receive [reset v]\npoint in direction (90)\ngo to x: (-228) y: (-69)\nset [x vel v] to [0]\nset [y vel v] to [0]\n\nwhen I start as a clone\nclear graphic effects\nforever\n    change [ghost v] effect by (4)\n    change size by (10)\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen [l v] key pressed\nbroadcast (Reset v)\n\nwhen flag clicked\nforever\n    if <key (s v) pressed?> then\n        broadcast (Reset v)\n        broadcast (Transition v)\n        change [level v] by (1)\n    end\nend\n\nbroadcast (Reset v)\nchange [level v] by (1)\nwait (0.3) seconds\n\nwhen [r v] key pressed\nbroadcast (Reset v)\n\nwhen flag clicked\n\n@Level\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [transition v]\nnext costume\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [100]> then\n        broadcast (invis block v)\n    end\n    if <not <(costume [number v]) = [100]>> then\n        broadcast (hide invis block v)\n    end\nend\n\n@invis blocks\n\nwhen flag clicked\nhide\nset [ghost v] effect to (100)\n\nwhen I receive [invis block v]\nshow\n\nwhen I receive [hide invis block v]\nhide\n\n@Spikes\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [transition v]\nnext costume\n\nwhen flag clicked\nforever\n    if <(Level) = [2]> then\n        go to [back v] layer\n    else\n        go to [front v] layer\n    end\nend\n\n@Trampoline\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [transition v]\nnext costume\n\n@text\n\nwhen I receive [transition v]\nnext costume\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen flag clicked\nshow\nforever\n    go to [back v] layer\nend\n\n@thumbmail\n\nwhen flag clicked\nhide\n\nshow\ngo to [front v] layer\n\n@Sprite1\n\nwhen flag clicked\nforever\n    if <(Level) = [8]> then\n        show\n        if <touching (player v)?> then\n            broadcast (Reset v)\n            broadcast (Transition v)\n            change [level v] by (1)\n            hide\n        end\n    else\n        hide\n    end\nend\n\n@WHERE DO YOU THINK YOU ARE GOING?!\n\nwhen flag clicked\nhide\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.1)\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\nswitch costume to (costume1 v)\n\n