Platformer 

Instructions: Use arrow keys or W,A,S,D press m to mute press u to unmute  press r to restart the level\n

@Stage\n\nwhen flag clicked\nset volume to (50) %\nswitch backdrop to (backdrop4 v)\nforever\n    play sound [capitol v] until done\nend\n\nwhen backdrop switches to [backdrop2 v]\nhide variable [levels v]\nhide variable [deaths v]\nhide variable [☁ fastest time v]\nforever\n    change [color v] effect by (2)\nend\n\nwhen [m v] key pressed\nset volume to (0) %\n\nwhen [u v] key pressed\nset volume to (50) %\n\nwhen I receive [game over v]\nswitch backdrop to (backdrop2 v)\n\nwhen backdrop switches to [backdrop1 v]\nforever\n    change [color v] effect by (2)\nend\n\nwhen I receive [square v]\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [circle v]\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [done v]\nswitch backdrop to (backdrop3 v)\n\n@Sprite1\n\ndefine Platform physics (jump height ) (gravity ) (friction ) (movement speed) (wall jump hm) (wall jump vm)\nif <not <touching color (#c40000)?>> then\n    change y by (Y vel)\nend\nif <<touching (sprite2 v)?> and <not <touching color (#c40000)?>>> then\n    repeat ([abs v] of (Y vel) )\n        if <touching (sprite2 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?> or <key (space v) pressed?>>> and <not <(Y vel) > [0]>>> then\n        set [y vel v] to (jump height )\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)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [x vel v] by ((-1) * (movement speed))\nend\nif <not <touching color (#c40000)?>> then\n    change x by (X vel)\nend\nif <<touching (sprite2 v)?> and <not <touching color (#c40000)?>>> then\n    set [old y v] to (y position)\n    repeat (([abs v] of (X vel) ) + (1))\n        if <<touching (sprite2 v)?> and <not <touching color (#c40000)?>>> then\n            change y by (1)\n        end\n    end\n    if <<touching (sprite2 v)?> and <not <touching color (#c40000)?>>> then\n        set y to (Old y)\n        repeat ([ceiling v] of ([abs v] of (X vel) ) )\n            if <<touching (sprite2 v)?> and <not <touching color (#c40000)?>>> then\n                change x by ((-1) * (([abs v] of (X vel) ) / (X vel)))\n            end\n        end\n        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <key (space v) pressed?>>> then\n            if <(X vel) < [0]> then\n                set [x vel v] to [0]\n                if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n                    set [x vel v] to (wall jump hm)\n                    set [y vel v] to (wall jump vm)\n                end\n            else\n                set [x vel v] to [0]\n                if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n                    set [x vel v] to ((-1) * (wall jump hm))\n                    set [y vel v] to (wall jump vm)\n                end\n            end\n        end\n    end\nend\nset [x vel v] to ((X vel) * (friction ))\n\nwhen I receive [game over v]\nhide variable [☁ fastest time v]\nhide variable [deaths v]\nhide variable [time v]\nif <(Time) < (☁ fastest time)> then\n    set [☁ fastest time v] to (Time)\nend\nhide\nstop [all v]\n\nwhen I start as a clone\nrepeat (20)\n    change [ghost v] effect by (10)\n    change size by (-2)\n    change y by (0)\nend\ndelete this clone\n\nwhen backdrop switches to [backdrop1 v]\nforever\n    if <not <touching color (#c40000)?>> then\n        create clone of (_myself_ v)\n    end\nend\n\nwhen backdrop switches to [backdrop1 v]\nshow\n\nwhen backdrop switches to [backdrop1 v]\nshow variable [deaths v]\nshow variable [☁ fastest time v]\nshow variable [time v]\nset [deaths v] to [0]\nforever\n    if <touching color (#c40000)?> then\n        go to x: (-183) y: (-105)\n        change [deaths v] by (1)\n        play sound [Disconnect v] until done\n    end\nend\n\nwhen flag clicked\nhide variable [☁ fastest time v]\nhide variable [levels v]\nhide variable [deaths v]\nhide variable [time v]\n\nwhen backdrop switches to [backdrop1 v]\nreset timer\ngo to x: (-183) y: (-105)\nshow\nset [y vel v] to [0]\nset [x vel v] to [0]\nforever\n    Platform physics [12] [-0.5] [0.9] [2] [14] [14]\nend\n\nwhen backdrop switches to [backdrop1 v]\nshow\ngo to x: (-183) y: (-105)\nset [levels v] to [1]\nforever\n    if <touching (_edge_ v)?> then\n        if <(levels) = [25]> then\n            broadcast (game over v)\n        else\n            go to x: (-183) y: (-105)\n            change [levels v] by (1)\n            broadcast (level complete v)\n            play sound [Connect v] until done\n        end\n    end\nend\n\nwhen backdrop switches to [backdrop1 v]\nset [time v] to [0]\nforever\n    wait (1) seconds\n    change [time v] by (1)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [circle v]\nswitch costume to (costume1 v)\nshow\n\nwhen I receive [square v]\nswitch costume to (costume2 v)\nshow\n\nwhen [r v] key pressed\ngo to x: (-183) y: (-105)\n\n@Sprite2\n\nwhen I receive [level complete v]\nnext costume\n\nwhen I receive [game over v]\nhide\n\nwhen backdrop switches to [backdrop1 v]\nswitch costume to (costume1 v)\n\nwhen backdrop switches to [backdrop1 v]\nshow\ngo to x: (0) y: (0)\n\nwhen flag clicked\nhide\nstop [this script v]\n\nwhen I receive [circle v]\nshow\n\nwhen I receive [square v]\nshow\n\nwhen [r v] key pressed\n\nwhen flag clicked\nforever\n    set drag mode [not draggable v]\nend\n\n@Sprite3\n\nwhen flag clicked\nshow\n\nwhen this sprite clicked\nbroadcast (Circle v)\n\nwhen flag clicked\ngo to x: (-141) y: (-9)\n\nwhen I receive [circle v]\nhide\n\nwhen I receive [square v]\nhide\n\n@Sprite4\n\nwhen flag clicked\nhide\n\nwhen this sprite clicked\nbroadcast (Square v)\n\nwhen flag clicked\ngo to x: (144) y: (3)\n\nwhen I receive [circle v]\nhide\n\nwhen I receive [square v]\nhide\n\nwhen backdrop switches to [backdrop3 v]\nshow\n\n@Sprite5\n\nwhen flag clicked\nset size to (50) %\nhide\n\nwhen backdrop switches to [backdrop2 v]\ngo to x: (51) y: (-34)\nshow\n\nforever\nend\n\nrepeat (10)\nend\n\nchange size by (pick random (10) to (20))\nwait (pick random (1) to (3)) seconds\nchange size by (pick random (-10) to (-20))\n\nwhen backdrop switches to [backdrop2 v]\n\nshow\n\n@Sprite6\n\nwhen backdrop switches to [backdrop2 v]\ngo to x: (103) y: (-34)\nshow\n\nwhen flag clicked\nset size to (50) %\nhide\n\nwhen backdrop switches to [backdrop2 v]\nforever\nend\n\nrepeat (10)\n    change size by (pick random (10) to (20))\n    wait (pick random (1) to (3)) seconds\n    change size by (pick random (-10) to (-20))\nend\n\n@Sprite7\n\nwhen flag clicked\nset size to (50) %\nhide\n\nwhen backdrop switches to [backdrop2 v]\ngo to x: (-2) y: (-34)\nshow\n\nwhen backdrop switches to [backdrop2 v]\n\nforever\nend\n\nrepeat (10)\n    change size by (pick random (10) to (20))\n    wait (pick random (1) to (3)) seconds\n    change size by (pick random (-10) to (-20))\nend\n\n@Sprite8\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nset [ghost v] effect to (1100)\ngo to x: (0) y: (0)\nwait (1) seconds\nforever\n    change [ghost v] effect by (-2)\nend\n\nwhen backdrop switches to [backdrop3 v]\nhide\n\n@Sprite10\n\nwhen flag clicked\nset size to (100) %\nshow\nset [ghost v] effect to (1100)\ngo to x: (0) y: (-60)\nwait (1) seconds\nforever\n    change [ghost v] effect by (-2)\n    turn right (10) degrees\nend\n\nwhen backdrop switches to [backdrop3 v]\nhide\n\n@Sprite9\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nset size to (100) %\nrepeat (20)\n    change size by (-10)\nend\nrepeat (20)\n    change size by (10)\nend\nwait (4) seconds\nbroadcast (Done v)\nhide\n\n