Jungle || A Platformer 

Instructions: Please double click the green flag or there will be a glitch\n\nThis is my entry for @SUNBITES10  platformer contest.\n\nInstructions-\n1.   Arrow keys or WASD to move.\n2.   Avoid Spikes, Lava , Voids and lasers.\n3.   You can collect coins and buy Skins from the shop.\n4.   Find The cure \n5.   Left or Right arrow with up arrow to wall jump.\n6. R to restart, S to Skip.\n7. Enjoy!\n\nCheck this out - https://scratch.mit.edu/projects/441453521\n\n

@Stage\n\nwhen flag clicked\nswitch backdrop to (intro v) and wait\n\nwhen I receive [intro over v]\nbroadcast (Storyline v)\nrepeat (1)\n    switch backdrop to (jungle artwork2 v) and wait\n    wait (5) seconds\n    switch backdrop to (jungle artwork3 v) and wait\n    wait (5) seconds\n    switch backdrop to (jungle artwork4 v) and wait\n    wait (5) seconds\n    switch backdrop to (jungle artwork6 v) and wait\n    wait (5) seconds\n    switch backdrop to (jungle artwork v) and wait\n    broadcast (Play! v)\nend\n\nwhen I receive [play! v]\nforever\n    if <not <(Level No.) = [19]>> then\n        play sound [Itro & Tobu - Cloud 9 v] until done\n        wait (3) seconds\n        play sound [Sunshine v] until done\n        wait (3) seconds\n        play sound [Tobu0Song v] until done\n        wait (1) seconds\n    end\nend\n\nwhen I receive [storyline v]\nplay sound [Popsicle v] until done\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\n@Player2\n\nwhen flag clicked\nhide\n\nwhen I receive [play! v]\nshow\n\nwhen flag clicked\nhide variable [xv v]\nhide variable [jumped? v]\nhide variable [yv v]\n\nwhen flag clicked\nswitch costume to (1 v)\n\nwhen flag clicked\nforever\n    if <<(x position) = [240]> or <<(y position) > [-108]> and <(x position) = [240]>>> then\n        go to x: (-212) y: (-107)\n        broadcast (Next Level! v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (dangers v)?> then\n        go to x: (-217) y: (-107)\n    end\n    if <touching (smasher 11 v)?> then\n        go to x: (-217) y: (-107)\n    end\nend\n\nwhen I receive [play! v]\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <not <(Level No.) = [19]>> then\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            change [xv v] by (-1)\n        end\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            change [xv v] by (1)\n        end\n        change x by (Xv)\n        if <touching (lv v)?> then\n            change x by ((Xv) * (-1))\n            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                set [yv v] to [10]\n                if <(Xv) > [0]> then\n                    set [xv v] to [-15]\n                else\n                    set [xv v] to [15]\n                end\n            else\n                set [xv v] to [0]\n            end\n            set [xv v] to [0]\n        else\n            set [xv v] to ((Xv) * (0.8))\n        end\n        change y by (Yv)\n        if <touching (lv v)?> then\n            change y by ((Yv) * (-1))\n            set [yv v] to [0]\n            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                if <(Jumped?) = [0]> then\n                    set [yv v] to [11]\n                    set [jumped? v] to [1]\n                    start sound [Jump v]\n                end\n            end\n        else\n            change [yv v] by (-1)\n            set [jumped? v] to [0]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (r v) pressed?> then\n        go to x: (-217) y: (-107)\n    end\nend\n\nwhen I receive [restart because s v]\ngo to x: (-217) y: (-107)\n\nwhen flag clicked\nforever\n    if <touching (coin v)?> then\n        start sound [Water Drop v]\n        change [$ v] by (1)\n        broadcast ($ v)\n    end\nend\n\nwhen I receive [play! v]\nplay sound [Connect v] until done\n\nwhen I receive [play! v]\nshow\ngo to x: (-217) y: (-107)\n\nwhen flag clicked\nforever\n    if <touching (trampoline v)?> then\n        change [yv v] by (10)\n    end\n    if <touching (no jump v)?> then\n        change [jumped? v] by (16)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Shop Things) = [Multi]> then\n        switch costume to (multi v)\n    end\n    if <(Shop Things) = [White]> then\n        switch costume to (white v)\n    end\n    if <(Shop Things) = [Camo]> then\n        switch costume to (camo v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(y position) = [-180]> then\n        go to x: (-212) y: (-107)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (dangers v)?> then\n        go to x: (-217) y: (-107)\n    end\nend\n\nwhen I receive [laser v]\ngo to x: (-217) y: (-108)\n\nwhen flag clicked\nforever\n    if <(Level No.) = [19]> then\n        say [That Might be the cure!]\n        wait (2) seconds\n        move (10) steps\n        move (10) steps\n        broadcast (End v)\n        wait (1) seconds\n        stop [other scripts in sprite v]\n        stop [this script v]\n    end\nend\n\nwhen I receive [end v]\nhide\n\nwhen I receive [end v]\nbroadcast (Outro! v)\n\n@Lv\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nset [skip limit v] to [3]\nset [level no. v] to [0]\nhide\n\nwhen I receive [next level! v]\nnext costume\n\nwhen flag clicked\nswitch costume to (lv 1 v)\n\nwhen I receive [play! v]\nshow\n\nwhen I receive [play! v]\nshow\n\nwhen [s v] key pressed\nif <<not <(Skip Limit) = [0]>> or <(Skip Limit) < [0]>> then\n    next costume\n    change [skip limit v] by (-1)\n    broadcast (Restart Because S v) and wait\nend\n\nwhen I receive [end v]\nforever\n    stop [other scripts in sprite v]\nend\n\nwhen I receive [play! v]\nshow\n\nwhen flag clicked\nforever\n    set [level no. v] to (costume [number v])\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [3]> then\n        broadcast (Lv 3 v)\n    end\nend\n\nwhen flag clicked\nforever\n\n@Dangers\n\nwhen flag clicked\nforever\n    if <(Level No.) = [6]> then\n        set size to (50) %\n        go to x: (-86) y: (-100)\n        switch costume to (lava  6 v)\n        show\n    end\n    if <(Level No.) = [7]> then\n        hide\n    end\n    if <(Level No.) = [9]> then\n        go to x: (-31) y: (-16)\n        set size to (100) %\n        switch costume to (lv 9 v)\n        show\n    end\n    if <(Level No.) = [10]> then\n        hide\n    end\n    if <(Level No.) = [13]> then\n        go to x: (-46) y: (-68)\n        set size to (50) %\n        switch costume to (lv 13 v)\n        show\n    end\n    if <(Level No.) = [14]> then\n        go to x: (-59) y: (-71)\n        set size to (50) %\n        switch costume to (lv 14 v)\n        show\n    end\n    if <(Level No.) = [16]> then\n        hide\n    end\n    if <(Level No.) = [17]> then\n        go to x: (-59) y: (-71)\n        set size to (50) %\n        switch costume to (lv 17 v)\n        show\n    end\n    if <(Level No.) = [18]> then\n        go to x: (-59) y: (-71)\n        hide\n    end\nend\n\nwhen flag clicked\nhide\n\n@Coin\n\nwhen I receive [$ v]\nhide\n\nwhen flag clicked\nhide\n\nwhen [l v] key pressed\nshow variable [level no. v]\nwait (3) seconds\nhide variable [level no. v]\n\nwhen I receive [play! v]\nforever\n    if <(Level No.) = [1]> then\n        go to x: (174) y: (-106)\n        show\n        if <(Touched Coin) = [Yes]> then\n            hide\n        end\n    end\n    if <(Level No.) = [2]> then\n        go to x: (174) y: (-106)\n        show\n        if <(Touched Coin) = [Yes]> then\n            hide\n        end\n    end\n    if <(Level No.) = [3]> then\n        go to x: (174) y: (-106)\n        show\n        if <(Touched Coin) = [Yes]> then\n            hide\n        end\n    end\n    if <(Level No.) = [4]> then\n        go to x: (174) y: (-106)\n        show\n        if <(Touched Coin) = [Yes]> then\n            hide\n        end\n    end\n    if <(Level No.) = [5]> then\n        go to x: (174) y: (-106)\n        show\n        if <(Touched Coin) = [Yes]> then\n            hide\n        end\n    end\n    if <(Level No.) = [6]> then\n        go to x: (-42) y: (-100)\n        show\n        if <(Touched Coin) = [Yes]> then\n            hide\n        end\n    end\n    if <(Level No.) = [10]> then\n        go to x: (166) y: (-131)\n        show\n        if <(Touched Coin) = [Yes]> then\n            hide\n        end\n    end\n    if <(Level No.) = [19]> then\n        hide\n    end\nend\n\nwhen flag clicked\nset [touched coin v] to [No]\n\nwhen flag clicked\nforever\n    if <touching (player2 v)?> then\n        set [touched coin v] to [Yes]\n    end\nend\n\nwhen I receive [next level! v]\nset [touched coin v] to [No]\n\n@Trampoline\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(Level No.) = [7]> then\n        go to x: (-118) y: (-102)\n        show\n    end\n    if <(Level No.) = [8]> then\n        hide\n    end\nend\n\nwhen [space v] key pressed\n\nwhen flag clicked\nhide\n\n@NO JUMP\n\nwhen flag clicked\nhide\n\n@Arrow\n\n@Shop\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\nforever\n    go to x: (-118) y: (148)\nend\n\nwhen this sprite clicked\nbroadcast (Shop Open! v)\n\nwhen I receive [shop close:\( v]\nswitch costume to (costume1 v)\n\nwhen I receive [play! v]\nshow\n\nwhen I receive [shop open! v]\nswitch costume to (costume2 v)\n\n@Multi-Colour\n\nwhen flag clicked\nhide\nforever\n    go to x: (-122) y: (63)\nend\n\nwhen I receive [shop open! v]\ngo to [front v] layer\nshow\n\nwhen this sprite clicked\nif <<($) = [6]> or <($) > [6]>> then\n    set [shop things v] to [Multi]\n    if <(Item Held) < [1]> then\n        change [$ v] by (-10)\n        change [item held v] by (1)\n    else\n        change [$ v] by (0)\n    end\nend\n\nwhen flag clicked\nset [shop things v] to [0]\n\nwhen I receive [shop close:\( v]\nhide\n\nwhen flag clicked\nset [$ v] to [0]\n\nwhen flag clicked\nset [item held v] to [0]\n\n@Camo\n\nwhen I receive [shop open! v]\ngo to [front v] layer\nshow\n\nwhen I receive [shop open! v]\nshow\n\nwhen flag clicked\nhide\nforever\n    go to x: (-120) y: (16)\nend\n\nwhen this sprite clicked\nif <<($) = [8]> or <($) > [8]>> then\n    if <not <(Item Held C) = [1]>> then\n        change [$ v] by (-8)\n        set [shop things v] to [Camo]\n        change [item held c v] by (1)\n    else\n        change [$ v] by (0)\n    end\nend\n\nwhen I receive [shop close:\( v]\nhide\n\nwhen I receive [shop open! v]\nshow variable [$ v]\n\nwhen I receive [shop close:\( v]\nhide variable [$ v]\n\nwhen flag clicked\nset [item held c v] to [0]\n\n@White\n\nwhen flag clicked\nhide\nforever\n    go to x: (-121) y: (-37)\nend\n\nwhen I receive [shop open! v]\ngo to [front v] layer\nshow\n\nwhen this sprite clicked\nif <<($) = [6]> or <($) > [6]>> then\n    if <not <(Item Held W) = [1]>> then\n        change [$ v] by (-6)\n        set [shop things v] to [white]\n        change [item held w v] by (1)\n    else\n        change [$ v] by (0)\n    end\nend\n\nwhen I receive [shop close:\( v]\nhide\n\nwhen flag clicked\nhide variable [$ v]\n\nwhen flag clicked\nset [item held w v] to [0]\n\n@CLOSE SHOP\n\nwhen flag clicked\nhide\n\nwhen I receive [shop open! v]\ngo to [front v] layer\nshow\ngo to x: (87) y: (105)\n\nwhen this sprite clicked\nbroadcast (Shop Close:\( v)\n\nwhen I receive [shop close:\( v]\nhide\n\n@Smasher 11\n\nwhen flag clicked\nhide\n\nwhen flag clicked\ngo to x: (-7) y: (23)\nforever\n    change y by (50)\n    wait (2) seconds\n    change y by (-50)\n    wait (3) seconds\nend\n\nwhen flag clicked\nforever\n    if <(Level No.) = [1]> then\n        hide\n    end\n    if <(Level No.) = [11]> then\n        show\n    end\n    if <(Level No.) = [12]> then\n        hide\n    end\nend\n\n@LasersSuperBug5\n\nwhen flag clicked\nforever\n    switch costume to (2 v)\n    wait (3) seconds\n    switch costume to (2up v)\n    wait (3) seconds\nend\n\nwhen flag clicked\nhide\nforever\n    if <<(costume [number v]) = [2]> and <touching (player2 v)?>> then\n        broadcast (Laser v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level No.) = [14]> then\n        go to x: (-19) y: (-29)\n        show\n    end\n    if <(Level No.) = [16]> then\n        hide\n    end\nend\n\n@Sprite1\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\n\nwhen flag clicked\nforever\n    if <(Level No.) = [19]> then\n        show\n    end\nend\n\nwhen I receive [end v]\nswitch costume to (costume2 v)\nwait (5) seconds\nhide\n\n@to be continued\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\nshow\nwait (5) seconds\nhide\n\n@Outro\n\nwhen I start as a clone\nif <(costume [name v]) = [Logo]> then\n    set [color v] effect to (0)\n    set size to (100) %\n    set [ghost v] effect to (0)\n    go to x: (0) y: (0)\n    show\n    repeat until <(size) = [100]>\n        change size by (((100) - (size)) / (4))\n    end\n    forever\n        point in direction ((([tan v] of ((Rotate) * (150)) ) * (5)) + (90))\n        change [rotate v] by (0.02)\n        set [bounce 3 v] to (((Bounce 3) * (0.7)) + ((((100) + (<touching (mouse-pointer v)?> * (16))) - (size)) / (5)))\n        change size by (Bounce 3)\n    end\nend\n\ndefine Particles\nswitch costume to (particles v)\nrepeat (70)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [start v]\nswitch costume to (alpha v)\nset size to (100) %\nclone [Text]\nwait (1) seconds\nclone [Alpha]\nclone [Logo]\nclone [costume3]\nclone [Text]\nswitch costume to (ball v)\ngo to [front v] layer\nswitch costume to (ball16 v)\nclear graphic effects\nset size to (0) %\nshow\nswitch costume to (ball v)\nforever\n    repeat (10)\n        repeat (15)\n            change size by (10)\n            next costume\n            change [ghost v] effect by (7)\n        end\n        wait (1) seconds\n        switch costume to (ball v)\n        go to [front v] layer\n        switch costume to (ball16 v)\n        clear graphic effects\n        set size to (0) %\n        show\n        switch costume to (ball v)\n        repeat (15)\n            change size by (10)\n            next costume\n            change [ghost v] effect by (7)\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nset size to (300) %\nforever\n    if <(costume [name v]) = [Alpha]> then\n        set [size v] to [12]\n        set [size control v] to [200]\n        repeat (15)\n            change [size control v] by (((100) - (Size Control)) / (10000))\n            go to x: (pick random (-3) to (3)) y: (pick random (-5) to (5))\n        end\n        point in direction (90)\n        go to x: (0) y: (0)\n        set [size v] to [0]\n        set [size control v] to [100]\n    end\nend\n\nwhen flag clicked\n\ndefine clone (cos)\ncreate clone of (_myself_ v)\nswitch costume to (cos)\nshow\n\ndefine Clone\n\nwhen I start as a clone\nforever\n    if <(costume [name v]) = [costume3]> then\n        set size to (100) %\n    end\nend\n\nwhen I start as a clone\nforever\n    if < (costume [name v]) contains [Ball]?> then\n        repeat (10)\n            wait (0.7) seconds\n            clone [Ball]\n        end\n    end\nend\n\nwhen I receive [outro! v]\nshow\nbroadcast (Start v)\n\nwhen I receive [outro! v]\nforever\n    play sound [Timelapse-Song v] until done\nend\n\n@Sprite2\n\ndefine flote (speed) (amount) (y)\nchange y by ((((y) + (([cos v] of ((timer) * (speed)) ) * (amount))) - (y position)) * (0.3))\nturn right ((((90) + (([cos v] of ((timer) * ((speed) * (0.919))) ) * ((amount) / (2)))) - (direction)) * (0.3)) degrees\n\nwhen flag clicked\nhide\nstart sound [Jim Yosef & Anna Yvette - Linked \[NCS Release\]2 v]\nset [i v] to [1]\nrepeat (6)\n    set [cloneid v] to (join [tile ] (((i) mod (2)) + (1)))\n    create clone of (_myself_ v)\n    wait (0.1) seconds\n    change [i v] by (1)\nend\nwait (0.05) seconds\nset [cloneid v] to [slide 1]\ncreate clone of (_myself_ v)\nwait (0.15) seconds\nset [cloneid v] to [slide 2]\ncreate clone of (_myself_ v)\nwait (0.1) seconds\nset [cloneid v] to [pic]\ncreate clone of (_myself_ v)\nwait (0.1) seconds\nset [cloneid v] to [logo]\ncreate clone of (_myself_ v)\nwait (3) seconds\nset [cloneid v] to [end]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif < (cloneID) contains [tile]?> then\n    go to x: (-1000) y: (0)\n    show\n    point in direction (0)\n    set [i v] to [0]\n    set size to (0) %\n    forever\n        switch costume to (_internal smallcostume v)\n        change [i v] by (10)\n        change size by (i)\n        change x by ((x position) * (-0.25))\n        turn right (((90) - (direction)) * (0.2)) degrees\n        switch costume to (cloneID)\n    end\nelse\n    if < (cloneID) contains [slide]?> then\n        go to x: (0) y: (500)\n        switch costume to (cloneID)\n        show\n        forever\n            change y by (((-100) - (y position)) * (0.25))\n        end\n    else\n        if <(cloneID) = [pic]> then\n            switch costume to (picture v)\n            go to x: ((240) + ((719) / (2))) y: (0)\n            show\n            forever\n                set [i v] to ((x position) / (-7))\n                change x by (i)\n            end\n        else\n            if <(cloneID) = [logo]> then\n                go to [front v] layer\n                go to x: (0) y: (0)\n                boom [30]\n                set size to (75) %\n                set [i v] to [0]\n                switch costume to (logo v)\n                show\n                repeat (30)\n                    set [i v] to (((i) * (0.8)) + (((100) - (size)) / (5)))\n                    change size by (i)\n                    flote [100] [15] []\n                end\n                repeat (30)\n                    change size by (((40) - (size)) / (6))\n                    change x by (((-210) - (x position)) / (8))\n                    change [ghost v] effect by (2.5)\n                    flote [100] [15] []\n                end\n                set x to ((x position) * (-1))\n                repeat (30)\n                    change size by (((100) - (size)) / (6))\n                    change x by (((0) - (x position)) / (8))\n                    change [ghost v] effect by (-2.5)\n                    flote [100] [15] []\n                end\n                forever\n                    flote [100] [15] []\n                end\n            else\n                if <(cloneID) = [particle]> then\n                    set [cos v] to (pick random (8) to (9))\n                    set [vel v] to (pick random (3.) to (10.))\n                    set [vel2 v] to (pick random (10.) to (12.))\n                    set size to (pick random (40) to (90)) %\n                    point in direction (pick random (-180) to (180))\n                    show\n                    forever\n                        switch costume to (internal _beeeeeg v)\n                        move (vel) steps\n                        change y by (vel2)\n                        set [vel v] to ((vel) * (0.95))\n                        change [vel2 v] by (-0.4)\n                        switch costume to ((0) + (cos))\n                        if <(y position) < [-50]> then\n                            change [ghost v] effect by (6)\n                        end\n                    end\n                else\n                    if <(cloneID) = [end]> then\n                        switch costume to (donee v)\n                        go to x: (480) y: (-360)\n                        point in direction (0)\n                        show\n                        broadcast (Intro || Fade Music v)\n                        repeat (52)\n                            change x by ((x position) / (-8))\n                            change y by ((y position) / (-8))\n                            turn right (((90) - (direction)) / (7)) degrees\n                            go to [front v] layer\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine boom (particle no.)\nset [cloneid v] to [particle]\nrepeat (particle no.)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [intro || fade music v]\nrepeat (52)\n    change volume by ((-100) / (52))\nend\nstop all sounds\nwait (0) seconds\nset volume to (100) %\nbroadcast (Intro || End v)\n\nwhen I receive [intro || end v]\nbroadcast (Intro Over v)\ndelete this clone\n\n@TN\n\nwhen flag clicked\nhide\n\ngo to [front v] layer\nshow\n\n