Prison Escape - A platformer

Instructions: Arrow keys or WASD to move\nALL LEVELS ARE POSSIBLE though I even think some of the levels are too hard.\nX to skip a level\nR to restart

@Stage\n\nwhen I receive [green flag v]\nforever\n    if <(Level) = [1]> then\n        switch backdrop to (backdrop1 v)\n    else\n        switch backdrop to (backdrop2 v)\n    end\n    if <(Level) = [20]> then\n        switch backdrop to (books2 v)\n    end\nend\n\n@Player\n\nwhen flag clicked\nbroadcast (Play v)\ngo to [front v] layer\nset [level v] to [0]\nbroadcast (Green flag v)\nset size to (30) %\n\nwhen I receive [play v]\nNext level\nshow\nswitch costume to (costume1 v)\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [x v] by (1)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [x v] by (-1)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change x by ((x) * (-1))\n                        change y by (-4)\n                        if <<(Level) = [17]> or <<(Level) = [19]> or <(Level) = [18]>>> then\n                    else\n                        change [y v] by (0)\n                    end\n                end\n            end\n        end\n    end\n    change [y v] by (-1)\n    change y by (y)\n    if <touching color (#000000)?> then\n        change y by ((y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#000000)?> then\n        if <<key (up arrow v) pressed?> or <<key (space v) pressed?> or <key (w v) pressed?>>> then\n            set [y v] to [15]\n        end\n    end\n    change y by (1)\n    if <touching color (#ff0000)?> then\n        Die\n    end\n    if <key (r v) pressed?> then\n        Die\n    end\n    if <<<(x position) = [241]> or <(x position) > [241]>> and <(Level) < [20]>> then\n        if <(Level) = [1]> then\n            broadcast (Level 1 v)\n            Die\n        end\n    end\n    if <<not <(Level) = [1]>> and <<<(x position) = [241]> or <(x position) > [241]>> and <(Level) < [20]>>> then\n        Next level\n    end\n    create clone of (_myself_ v)\n    if <(Level) = [9]> then\n        if <touching (trap v)?> then\n            broadcast (Trapped v)\n        end\n    end\n    if <<(Level) < [20]> and <<not <(Level) = [1]>> and <key (x v) pressed?>>> then\n        Skip level\n    end\n    if <<(Level) = [17]> or <<(Level) = [19]> or <(Level) = [18]>>> then\n        set size to (10) %\n    else\n        set size to (30) %\n    end\nend\n\ndefine Die\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide variable [level v]\ngo to x: (-204) y: (-156)\nset [x v] to [0]\nset [y v] to [0]\nshow\nclear graphic effects\n\ndefine Skip level\nchange [level v] by (1)\nhide variable [level v]\nset [x v] to [0]\nset [y v] to [0]\ngo to [front v] layer\nshow\nclear graphic effects\nnext backdrop\nif <(Level) = [12]> then\n    go to x: (-241) y: (136)\nelse\n    go to x: (-204) y: (-156)\nend\nbroadcast (Next level v)\nwait (0.5) seconds\n\ndefine Next level\nchange [level v] by (1)\nhide variable [level v]\ngo to x: (-204) y: (-156)\nset [x v] to [0]\nset [y v] to [0]\ngo to [front v] layer\nshow\nclear graphic effects\nbroadcast (Next level v)\nif <(Level) = [12]> then\n    go to x: (-241) y: (136)\nelse\n    go to x: (-204) y: (-156)\nend\nbroadcast (Next level v)\nwait (0.5) seconds\n\nwhen I start as a clone\nrepeat (20)\n    switch costume to (costume2 v)\n    change size by (-1)\n    change [ghost v] effect by (8)\nend\ndelete this clone\n\nwhen I receive [trapped v]\ngo to x: (39) y: (-156)\nwait (5) seconds\n\nwhen I receive [trapped \(part 3\) v]\nDie\ngo to [front v] layer\nDie\n\n@Prison door\n\nwhen I receive [green flag v]\nshow\npoint in direction (90)\ngo to x: (-13) y: (0)\n\nwhen I receive [play v]\nwait (3) seconds\nrepeat (45)\n    turn left (2) degrees\nend\n\nwhen I receive [play v]\nforever\n    if <(Level) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\n@Light\n\nwhen I receive [play v]\nwait (3.1) seconds\nrepeat until <not <(Level) = [1]>>\n    switch costume to (prion3 v)\n    wait (0.7) seconds\n    switch costume to (prion2 v)\n    wait (0.7) seconds\nend\n\nwhen I receive [green flag v]\nhide\ngo to x: (18) y: (37)\nset size to (20) %\n\nwhen I receive [play v]\nswitch costume to (prion v)\nforever\n    if <(Level) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\n@City background\n\nwhen I receive [play v]\nset [pixelate v] effect to (0)\nset size to (100) %\ngo to [back v] layer\nforever\n    if <<(Level) = [1]> or <<(Level) = [20]> or <(Level) = [11]>>> then\n        hide\n    else\n        show\n    end\n    if <<(Level) = [17]> or <<(Level) = [19]> or <(Level) = [18]>>> then\n        set size to (150) %\n    else\n        set size to (100) %\n    end\nend\n\n@Level\n\nwhen I receive [play v]\ngo to [front v] layer\nforever\n    if <(Level) = [1]> then\n        hide\n    else\n        show\n    end\nend\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [level 1 v]\nset [level v] to [2]\nswitch costume to (costume1 v)\n\nwhen I receive [trapped v]\nswitch costume to (costume9 v)\nwait (1) seconds\nbroadcast (Trapped \(Part 2\) v)\n\nwhen I receive [trapped \(part 3\) v]\nset [level v] to [11]\nswitch costume to (costume10 v)\nwait (3) seconds\nset [level v] to [11]\nswitch costume to (costume10 v)\n\n@Trap\n\nwhen I receive [play v]\nforever\n    if <(Level) = [9]> then\n        switch costume to (costume1 v)\n        show\n    else\n        if <not <(Level) = [10]>> then\n            hide\n        end\n    end\nend\n\nwhen I receive [green flag v]\nswitch costume to (costume1 v)\ngo to x: (89) y: (-93)\nhide\n\nwhen I receive [trapped v]\nswitch costume to (costume2 v)\nshow\nset [level v] to [10]\n\n@Sprite1\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [trapped \(part 2\) v]\ngo to [front v] layer\nshow\nset [ghost v] effect to (100)\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nbroadcast (Trapped \(Part 3\) v)\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nshow\n\n@Sprite2\n\nwhen flag clicked\nhide\n\n@Sprite3\n\nwhen I receive [play v]\nhide\ngo to [back v] layer\nforever\n    if <<(Level) = [1]> or <(Level) = [20]>> then\nend\n\nwhen I start as a clone\nset [pixelate v] effect to (0)\nset size to (pick random (30) to (90)) %\nshow\nset [ghost v] effect to (pick random (40) to (90))\ngo to x: (273) y: (pick random (-83) to (190))\nforever\n    go to [back v] layer\n    change x by (-5)\n    if <(x position) < [-240]> then\n        delete this clone\n    end\n    if <touching (mouse-pointer v)?> then\n        change [ghost v] effect by (3)\n    end\nend\n\n