Portals- A Platformer Game

Instructions: =====================================================\n  I will shout out anyone who can beat the highscore! - jumbo160\n==========================================\nInstructions are in game. If you get stuck, press the restart button to get back to the start. All levels are possible and tested.\n==========================================GAME IS NOT FINISHED!  STILL WORKING ON NEW LEVELS!\nThere are a few glitches\n  -If you find a glitch please comment below so I can fix it. :) Thanks and remember- IT IS STILL IN THE TESTING PHASE!\n=====================================================

@Stage\n\nwhen I receive [play v]\nif <(pause level) = [  1]> then\n    switch backdrop to (level 1 v)\nend\nif <(pause level) = [2]> then\n    switch backdrop to (level 2 v)\nend\nif <(pause level) = [3]> then\n    switch backdrop to (level 3 v)\nend\nif <(pause level) = [4]> then\n    switch backdrop to (level 4 v)\nend\nif <(pause level) = [5]> then\n    switch backdrop to (level 5 v)\nend\nif <(pause level) = [6]> then\n    switch backdrop to (level 6 v)\nend\nif <(pause level) = [6.5]> then\n    switch backdrop to (level 6.5 v)\nend\nif <(pause level) = [7]> then\n    switch backdrop to (level 7 v)\nend\nif <(pause level) = [8]> then\n    switch backdrop to (level 8 v)\nend\nif <(pause level) = [9]> then\n    switch backdrop to (level 9 v)\nend\nif <(pause level) = [10]> then\n    switch backdrop to (level 10 v)\nend\nif <(pause level) = [11]> then\n    switch backdrop to (level 11 v)\nend\nif <(pause level) = [13]> then\n    switch backdrop to (level 13 v)\nend\n\nwhen I receive [fade title v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch backdrop to (level 1 v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [pause v]\nswitch backdrop to (pause screen v)\n\nwhen I receive [level change v]\nif <<touching color (#d6fe40)?> and <(pause level) = [11]>> then\n    hide\n    go to x: (-63) y: (-120)\n    repeat (5)\n        change [ghost v] effect by (20)\n    end\n    wait (1) seconds\n    switch backdrop to (level 13 v)\n    repeat (5)\n        change [ghost v] effect by (-20)\n    end\n    show\nelse\n    repeat (5)\n        change [ghost v] effect by (20)\n    end\n    switch backdrop to (next backdrop v)\n    repeat (5)\n        change [ghost v] effect by (-20)\n    end\nend\n\nwhen backdrop switches to [level 13 v]\n\n@Sprite1\n\nwhen backdrop switches to [home page v]\nhide\n\nwhen backdrop switches to [level 1 v]\nshow\n\ngo to [front v] layer\n\nwhen backdrop switches to [death page v]\nhide\n\nwhen I receive [restart v]\nrepeat (5)\n    change [ghost v] effect by (20)\nend\nset [ghost v] effect to (0)\ngo to x: (-63) y: (-150)\n\nwhen flag clicked\nbroadcast (Home v)\n\nwhen I receive [home v]\nforever\n    if <touching color (#cc0099)?> then\n        set [yv v] to [25]\n    end\nend\n\nwhen I receive [home v]\nforever\n    if <touching color (#001966)?> then\n        change [yv v] by (2)\n    end\nend\n\nwhen I receive [home v]\nhide variable [pause level v]\nforever\n    if <<not <key (left arrow v) pressed?>> and <not <key (right arrow v) pressed?>>> then\n        switch costume to (costume2 v)\n    end\nend\n\nwhen I receive [pause v]\nhide\n\nwhen I receive [home v]\nforever\n    if <touching color (#000000)?> then\n        go to x: (91) y: (66)\n    end\nend\n\nwhen I receive [home v]\nforever\n    play sound [Waterflame - Jumper.mp3 v] until done\nend\n\nstart sound [Waterflame - Jumper.mp3 v]\n\nwait (1) seconds\n\nchange x by (10)\n\nwhen backdrop switches to [level 13 v]\n\nwhen backdrop switches to [level 1 v]\ngo to x: (-63) y: (-100)\nset [slide v] to [0]\nset [speed v] to [0.9]\nshow\nforever\n    if on edge, bounce\n    set rotation style [don't rotate v]\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [xv v] by (1)\n        switch costume to (costume3 v)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [xv v] by (-1)\n        switch costume to (costume4 v)\n    end\n    set [xv v] to ((Xv) * (Speed))\n    change x by (Xv)\n    if <touching color (#009933)?> then\n        change y by (1)\n        if <touching color (#009933)?> then\n            change y by (1)\n            if <touching color (#009933)?> then\n                change y by (1)\n                if <touching color (#009933)?> then\n                    change y by (1)\n                    if <touching color (#009933)?> then\n                        change y by (1)\n                    end\n                    if <touching color (#009933)?> then\n                        change x by ((Xv) * (-1))\n                        change y by (-5)\n                        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                            if <(Xv) > [0]> then\n                                set [xv v] to [-5]\n                            else\n                                set [xv v] to [5]\n                            end\n                            set [yv v] to [10]\n                        else\n                            set [yv v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <touching color (#009933)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#009933)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            change [yv v] by (15)\n        end\n    end\n    change y by (1)\nend\n\nwhen I receive [play v]\ngo to x: (-63) y: (-100)\nshow\n\nwhen backdrop switches to [level 14 v]\nforever\n    hide\nend\n\nwhen backdrop switches to [level 7 v]\ngo to x: (-7) y: (-54)\n\nwhen I receive [home v]\nforever\n    if <touching color (#ff0000)?> then\n        change [deaths v] by (1)\n        repeat (5)\n            change [ghost v] effect by (20)\n        end\n        set [ghost v] effect to (0)\n        go to x: (-63) y: (-100)\n    end\nend\n\nwhen I receive [home v]\nhide variable [xv v]\nswitch backdrop to (home page v)\nforever\n    if <touching color (#d6fe40)?> then\n        hide\n        broadcast (level change v)\n        go to x: (-63) y: (-100)\n        wait (0.3) seconds\n        show\n    end\nend\n\nwhen backdrop switches to [level 13 v]\nforever\n    hide\nend\n\nwhen backdrop switches to [home page v]\nhide variable [deaths v]\nset [deaths v] to [0]\n\nwhen flag clicked\nset [deaths v] to [0]\n\nwhen backdrop switches to [level 13 v]\nshow variable [☁ highscore v]\nshow variable [time v]\n\nset [☁ highscore v] to [100]\n\nwhen backdrop switches to [home page v]\nhide variable [time v]\nset [time v] to [0]\nhide variable [☁ highscore v]\n\n@costume2\n\nwhen backdrop switches to [level 1 v]\nhide\n\nwhen backdrop switches to [death page v]\nhide\n\nwhen backdrop switches to [home page v]\nshow\n\nwhen I receive [pause v]\nhide\n\n@Sprite2\n\nwhen backdrop switches to [home page v]\nhide\n\nwhen backdrop switches to [level 1 v]\nshow\n\nwhen backdrop switches to [level 2 v]\nhide\n\nwhen I receive [pause v]\nhide\n\nhide\n\n@Sprite3\n\nwhen backdrop switches to [level 1 v]\nshow\n\nwhen I receive [pause v]\nhide\n\nwhen backdrop switches to [level 2 v]\nhide\n\nwhen backdrop switches to [home page v]\nhide\n\n@Sprite4\n\nwhen backdrop switches to [level 1 v]\nshow\n\nwhen backdrop switches to [level 2 v]\nhide\n\nwhen backdrop switches to [home page v]\nhide\n\nwhen I receive [pause v]\nhide\n\n@Sprite7\n\nwhen backdrop switches to [level 2 v]\nshow\n\nwhen backdrop switches to [home page v]\nhide\n\nwhen backdrop switches to [level 3 v]\nhide\n\nwhen I receive [pause v]\nhide\n\ngo [backward v] (1) layers\n\nshow\n\ngo to x: (10) y: (-8)\n\n@costume4\n\nwhen backdrop switches to [level 1 v]\nhide\n\nwhen backdrop switches to [death page v]\nhide\n\nwhen I receive [pause v]\nhide\n\nwhen I receive [home v]\ngo to x: (2400) y: (50)\nshow\nset [ghost v] effect to (80)\nrepeat (10)\n    change x by (((-5) - (x position)) * (0.2))\n    change [ghost v] effect by (-10)\nend\n\n@Button\n\nwhen backdrop switches to [level 1 v]\nhide\n\nwhen backdrop switches to [death page v]\nhide\n\nwhen this sprite clicked\nbroadcast (fade title v)\n\nwhen I receive [pause v]\nhide\n\nwhen I receive [home v]\nhide\nwait (1) seconds\nshow\nforever\n    if <not <touching (mouse-pointer v)?>> then\n        switch costume to (button3-a v)\n    end\n    if <touching (mouse-pointer v)?> then\n        switch costume to (button3-a2 v)\n    end\nend\n\nwhen this sprite clicked\nforever\n    if <(pause level) < [13]> then\n        wait (1) seconds\n        change [time v] by (1)\n    end\nend\n\nwait (0.5) seconds\n\nnext costume\n\nset [☁ highscore v] to [100]\n\nif  then\nend\n\nwhen flag clicked\ngo to x: (13) y: (-1)\nforever\n    if <<(pause level) = [13]> and <(time) < (☁ Highscore)>> then\n        set [☁ highscore v] to (time)\n    else\n    end\nend\n\nset [☁ highscore v] to [85]\n\n@costume\n\nwhen backdrop switches to [home page v]\nshow\n\nwhen backdrop switches to [death page v]\nhide\n\nwhen backdrop switches to [level 1 v]\nhide\n\nwhen I receive [pause v]\nhide\n\n@Sprite6\n\nwhen backdrop switches to [level 1 v]\nset [pause level v] to [1]\ngo to x: (197) y: (123)\nshow\n\nwhen backdrop switches to [level 2 v]\nset [pause level v] to [2]\ngo to x: (199) y: (91)\nshow\n\nwhen backdrop switches to [level 3 v]\nset [pause level v] to [3]\ngo to x: (202) y: (-67)\nshow\n\nwhen backdrop switches to [death page v]\nhide\n\nwhen I receive [pause v]\nhide\n\nwhen backdrop switches to [level 5 v]\nset [pause level v] to [5]\ngo to x: (177) y: (132)\nshow\n\nwhen backdrop switches to [level 7 v]\nset [pause level v] to [7]\ngo to x: (218) y: (155)\nshow\n\nwhen backdrop switches to [level 10 v]\nset [pause level v] to [10]\ngo to x: (217) y: (141)\nshow\n\nwhen backdrop switches to [level 8 v]\nset [pause level v] to [8]\nshow\n\nwhen backdrop switches to [level 6 v]\nset [pause level v] to [6]\ngo to x: (209) y: (-111)\nshow\n\nwhen backdrop switches to [level 9 v]\nset [pause level v] to [9]\ngo to x: (176) y: (-52)\nshow\n\nwhen backdrop switches to [level 11 v]\nset [pause level v] to [11]\nshow\n\nwhen backdrop switches to [level 6.5 v]\nset [pause level v] to [6.5]\ngo to x: (202) y: (103)\nshow\n\nwhen flag clicked\nforever\n    switch costume to (portal v)\n    change y by (3)\n    wait (0.5) seconds\n    switch costume to (portal2 v)\n    change y by (-3)\n    wait (0.5) seconds\nend\n\nwhen [space v] key pressed\nshow\n\nwhen backdrop switches to [level 13 v]\n\nwhen backdrop switches to [level 13 v]\nset [pause level v] to [13]\nhide\n\nset [pause level v] to [12]\ngo to x: (209) y: (59)\nshow\n\ngo to [front v] layer\n\nwhen backdrop switches to [level 4 v]\nset [pause level v] to [4]\ngo to x: (-15) y: (-82)\nshow\n\nwhen backdrop switches to [home page v]\nset [pause level v] to [0]\nhide\n\n@Sprite5\n\nwhen backdrop switches to [home page v]\nshow\n\nwhen backdrop switches to [death page v]\nhide\n\nwhen I receive [pause v]\nhide\n\nwhen I receive [play v]\nshow\n\n@costume3\n\nwhen backdrop switches to [home page v]\nshow\n\nwhen backdrop switches to [level 1 v]\nhide\n\nwhen backdrop switches to [death page v]\nhide\n\nwhen I receive [pause v]\nhide\n\n@costume5\n\nwhen backdrop switches to [level 1 v]\nhide\n\nwhen backdrop switches to [death page v]\nhide\n\nwhen [space v] key pressed\n\ngo to x: (50) y: (88)\n\nwhen backdrop switches to [home page v]\nshow\n\nwhen I receive [pause v]\nhide\n\nwhen backdrop switches to [level 13 v]\nwait (8.5) seconds\nshow variable [deaths v]\n\nwhen backdrop switches to [level 1 v]\nhide\n\nstop [this script v]\n\nwhen backdrop switches to [home page v]\nhide\n\nwhen backdrop switches to [level 13 v]\nset size to (70) %\nhide\ngo to x: (-240) y: (-148)\nswitch costume to (costume3 v)\nwait (1) seconds\nshow\nrepeat (50)\n    change x by (5)\nend\nwait (1) seconds\nswitch costume to (costume4 v)\nwait (0.5) seconds\nswitch costume to (costume5 v)\nwait (0.25) seconds\nswitch costume to (costume4 v)\nwait (1) seconds\nglide (1) secs to x: (0) y: (4)\nrepeat (20)\n    change size by (10)\nend\nwait (0.5) seconds\nswitch costume to (costume6 v)\nwait (0.5) seconds\nswitch costume to (costume4 v)\nrepeat until \n    wait (0.5) seconds\n    switch costume to (costume7 v)\n    wait (0.5) seconds\n    switch costume to (costume8 v)\nend\n\n@Sprite8\n\nwhen backdrop switches to [level 3 v]\nshow\n\nwhen backdrop switches to [level 4 v]\nhide\n\nwhen backdrop switches to [home page v]\nhide\n\nwhen backdrop switches to [death page v]\nhide\n\nwhen I receive [pause v]\nhide\n\n@Sprite11\n\nwhen backdrop switches to [level 9 v]\nhide\n\nwhen backdrop switches to [home page v]\nhide\n\nwhen backdrop switches to [level 8 v]\nshow\n\nwhen I receive [pause v]\nhide\n\n@Sprite12\n\nwhen backdrop switches to [level 4 v]\nshow\n\nwhen backdrop switches to [home page v]\nhide\n\nwhen backdrop switches to [level 5 v]\nhide\n\nwhen I receive [pause v]\nhide\n\n@Sprite13\n\nwhen backdrop switches to [level 6 v]\nshow\n\nwhen backdrop switches to [level 6.5 v]\nhide\n\nwhen backdrop switches to [home page v]\nhide\n\nwhen I receive [pause v]\nhide\n\n@Sprite14\n\nwhen backdrop switches to [level 5 v]\nshow\n\ngo [backward v] (1) layers\n\nwhen backdrop switches to [home page v]\nhide\n\nwhen backdrop switches to [level 6 v]\nhide\n\nwhen I receive [pause v]\nhide\n\n@Sprite15\n\nwhen backdrop switches to [home page v]\nhide\n\nwhen backdrop switches to [level 6.5 v]\nhide\n\nwhen I receive [pause v]\nhide\n\nwhen backdrop switches to [level 6 v]\nshow\n\n@Sprite16\n\nwhen backdrop switches to [level 10 v]\nhide\n\nwhen backdrop switches to [home page v]\nhide\n\nwhen I receive [pause v]\nhide\n\nwhen backdrop switches to [level 9 v]\nshow\n\n@Sprite17\n\nwhen this sprite clicked\nbroadcast (restart v)\n\nwhen I receive [pause v]\nhide\n\nwhen I receive [home v]\nhide\n\nwhen backdrop switches to [level 1 v]\nshow\nforever\n    go to [front v] layer\nend\n\nwhen I receive [play v]\nshow\nforever\n    go to [front v] layer\nend\n\ngo [backward v] (1) layers\n\nwhen backdrop switches to [level 13 v]\nhide\n\n@Sprite18\n\nwhen backdrop switches to [level 11 v]\nhide\n\nwhen backdrop switches to [level 10 v]\nshow\ngo to [front v] layer\n\nwhen backdrop switches to [home page v]\nhide\n\nwhen I receive [pause v]\nhide\n\n@Sprite10\n\nwhen backdrop switches to [level 7 v]\nshow\ngo to [front v] layer\n\nwhen backdrop switches to [home page v]\nhide\n\nwhen backdrop switches to [level 8 v]\nhide\n\nwhen I receive [pause v]\nhide\n\n@Sprite9\n\nwhen backdrop switches to [level 4 v]\nhide\n\nwhen backdrop switches to [level 3 v]\nshow\n\nwhen backdrop switches to [death page v]\nhide\n\ngo [backward v] (1) layers\n\nwhen I receive [pause v]\nhide\n\nwhen backdrop switches to [home page v]\nhide\n\n@Sprite19\n\nwhen backdrop switches to [home page v]\nhide\n\nwhen backdrop switches to [level 13 v]\nhide\n\nwhen backdrop switches to [level 11 v]\nshow\n\nwhen I receive [pause v]\nhide\n\n@home\n\nwhen this sprite clicked\nbroadcast (Home v)\n\nwhen I receive [pause v]\ngo to x: (221) y: (-161)\n\nwhen I receive [play v]\ngo to x: (150) y: (-161)\n\nwhen I receive [home v]\ngo to x: (221) y: (-161)\nforever\n    go to [front v] layer\nend\n\nwhen backdrop switches to [level 1 v]\ngo to x: (150) y: (-161)\n\ngo to [front v] layer\n\nwhen backdrop switches to [level 13 v]\ngo to x: (216) y: (-159)\n\nhide\n\n@b5d2c7e6f801cf92\n\nwhen this sprite clicked\nbroadcast (Play v)\n\nwhen I receive [pause v]\nshow\nforever\n    go to [front v] layer\nend\n\nwhen I receive [play v]\nhide\n\nwhen I receive [pause v]\ngo [backward v] (1) layers\n\nwhen I receive [pause v]\ngo [backward v] (1) layers\n\nwhen flag clicked\nhide\n\n@b5d2c7e6f801cf2\n\nwhen this sprite clicked\nswitch backdrop to (pause screen v)\nbroadcast (Pause v)\nhide\n\nwhen I receive [pause v]\nhide\n\nwhen I receive [play v]\nshow\nforever\n    go to [front v] layer\nend\n\nwhen backdrop switches to [level 1 v]\nshow\nforever\n    go to [front v] layer\nend\n\nwhen backdrop switches to [home page v]\nhide\n\ngo to [front v] layer\n\nwhen backdrop switches to [level 13 v]\nhide\n\n@Sprite20\n\nwhen backdrop switches to [level 7 v]\nhide\n\nwhen backdrop switches to [home page v]\nhide\n\nwhen backdrop switches to [level 6.5 v]\nshow\n\nwhen I receive [pause v]\nhide\n\n