Escape

Instructions:        You have been trapped in a lab for 2 years.\nYou want to escape, but you are Kept inside an enclosed room, and even if you make it out of there you will still have to make it past traps and lasers.  But one day this portal appears.  Where will it lead?  It doesn't matter, because at least it will help you ESCAPE!!!\n\nIf you like this, check out http://scratch.mit.edu/projects/22896917/\nESCAPE 2 - https://scratch.mit.edu/projects/23175613/\nESCAPE 3 - https://scratch.mit.edu/projects/59614358/\n\nhttps://scratch.mit.edu/projects/127002680/ i spent lots of time on this\nI know about the rocket + wall glitch but I don't know how to fix it so please stop commenting on it\n\n\n\n\n\n

@Stage\n\nplay sound [pop v] until done\n\n@You\n\nwhen flag clicked\ngo to [front v] layer\nswitch costume to (costume1 v)\ngo to x: (-125) y: (-44)\ngo to x: (-124) y: (-49)\npoint in direction (90)\ngo to x: (-125) y: (-44)\nset size to (400) %\nwait (5) seconds\nforever\n    play sound [545395_Midnight v] until done\nend\n\nwhen I receive [you win v]\nswitch costume to (costume3 v)\nset size to (500) %\nset x to (0)\nset y to (0)\ngo to [front v] layer\nstop [other scripts in sprite v]\nstart sound [545395_Midnight v]\npoint in direction (90)\nforever\n    switch costume to (costume3 v)\n    wait (0.2) seconds\n    go to [front v] layer\n    next costume\n    wait (0.19) seconds\nend\n\nwhen I receive [start v]\nbroadcast (message1 v)\nshow\nswitch backdrop to (backdrop1 v)\nset size to (125) %\ngo to x: (-213) y: (-70)\nswitch costume to (costume1 v)\nset [y v] to [0]\nset [x v] to [0]\ngo to [front v] layer\nforever\n    go to [front v] layer\n    if <touching (portal v)?> then\n        show\n        switch backdrop to (backdrop1 v)\n        set size to (125) %\n        go to x: (-213) y: (-70)\n        switch costume to (costume1 v)\n        set [y v] to [0]\n        set [x v] to [0]\n        go to [front v] layer\n        broadcast (message1 v)\n    end\n    switch costume to (costume1 v)\n    set rotation style [left-right v]\n    if <key (space v) pressed?> then\n        switch costume to (costume2 v)\n        change [y v] by (0.1)\n        if <(direction) = [90]> then\n            change [x v] by (3)\n        else\n            change [x v] by (-3)\n        end\n    end\n    change [y v] by (-0.5)\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n        change [x v] by (-0.5)\n    end\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n        change [x v] by (0.5)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <<touching color (#ff0000)?> or <key (r v) pressed?>> then\n        broadcast (dead v)\n        wait (1.7) seconds\n        show\n        switch backdrop to (backdrop1 v)\n        set size to (125) %\n        go to x: (-213) y: (-70)\n        switch costume to (costume1 v)\n        set [y v] to [0]\n        set [x v] to [0]\n        point in direction (90)\n        wait (1.7) seconds\n    end\n    if <touching color (#7f7f7f)?> then\n        change y by (1)\n        if <touching color (#7f7f7f)?> then\n            change y by (1)\n            if <touching color (#7f7f7f)?> then\n                change y by (1)\n                if <touching color (#7f7f7f)?> then\n                    change y by (1)\n                    if <touching color (#7f7f7f)?> then\n                        change y by (1)\n                        if <touching color (#7f7f7f)?> then\n                            change y by (1)\n                            if <touching color (#7f7f7f)?> then\n                                change y by (-6)\n                                if <key (up arrow v) pressed?> then\n                                    set [y v] to [10]\n                                    if <(x) > [0]> then\n                                        set [x v] to [-10]\n                                    else\n                                        set [x v] to [10]\n                                    end\n                                else\n                                    change x by ((x) * (-1))\n                                    set [x v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (y)\n    if <touching color (#7f7f7f)?> then\n        change y by ((y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-0.5)\n    if <<touching color (#7f7f7f)?> and <key (up arrow v) pressed?>> then\n        set [y v] to [10]\n    end\n    change y by (0.5)\nend\n\n@backround\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\ngo to [front v] layer\nerase all\nstamp\nswitch costume to (costume2 v)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [you win v]\nswitch costume to (costume3 v)\ngo [backward v] (1) layers\nstop [other scripts in sprite v]\n\n@level\n\nwhen flag clicked\nset [leveld v] to [0]\nswitch costume to (costume1 v)\nset x to (0)\nset y to (0)\n\nwhen I receive [start v]\nshow\n\nwhen I receive [message1 v]\n\nwhen I receive [message1 v]\nnext costume\nset x to (0)\nset y to (0)\nchange [leveld v] by (1)\nif <(leveld) = [11]> then\n    broadcast (you win v)\nend\n\nnext costume\n\n@portal\n\nwhen flag clicked\ngo to x: (165) y: (-47)\nset size to (300) %\nset [whirl v] effect to (600)\nforever\n    repeat (200)\n        change [whirl v] effect by (1)\n    end\n    repeat (200)\n        change [whirl v] effect by (-1)\n    end\nend\n\nwhen I receive [start v]\nset size to (100) %\ngo to x: (212) y: (-109)\n\n@Sprite1\n\nwhen flag clicked\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        if <(size) < [120]> then\n            change size by (2)\n        end\n    else\n        if <(size) > [100]> then\n            change size by (-2)\n        end\n    end\nend\n\nwhen this sprite clicked\nbroadcast (start v)\nhide\n\n@Sprite2\n\nwhen flag clicked\nhide\nset x to (0)\nset y to (0)\nset [ghost v] effect to (100)\n\nwhen I receive [start v]\nshow\ngo to [front v] layer\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nbroadcast (polp v)\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\n\nwhen I receive [dead v]\nshow\ngo to [front v] layer\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\n\n