Snowstorm - A Platformer

Instructions: You! Yeah, you! Why are you playing this old, boring game. Don't you want to play a newer, more fun game like Fort Defender by my friend @NooberGames ? This unique game lets you keep enemies away from your fort, then upgrade your weapons with the cash you earn! Play it here:\nhttps://scratch.mit.edu/projects/457463939/\n\n\nThis is a platformer with 40 levels.\nUse arrow keys or WASD to move on a laptop/desktop or tap left, right, and top areas of the screen.\n-No wall jumps\n- Try clicking and holding the sky with your mouse\n-There is an easter egg\n-Press R to restart a level if you get stuck or glitched into a platform\n-Press keys 1-9 to change skin\nNOTE: The character appears to jump/glitch while going up slopes. I will try to fix this bug.\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\n\n\n\n\n\nYou want to know where the easter egg is, don't you?\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nFine, I'll tell you!\nIt's at the bottom of level 16!

@Stage\n\nwhen flag clicked\nclear graphic effects\nset [brightness v] effect to (-20)\nrepeat (500)\n    change [brightness v] effect by (-0.02)\n    wait (0.003) seconds\nend\nforever\n    repeat (1000)\n        change [brightness v] effect by (0.02)\n        wait (0.003) seconds\n    end\n    repeat (1000)\n        change [brightness v] effect by (-0.02)\n        wait (0.003) seconds\n    end\nend\n\nwhen I receive [next level v]\nstart sound [Level done v]\nstart sound [Level done v]\nstart sound [Level done v]\n\nwhen I receive [intro done v]\nforever\n    play sound [Music v] until done\n    play sound [Music2 v] until done\n    play sound [Music3 v] until done\nend\n\n@Snowflake\n\nwhen flag clicked\nreset timer\nhide\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nswitch costume to (pick random (1) to (11))\nset [brightness v] effect to (pick random (-5) to (15))\nif <(timer) < [1]> then\n    go to x: (pick random (-250) to (250)) y: (pick random (-190) to (-100))\nelse\n    go to x: (pick random (-250) to (250)) y: (pick random (0) to (190))\nend\nwait (pick random (0) to (8)) seconds\nrepeat (25)\n    change [ghost v] effect by (4)\n    wait (0.1) seconds\nend\ndelete this clone\n\nwhen I start as a clone\nset size to (pick random (30) to (40)) %\nset [ghost v] effect to (pick random (-200) to (100))\nforever\n    repeat until <touching (ground v)?>\n        change y by (pick random (-1) to (-2))\n    end\nend\n\nwhen I start as a clone\nforever\n    repeat until <touching (ground v)?>\n        repeat (pick random (20) to (40))\n            change x by (pick random (1) to (4))\n        end\n        repeat (pick random (20) to (30))\n            change x by (pick random (-1) to (-4))\n        end\n        wait (0) seconds\n    end\nend\n\nwhen I start as a clone\ngo to [front v] layer\nforever\n    if <[-230] > (x position)> then\n        set x to (-230)\n    end\n    if <(x position) > [230]> then\n        set x to (230)\n    end\n    if <touching (player v)?> then\n        if <(pick random (1) to (2)) = [1]> then\n            repeat (20)\n                change x by (2.5)\n                change y by (1)\n            end\n            repeat (10)\n                change x by (2.5)\n                change y by (-2)\n            end\n        else\n            repeat (20)\n                change x by (-2.5)\n                change y by (1)\n            end\n            repeat (10)\n                change x by (-2.5)\n                change y by (-2)\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <<(distance to [mouse-pointer v]) < [40]> and <mouse down?>> then\n        go to x: ((mouse x) + (pick random (-10) to (10))) y: ((mouse y) + (pick random (-10) to (10)))\n    end\nend\n\nwhen I start as a clone\nforever\n    if <touching (ground v)?> then\n        change y by (1)\n    end\nend\n\nwhen I start as a clone\nforever\n    change x by (pick random (0) to (-0.8))\nend\n\n@Ground\n\nwhen flag clicked\nreset timer\nswitch costume to (1 v)\ngo to x: (0) y: (0)\nset [level v] to [1]\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nforever\n    hide variable [level v]\nend\n\n@White1\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (pick random (15) to (20))\n    set size to (pick random (140) to (150)) %\n    go to x: (pick random (-4) to (4)) y: (pick random (-3) to (3))\nend\n\n@White2\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (pick random (30) to (35))\n    set size to (pick random (140) to (150)) %\n    go to x: (pick random (-4) to (4)) y: (pick random (-3) to (3))\nend\n\n@Cloud\n\nwhen flag clicked\nhide\nforever\n    wait (pick random (0) to (10)) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nset [ghost v] effect to (pick random (40) to (50))\nset size to (pick random (90) to (250)) %\nset x to (290)\nshow\nif <(pick random (1) to (2)) = [1]> then\n    repeat (116)\n        change x by (-5)\n    end\nelse\n    repeat (290)\n        change x by (-2)\n    end\nend\nrepeat (6)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    set y to (((mouse y) / (20)) + (pick random (139) to (140)))\n    wait (0.03) seconds\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\n    go to [front v] layer\nend\n\n@Intro\n\nwhen flag clicked\nclear graphic effects\nhide\ngo to [front v] layer\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nset size to (0) %\nswitch costume to (requin323 logo v)\nset volume to (100) %\nplay sound [pop v] until done\nstart sound [Intro music v]\nshow\nrepeat (10)\n    change size by (2)\n    change [ghost v] effect by (-10)\nend\nrepeat (8)\n    change size by (13)\nend\nrepeat (3)\n    change size by (5)\nend\nrepeat (2)\n    change size by (2)\nend\nwait (3) seconds\nrepeat (25)\n    change size by (3)\n    change [ghost v] effect by (4)\nend\nrepeat (5)\n    change volume by (-1)\nend\nrepeat (5)\n    change volume by (-2)\nend\nrepeat (10)\n    change volume by (-4)\nend\nrepeat (4)\n    change volume by (-10)\nend\nrepeat (5)\n    change volume by (-1)\nend\nstop all sounds\nwait (0.5) seconds\nbroadcast (Intro done v)\n\nwhen flag clicked\nset [brightness v] effect to (20)\nrepeat (100)\n    change [brightness v] effect by (-0.2)\nend\n\n@Easter Egg\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nwait until <<([x position v] of [player v]) > [-100]> and <<[-150] > ([y position v] of [player v])> and <(Level) = [16]>>>\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nrepeat (200)\n    change [ghost v] effect by (0.5)\nend\n\n@Level display\n\nwhen flag clicked\nhide\ngo to x: (-185) y: (150)\nrepeat (2)\n    create clone of (_myself_ v)\n    change x by (-35)\nend\nforever\n    switch costume to (costume v)\n    set size to (300) %\n    repeat (3)\n        change [brightness v] effect by (3)\n    end\n    repeat (12)\n        change [brightness v] effect by (-0.75)\n    end\n    wait (pick random (0) to (20)) seconds\nend\n\nwhen I start as a clone\nforever\n    if <(x position) = [-220]> then\n        switch costume to ((11) + (2))\n    else\n        switch costume to ((12) + (2))\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) > [9]> then\n        set [11 v] to (letter (1) of (Level))\n        set [12 v] to (letter (2) of (Level))\n    else\n        set [11 v] to (letter (1) of (Level))\n        set [12 v] to [10]\n    end\nend\n\nwhen flag clicked\nforever\n    set [score: v] to (round ((Score:) * (1.01)))\n    wait (pick random (1) to (4)) seconds\nend\n\nwhen flag clicked\nwait (1) seconds\nforever\n    if <(Playing) = [1]> then\n        go to [front v] layer\n    end\nend\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (100)\nwait (6) seconds\nrepeat (25)\n    change [ghost v] effect by (-4)\nend\nforever\n    if <(Level) > [40]> then\n        hide\n    end\nend\n\n@Player\n\nwhen flag clicked\ngo to x: (-235) y: (-90)\nset [takeoffspeed v] to [13]\nset [runspeed v] to [2]\nset [gravity v] to [-1]\nset [fallspeed v] to [0]\nset [level v] to [1]\nset size to (50) %\n\ndefine Jump control\nif <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<(mouse y) > [0]> and <mouse down?>>> then\n    change y by (-1)\n    if <touching (ground v)?> then\n        set [fallspeed v] to (TakeoffSpeed)\n    end\n    change y by (1)\nend\n\ndefine Simulate gravity\nchange y by (Fallspeed)\nif <touching (ground v)?> then\n    change y by ((0) - (Fallspeed))\n    set [fallspeed v] to [0]\nelse\n    change [fallspeed v] by (Gravity)\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go [backward v] (1) layers\nend\n\nwhen flag clicked\nforever\n    if <(Level) < [41]> then\n        if <(x position) > [230]> then\n            go to x: (-235) y: (-50)\n            broadcast (Next level v)\n            change [level v] by (1)\n        end\n    end\nend\n\nwhen [r v] key pressed\ngo to x: (-235) y: (-90)\n\nwhen I receive [intro done v]\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    Jump control\n    Simulate gravity\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\nwhen flag clicked\nswitch costume to (1 v)\n\nwhen [1 v] key pressed\nswitch costume to (1 v)\n\nwhen [2 v] key pressed\nswitch costume to (2 v)\n\nwhen [4 v] key pressed\nswitch costume to (4 v)\n\nwhen [3 v] key pressed\nswitch costume to (3 v)\n\nwhen [5 v] key pressed\nswitch costume to (5 v)\n\nwhen [7 v] key pressed\nswitch costume to (7 v)\n\nwhen [8 v] key pressed\nswitch costume to (8 v)\n\nwhen [6 v] key pressed\nswitch costume to (6 v)\n\nwhen [9 v] key pressed\nswitch costume to (9 v)\n\nwhen flag clicked\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        wait until <not <<key (right arrow v) pressed?> or <key (d v) pressed?>>>\n        wait (1) seconds\n        if <not <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n            set [runspeed v] to [3]\n        end\n    end\n    if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n        wait until <not <<key (a v) pressed?> or <key (left arrow v) pressed?>>>\n        wait (1) seconds\n        if <not <<key (a v) pressed?> or <key (left arrow v) pressed?>>> then\n            set [runspeed v] to [3]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<(mouse x) < [0]> and <<[50] > (mouse y)> and <mouse down?>>>> then\n        change [runspeed v] by (1)\n        change x by ((0) - (RunSpeed))\n        if <touching (ground v)?> then\n            change y by (1)\n        end\n        if <touching (ground v)?> then\n            change y by (2)\n        end\n        if <touching (ground v)?> then\n            change y by (3)\n        end\n        if <touching (ground v)?> then\n            change y by (4)\n        end\n        if <touching (ground v)?> then\n            change y by (10)\n        end\n        if <touching (ground v)?> then\n            change y by (10)\n        end\n        if <touching (ground v)?> then\n            change y by (10)\n        end\n        if <touching (ground v)?> then\n            change y by (10)\n        end\n        if <touching (ground v)?> then\n            change y by (-50)\n            change x by (RunSpeed)\n            show\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<[-1] < (mouse x)> and <<[50] > (mouse y)> and <mouse down?>>>> then\n        change [runspeed v] by (1)\n        change x by (RunSpeed)\n        if <touching (ground v)?> then\n            change y by (1)\n        end\n        if <touching (ground v)?> then\n            change y by (2)\n        end\n        if <touching (ground v)?> then\n            change y by (3)\n        end\n        if <touching (ground v)?> then\n            change y by (4)\n        end\n        if <touching (ground v)?> then\n            change y by (10)\n        end\n        if <touching (ground v)?> then\n            change y by (10)\n        end\n        if <touching (ground v)?> then\n            change y by (10)\n        end\n        if <touching (ground v)?> then\n            change y by (10)\n        end\n        if <touching (ground v)?> then\n            change y by (-50)\n            change x by ((0) - (RunSpeed))\n            show\n        end\n    end\n    change [runspeed v] by (-0.5)\n    if <(RunSpeed) > [6]> then\n        set [runspeed v] to [6]\n    end\n    if <(RunSpeed) < [3]> then\n        set [runspeed v] to [3]\n    end\nend\n\nwhen flag clicked\nforever\n    show\nend\n\n