Crystal Cavern: A platformer #Games 

Instructions: It's been a while since I last made a platformer, so here you go!\n--------------------------------------------------------------------------------------------------------------------------------------------------\nw,a,s,d or arrow keys to move. There are also mobile controls, just tap in the direction you want to go. You can crouch using the s or arrow keys\n\nBackstory:\nA little light cube is lost in a large cave. Help it find its way back to its home, the Crystal City.\n\nFeatures not found in generic platformers.\n-The player glows\n-Animated torches and glowing crystal art (the crystals aren't animated though)\n- Falling rocks\n-Fancy particles\n-If you touch a large falling particle, you will change into the color of that particle.\n\nProject Discussion Forum: https://scratch.mit.edu/discuss/topic/527744/\nGive feedback or suggestions there. :)

@Stage\n\nwhen flag clicked\nset [the level v] to [1]\nforever\n    switch backdrop to (The Level)\nend\n\nwhen flag clicked\nset volume to (100) %\nforever\n    play sound [bensound-deepblue v] until done\nend\n\nwhen I receive [end v]\nrepeat (10)\n    change volume by (-10)\nend\n\nset [the level v] to [15]\n\n@Player\n\nwhen flag clicked\nset [the level v] to [1]\nbroadcast (Next Level v)\nforever\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [x velocity v] by (-1.5)\n    end\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [x velocity v] by (1.5)\n    end\n    set [x velocity v] to ((X Velocity) * (0.85))\n    change x by (X Velocity)\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (-4)\n        change x by ((X Velocity) * (-1))\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            if <(X Velocity) > [0]> then\n                set [x velocity v] to [-10]\n            else\n                set [x velocity v] to [10]\n            end\n            set [y velocity v] to [15]\n        else\n            set [x velocity v] to [0]\n        end\n    end\n    change [y velocity v] by (-1)\n    change y by (Y Velocity)\n    if <touching (ground v)?> then\n        change y by ((Y Velocity) - ((Y Velocity) * (2)))\n        set [y velocity v] to [0]\n        if <<<key (down arrow v) pressed?> or <key (s v) pressed?>> or <<mouse down?> and <(mouse y) < (y position)>>> then\n            switch costume to (crouch v)\n        else\n            switch costume to (player v)\n        end\n    end\n    change y by (-1)\n    if <<<touching (ground v)?> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> or <<touching (ground v)?> and <<mouse down?> and <(mouse y) > (y position)>>>> then\n        set [y velocity v] to [15]\n    end\n    change y by (1)\n    if <(x position) > [239]> then\n        broadcast (Next Level v) and wait\n        change [the level v] by (1)\n    end\n    if <<touching (spikes v)?> or <touching (falling rocks v)?>> then\n        start sound [Crunch v]\n        broadcast (Reset v)\n        create clone of (_myself_ v)\n    else\n        if <<<key (down arrow v) pressed?> or <key (s v) pressed?>> or <<mouse down?> and <(mouse y) < (y position)>>> then\n            switch costume to (crouch v)\n        else\n            switch costume to (player v)\n        end\n    end\n    if <touching (lava v)?> then\n        start sound [Crunch v]\n        broadcast (Reset v)\n    end\n    if <(y position) < [-175]> then\n        broadcast (Reset v)\n        start sound [High Whoosh v]\n    end\nend\n\nwhen I start as a clone\nclear graphic effects\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-10)\n    change y by (5)\n    turn right (5) degrees\nend\ndelete this clone\n\nwhen I receive [next level v]\nbroadcast (Reset v)\n\nwhen I receive [reset v]\nswitch costume to (player v)\nset [x velocity v] to [0]\nset [y velocity v] to [0]\ngo to x: (-216) y: (40)\n\nwhen I receive [change color v]\nset [color v] effect to (Color Effect)\n\nwhen flag clicked\nforever\n    if <(The Level) = [16]> then\n        broadcast (End v) and wait\n        stop [other scripts in sprite v]\n    end\nend\n\n@Ground\n\nwhen flag clicked\nforever\n    switch costume to (The Level)\nend\n\nset [the level v] to [15]\n\n@Spikes\n\nwhen flag clicked\nforever\n    switch costume to (The Level)\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\n@Lava\n\nwhen flag clicked\nforever\n    set y to (Magma)\n    switch costume to (The Level)\nend\n\nwhen flag clicked\nforever\n    set [magma v] to [0]\n    repeat (10)\n        change [magma v] by (1)\n    end\n    repeat (20)\n        change [magma v] by (-1)\n    end\n    repeat (10)\n        change [magma v] by (1)\n    end\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\n@Thumbnail\n\nwhen flag clicked\nshow\ngo to [front v] layer\nwait (1) seconds\ngo to x: (0) y: (0)\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\n@Love fave\n\nwhen flag clicked\nset [costume v] to [0]\nhide\nforever\n    if <not <<(Love) = [1]> and <(Favorite) = [1]>>> then\n        wait (pick random (30) to (40)) seconds\n        switch costume to (costume1 v)\n        go to x: (0) y: (50)\n        show\n        go to [front v] layer\n        start sound [pop v]\n        repeat (9)\n            change y by (-6)\n        end\n        repeat (5)\n            change y by (3)\n        end\n        repeat (5)\n            change y by (-1)\n        end\n        wait (2) seconds\n        repeat (15)\n            change y by (7)\n        end\n        hide\n    end\n    if <(Costume) > [0]> then\n        hide\n        stop [this script v]\n    end\nend\n\n@Player Trail\n\nwhen flag clicked\nshow\nforever\n    point in direction ([direction v] of [player v])\n    switch costume to ([costume name v] of [player v])\n    go to x: ([x position v] of [player v]) y: ([y position v] of [player v])\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nrepeat (10)\n    change [ghost v] effect by (21)\n    change size by (-10)\nend\ndelete this clone\n\nwhen I receive [scroll v]\nhide\ndelete this clone\n\nwhen I receive [change color v]\nset [color v] effect to (Color Effect)\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\nset [ghost v] effect to (100)\ngo to [front v] layer\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nstop [all v]\n\n@Sprite3\n\ngo to [back v] layer\n\n@Glow\n\nwhen flag clicked\nforever\n    go to (player v)\nend\n\nwhen flag clicked\nset size to (100) %\nforever\n    repeat (20)\n        change size by (0.5)\n    end\n    repeat (20)\n        change size by (-0.5)\n    end\nend\n\nwhen I receive [change color v]\nset [color v] effect to (Color Effect)\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\n@Sprite5\n\nwhen flag clicked\ngo to [back v] layer\nset size to (100) %\nforever\n    repeat (20)\n        change size by (0.5)\n    end\n    repeat (20)\n        change size by (-0.5)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(The Level) > [10]> then\n        hide\n    else\n        show\n    end\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\n@Sprite6\n\nwhen flag clicked\ngo to [back v] layer\nset size to (100) %\nforever\n    repeat (20)\n        change size by (0.5)\n    end\n    repeat (20)\n        change size by (-0.5)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(The Level) > [10]> then\n        hide\n    else\n        show\n    end\nend\n\nset [the level v] to [11]\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\n@Sprite7\n\n@Falling rocks\n\nwhen flag clicked\nforever\n    set y to (180)\n    repeat until <(y position) < [-175]>\n        change y by (-10)\n    end\n    wait (1) seconds\nend\n\nwhen flag clicked\nforever\n    switch costume to (The Level)\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\n@Particles\n\nwhen flag clicked\nhide\nforever\n    if <(The Level) > [10]> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    wait (pick random (0.5) to (1)) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nforever\n    set y to (180)\n    set x to (pick random (-250) to (250))\n    set [color v] effect to (pick random (-100) to (100))\n    repeat until <(y position) < [-175]>\n        change y by (pick random (-1) to (-5))\n    end\n    delete this clone\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\n@large Particles\n\nwhen flag clicked\nhide\nset [color effect v] to [0]\n\nwhen flag clicked\nhide\nforever\n    wait (pick random (9) to (14)) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nforever\n    set y to (180)\n    set x to (pick random (-250) to (250))\n    set [color effect v] to (pick random (-100) to (100))\n    set [color v] effect to (Color Effect)\n    repeat until <(y position) < [-175]>\n        change y by (pick random (-1) to (-5))\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(The Level) > [10]> then\n    show\nelse\n    hide\nend\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        start sound [Magic Spell v]\n        broadcast (Change color v)\n        delete this clone\n    end\nend\n\nwait (0.1) seconds\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\n@Signs\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    switch costume to (The Level)\n    if <(The Level) = [1]> then\n        if <touching (player v)?> then\n            say [This way to Glowing Crystal Cavern]\n        else\n            say []\n        end\n    end\n    if <(The Level) = [3]> then\n        if <touching (player v)?> then\n            say [Careful up ahead. Large drop.]\n        else\n            say []\n        end\n    end\n    if <(The Level) = [4]> then\n        if <touching (player v)?> then\n            say [You might want to duck ahead...\(press down arrow\)]\n        else\n            say []\n        end\n    end\n    if <(The Level) = [5]> then\n        if <touching (player v)?> then\n            say [WATCH OUT FOR FALLING ROCKS!!]\n        else\n            say []\n        end\n    end\n    if <(The Level) = [11]> then\n        if <touching (player v)?> then\n            say [Welcome to Glowing Crystal Cavern! Try touching the large falling glowing particles to change the color of your player.]\n        else\n            say []\n        end\n    end\n    if <(The Level) = [15]> then\n        if <touching (player v)?> then\n            say [Welcome to Crystal City!]\n        else\n            say []\n        end\n    end\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\n\n@End\n\nwhen I receive [end v]\nwait (1) seconds\ngo to [front v] layer\nshow\n\nwhen flag clicked\nhide\n\n