Opposite Day | A Platformer

Instructions: Welcome to Opposite Day! Use the arrow keys or WADS keys to move. Keys are opposite! Get to the portal to go to the next level. Press r if you want to restart the level. It's opposite day so avoid the grey. Go for the high score, or should I say low score(my best is 94).\nHave Fun and please like or/and fav! Can we reach 50?\n50 Likes!!! 75?!???!\nCheck out my other platformer here\nhttps://scratch.mit.edu/projects/142317899/ \n===================Update Log=======================\n1/11/17-Added music.\n1/12/17-Added 2 levels.\n1/14/17-Added the High Score system.\n===================================================\nCheck out my other Platformer here  https://scratch.mit.edu/projects/137433115/  \n\n

@Stage\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\nset [ghost v] effect to (0)\nwait (2) seconds\ngo to [front v] layer\nrepeat (20)\n    change [ghost v] effect by (5)\n    go to [front v] layer\n    wait (0.05) seconds\nend\nbroadcast (start v)\n\nwhen flag clicked\nwait (2) seconds\nforever\n    play sound [Alexey_Anisimov_-_Electronic_Presentation v] until done\nend\n\nmove (1) steps\n\nset [☁ high score v] to [100]\n\nshow\n\n@Sprite1\n\nset rotation style [left-right v]\n\nwhen I receive [start v]\ngo to x: (217) y: (-31)\nforever\n    if <touching color (#666666)?> then\n        go to x: (217) y: (-31)\n    end\n    if <key (r v) pressed?> then\n        go to x: (217) y: (-31)\n    end\n    if <touching color (#00ffff)?> then\n        broadcast (next level v)\n        hide\n        wait (1.5) seconds\n        go to x: (217) y: (-31)\n        show\n    end\nend\n\ndefine Walk (direction) (speed)\npoint in direction (direction)\nchange x by (speed)\nset [slope v] to [0]\nrepeat until <<(slope) = [8]> or <not <touching color (#ff0000)?>>>\n    change y by (1)\n    change [slope v] by (1)\n    if <<<key (s v) pressed?> or <key (down arrow v) pressed?>> and <([abs v] of (speed) ) > [3]>> then\n        if <(wall jump) = [0]> then\n            set [x v] to ((-1.2) * (speed))\n            set [y v] to [11]\n            set [falling v] to [6]\n            set [wall jump v] to [15]\n        end\n    else\n        set [x v] to [0]\n    end\nend\nif <(slope) = [8]> then\n    change x by ((0) - (speed))\n    change y by ((0) - (slope))\nend\n\nwhen I receive [start v]\nforever\n    if <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n        if <<(jump key) = [0]> and <[3] > (falling)>> then\n            set [y v] to [14]\n            set [falling v] to [6]\n            set [jump key v] to [0]\n        end\n    else\n        set [jump key v] to [0]\n    end\nend\n\nwhen I receive [start v]\nset [y v] to [0]\nforever\n    change [y v] by (-1)\n    change y by (y)\n    Touch Ground <(y) > [0]>\nend\n\nwhen flag clicked\nhide\nwait (3.5) seconds\nshow\n\ndefine Touch Ground <up>\nchange [falling v] by (1)\nrepeat until <not <touching color (#ff0000)?>>\n    if <up> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [falling v] to [0]\n    end\n    set [y v] to [0]\nend\n\nwhen I receive [start v]\nforever\n    Touch Ground <(y) > [0]>\n    if <(wall jump) > [0]> then\n        change [wall jump v] by (-1)\n    else\n        set [x v] to ((x) * (0.7))\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            change [x v] by (-1.5)\n        end\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            change [x v] by (1.5)\n        end\n    end\n    if <(x) < [-0.5]> then\n        Walk (-90) (x)\n    else\n        if <(x) > [0.5]> then\n            Walk (90) (x)\n        else\n            set [frame v] to [0]\n        end\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\nswitch costume to (costume3 v)\n\nwhen I receive [next level v]\nwait (0.75) seconds\nnext costume\nif <(costume [number v]) = [10]> then\n    broadcast (Moving Level v)\nend\nif <(costume [number v]) = [11]> then\n    broadcast (Moving Level 2 v)\n    broadcast (Moving Level v)\nend\nif <(costume [number v]) = [12]> then\n    broadcast (Done with moving v)\n    broadcast (Moving Level 3 v)\nend\nif <(costume [number v]) = [13]> then\n    broadcast (Moving Level 4 v)\nend\nif <(costume [number v]) = [14]> then\n    broadcast (Done with moving v)\nend\n\nwhen flag clicked\nset [timer v] to [0]\nforever\n    if <[14] > (costume [number v])> then\n        wait (1) seconds\n        change [timer v] by (1)\n    end\nend\n\nwhen flag clicked\nhide variable [your score v]\nhide variable [☁ high score v]\nhide variable [☁ high score setter v]\nwait (3.25) seconds\nshow variable [timer v]\nforever\n    if <(costume [number v]) = [14]> then\n        set [your score v] to (timer)\n        wait (1.5) seconds\n        hide variable [timer v]\n        show variable [your score v]\n        show variable [☁ high score v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(☁ High Score) > (Your Score)> and <(costume [number v]) = [14]>> then\n        set [☁ high score v] to (Your Score)\n    end\nend\n\n@Sprite3\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\ngo to x: (-465) y: (0)\nshow\ngo to [front v] layer\nglide (1.5) secs to x: (465) y: (0)\nhide\n\n@Sprite5\n\nglide (2) secs to x: (100) y: (20)\nglide (2) secs to x: (-66) y: (20)\n\nwhen I receive [moving level v]\nshow\ngo to x: (-100) y: (20)\nforever\n    repeat (34)\n        change x by (6)\n    end\n    repeat (34)\n        change x by (-6)\n    end\nend\n\nwhen I receive [done with moving v]\nhide\n\nwhen flag clicked\nhide\n\n@Sprite6\n\nwhen flag clicked\nhide\n\nwhen I receive [done with moving v]\nhide\n\nwhen I receive [moving level 2 v]\nshow\ngo to x: (145) y: (87)\nforever\n    repeat (34)\n        change x by (-6)\n    end\n    repeat (34)\n        change x by (6)\n    end\nend\n\n@Sprite7\n\nwhen I receive [moving level 3 v]\nshow\nforever\n    go to x: (46) y: (37)\n    wait (1.2) seconds\n    go to x: (46) y: (8)\n    wait (1.2) seconds\nend\n\nwhen I receive [done with moving v]\nhide\n\nwhen flag clicked\nhide\n\n@Sprite8\n\nwhen I receive [moving level 4 v]\nshow\nforever\n    next costume\n    wait (1.2) seconds\n    next costume\n    wait (1.2) seconds\nend\n\nwhen I receive [done with moving v]\nhide\n\nwhen flag clicked\nhide\n\n