The deadly forest #Entry #Games #Platformer

Instructions: No more P2 please\nPart 2!!!! https://scratch.mit.edu/projects/434780409\n\nArrow keys to move, avoid thorns and water.\nThis is for @-SapphireDemon-'s contest, but sorry if its kind of generic.\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\nP.S. Probably my favourite platformer I've made so far

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nset [level v] to [1]\nforever\n    if <(Level) = [2]> then\n        switch backdrop to (backdrop2 v)\n    end\n    if <(Level) > [2]> then\n        switch backdrop to (backdrop3 v)\n    end\nend\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nset [level v] to [1]\nforever\n    play sound [C418 - Moog City v] until done\nend\n\nwhen flag clicked\nset volume to (100) %\nforever\n    if <key (m v) pressed?> then\n        set volume to (0) %\n    end\n    if <key (u v) pressed?> then\n        set volume to (100) %\n    end\nend\n\nwait until <not <key (m v) pressed?>>\nwait (0.1) seconds\nwait until <key (m v) pressed?>\n\n@Player\n\ndefine reset\nclear graphic effects\ngo to x: (-200) y: (-50)\npoint in direction (90)\nset [dead? v] to [0]\nset [x v v] to [0]\nset [y v v] to [0]\nset size to (100) %\nshow\n\nwhen I receive [next level v]\nset [change? v] to [1]\nreset\nset [change? v] to [0]\n\nwhen I receive [alright bros let's go v]\nset [level v] to [1]\nset [dead? v] to [0]\nset size to (100) %\nreset\nforever\n    go to [front v] layer\n    show\n    if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> and <(dead?) = [0]>> 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)>>> and <(dead?) = [0]>> 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            set [y v v] to [12]\n        end\n    end\n    change y by (1)\n    if <<<<<touching (killer wheel v)?> or <touching (thorns v)?>> or <touching (killer wheel2 v)?>> or <touching (water v)?>> and <(dead?) = [0]>> then\n        Spin off screen\n    end\n    if <touching (jump pad v)?> then\n        set [y v v] to [20]\n    end\nend\n\nwhen I receive [alright bros let's go v]\nforever\n    set [direction v] to (direction)\nend\n\nwhen I receive [alright bros let's go v]\nset [change? v] to [0]\nforever\n    if <<(x position) = [240]> and <(dead?) = [0]>> then\n        broadcast (NEXT LEVEL v)\n        change [level v] by (1)\n    end\nend\n\nwhen I receive [alright bros let's go v]\nforever\n    if <(y position) = [-179]> then\n        Spin off screen\n    end\nend\n\nwhen [r v] key pressed\nif <(dead?) = [0]> then\n    reset\nend\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nwhen I receive [alright bros let's go v]\nshow\n\ndefine Spin off screen\nset [dead? v] to [1]\nchange [player death v] by (1)\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nreset\n\nwhen I receive [alright bros let's go v]\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nswitch costume to (center2 v)\nrepeat (10)\n    change [ghost v] effect by (5)\n    change size by (-5)\nend\ndelete this clone\n\nwhen flag clicked\n\nwhen flag clicked\nbroadcast (alright bros let's go v)\n\nwhen I receive [alright bros let's go v]\nshow\nforever\n    if <touching (thumbnail v)?> then\n        hide\n    end\nend\n\n@Ground\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\n@Deco\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\n@Darkness\n\nwhen flag clicked\nforever\n    if <(Level) > [2]> then\n        show\n        go to [front v] layer\n        set [ghost v] effect to (35)\n    else\n        hide\n    end\nend\n\nwhen I receive [mr. thumbnail time v]\nhide\n\n@Thorns\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\n@Drops\n\nwhen flag clicked\nhide\nforever\n    go to [back v] layer\n    if <(Level) > [2]> then\n        repeat (pick random (1) to (3))\n            create clone of (_myself_ v)\n        end\n        wait (0.7) seconds\n    else\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nshow\nset y to (180)\nset x to (pick random (-240) to (240))\nrepeat until <<touching (ground v)?> or <<touching (player v)?> or <<touching (deco v)?> or <<touching (thorns v)?> or >>>>\n    change y by (pick random (-1) to (-3))\nend\ndelete this clone\n\n@Water\n\nwhen flag clicked\nswitch costume to (costume1 v)\nforever\n    go to [back v] layer\n    if <<(Level) = [7]> or <<(Level) = [8]> or <(Level) = [6]>>> then\n        show\n        if <(Level) = [7]> then\n            switch costume to (costume2 v)\n        else\n            if <(Level) = [6]> then\n                switch costume to (costume1 v)\n            else\n                switch costume to (costume3 v)\n            end\n        end\n    else\n        hide\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    repeat (4)\n        change y by (1)\n        wait (0.1) seconds\n    end\n    wait (0.1) seconds\n    repeat (4)\n        change y by (-1)\n        wait (0.1) seconds\n    end\n    wait (0.1) seconds\nend\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    hide\nend\n\nwait (1) seconds\nrepeat until <(y position) = [0]>\n    change y by (2)\nend\n\nif <key (t v) pressed?> then\nelse\nend\nif <(Level) = [9]> then\nelse\n    go to x: (0) y: (-398)\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\nend\n\nrepeat (4)\n    change y by (1)\n    wait (0.1) seconds\nend\nwait (0.1) seconds\nrepeat (4)\n    change y by (-1)\n    wait (0.1) seconds\nend\nwait (0.1) seconds\n\nbroadcast (Mr. Thumbnail time v)\ngo to [front v] layer\nshow\n\n@Added light\n\nwhen flag clicked\nforever\n    go to (player v)\n    if <(Level) > [2]> then\n        go to [front v] layer\n        go [backward v] (1) layers\n        show\n    else\n        go to [back v] layer\n        hide\n    end\nend\n\nwhen flag clicked\nset size to (90) %\nforever\n    repeat (10)\n        change size by (1)\n        wait (0.1) seconds\n    end\n    wait (0.1) seconds\n    repeat (10)\n        change size by (-1)\n        wait (0.1) seconds\n    end\n    wait (0.1) seconds\nend\n\n