ESCAPE - A platformer

Instructions: w a s d or ar arrow keys to move\nr to restart

@Stage\n\nwhen I receive [start v]\nwait (0.1) seconds\nforever\n    play sound [Music v] until done\nend\n\nwhen I receive [start v]\nwait until <(Level) = [8]>\nbroadcast (make level v)\nset [make mode v] to [on]\n\n@Player\n\nwhen flag clicked\nset [brightness v] effect to (0)\nhide\nbroadcast (intro v)\n\nwhen I receive [start v]\nswitch costume to (right v)\nset [ghost v] effect to (0)\nshow\ngo to x: (-180) y: (-50)\nset rotation style [left-right v]\npoint in direction (-90)\nforever\n    if <(make mode) = [off]> then\n        change [y v] by (-1)\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            change [x v] by (-0.6)\n            point in direction (90)\n        end\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            change [x v] by (0.6)\n            point in direction (-90)\n        end\n        set [x v] to ((x) * (0.9))\n        change x by (x)\n        if <<touching (ground v)?> or <touching (figur2 v)?>> then\n            change y by (1)\n        end\n        if <<touching (ground v)?> or <touching (figur2 v)?>> then\n            change y by (1)\n        end\n        if <<touching (ground v)?> or <touching (figur2 v)?>> then\n            change y by (1)\n        end\n        if <<touching (ground v)?> or <touching (figur2 v)?>> then\n            change y by (1)\n        end\n        if <<touching (ground v)?> or <touching (figur2 v)?>> then\n            change y by (-4)\n            change x by ((x) * (-1))\n            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                set [y v] to [10]\n                if <([abs v] of (x) ) = (x)> then\n                    set [x v] to [-5]\n                else\n                    set [x v] to [5]\n                end\n            else\n                set [x v] to [0]\n            end\n        end\n        change y by (y)\n        if <<touching (ground v)?> or <touching (figur2 v)?>> then\n            change y by ((0) - (y))\n            set [y v] to [1]\n        end\n        change y by (-1)\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <<touching (ground v)?> or <touching (figur2 v)?>>> then\n            set [y v] to [15]\n        end\n        change y by (1)\n        if <<(x position) > [230]> and <not <(Level) = [8]>>> then\n            set [x v] to [0]\n            set [y v] to [0]\n            go to x: (-180) y: (-50)\n            change [level v] by (1)\n            broadcast (NextLevel v)\n        end\n        if <<(x position) > [230]> and <(Level) = [8]>> then\n            set [x v] to [0]\n            set [y v] to [0]\n            go to x: (-180) y: (-50)\n            set [make mode v] to [on]\n        end\n    end\nend\n\nwhen I receive [start v]\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nrepeat (8)\n    change [brightness v] effect by (10)\n    change size by (-7)\nend\ndelete this clone\n\nwhen I receive [start v]\nforever\n    if <touching (spines v)?> then\n        broadcast (dead v)\n    end\n    if <[-170] > (y position)> then\n        broadcast (dead v)\n    end\nend\n\nwhen I receive [dead v]\nset [x v] to [0]\nset [y v] to [0]\ngo to x: (-180) y: (-50)\n\nwhen [r v] key pressed\nbroadcast (dead v)\n\nwhen flag clicked\nset [x v] to [0]\nset [y v] to [0]\nset [level v] to [1]\nset [make mode v] to [off]\n\nbroadcast (dead v)\n\nwhen I receive [dead v]\nif <(Level) = [8]> then\n    set [make mode v] to [off]\nend\n\nchange [level v] by (1)\nbroadcast (NextLevel v)\n\nwhen I receive [delete clone \(block and spines\) v]\nbroadcast (dead v)\nset [make mode v] to [off]\n\n@ground\n\nwhen flag clicked\nswitch costume to (1 v)\nshow\nset [ghost v] effect to (100)\n\nwhen I receive [start v]\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nset [ghost v] effect to (100)\n\nwhen I receive [nextlevel v]\nnext costume\n\n@level\n\nwhen flag clicked\ngo to x: (180) y: (150)\nhide\nforever\n    switch costume to (letter (1) of (Level))\nend\n\nwhen flag clicked\n\nwhen I start as a clone\nchange x by (10)\nforever\n    switch costume to (letter (2) of (Level))\nend\n\nwhen I receive [start v]\nshow\nwait until <[9] < (Level)>\ncreate clone of (_myself_ v)\n\n@intro\n\nwhen I start as a clone\ngo to x: (0) y: (70)\npoint in direction (90)\nswitch costume to (lucphuc_logo3 v)\nwait until <(effect) = [100]>\nwait (0.2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    change y by (-3)\nend\nbroadcast (START v)\n\nwhen I receive [intro v]\nshow\ndelete clone\nshow\nset volume to (100) %\nstart sound [Zaza - Be Together v]\nset [effect v] to [0]\nswitch costume to (f8492011-187e-4b27-a5f2-642ac489e04e_200x200 v)\nset [ghost v] effect to (0)\npoint in direction (90)\ngo to x: (0) y: (0)\ncreate clone of (_myself_ v)\nwait (1) seconds\nset [effect v] to [13]\nrepeat (effect)\n    change [effect v] by (-1)\n    change y by (effect)\nend\nwait (1.2) seconds\nset [effect v] to [100]\nwait (0.1) seconds\nset [effect v] to [6]\nrepeat (effect)\n    change [effect v] by (-2.5)\n    change y by (effect)\nend\nset [effect v] to [10]\nrepeat (effect)\n    change [effect v] by (-1)\n    change y by ((effect) * (-1))\n    change [ghost v] effect by (10)\n    change volume by (-8)\nend\nstop all sounds\n\ndefine delete clone\ndelete this clone\n\nwhen I receive [start v]\nhide\n\n@text\n\nwhen flag clicked\nswitch costume to (1 v)\nshow\nset [ghost v] effect to (100)\n\nwhen I receive [start v]\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [nextlevel v]\nnext costume\n\n@spines\n\nwhen flag clicked\nshow\npoint in direction (90)\nswitch costume to (1 v)\n\nwhen I receive [nextlevel v]\nbroadcast (delete clone \(spines\) v)\nnext costume\nlevel 8 (make a level)\nlevel 3 or 4\nlevel 5\n\nwhen I receive [delete clone \(spines\) v]\ndelete this clone\n\ngo to x: (-10) y: (79)\n\ndefine level 3 or 4\nif <<(Level) = [3]> or <(Level) = [4]>> then\n    go to x: (-50) y: (-115)\n    create clone of (_myself_ v)\n    change x by (20)\n    create clone of (_myself_ v)\n    change x by (70)\n    create clone of (_myself_ v)\n    change x by (20)\nend\n\ndefine level 5\nif <(Level) = [5]> then\n    go to x: (-70) y: (-115)\n    create clone of (_myself_ v)\n    change x by (20)\n    create clone of (_myself_ v)\n    change x by (20)\n    create clone of (_myself_ v)\n    change x by (70)\n    create clone of (_myself_ v)\n    change x by (20)\n    create clone of (_myself_ v)\n    change x by (20)\n    create clone of (_myself_ v)\n    change x by (20)\n    create clone of (_myself_ v)\n    point in direction (-90)\n    go to x: (-30) y: (80)\n    create clone of (_myself_ v)\n    change x by (20)\n    create clone of (_myself_ v)\n    change x by (20)\nend\n\ndelete this clone\n\nwhen I receive [delete clone \(block and spines\) v]\ndelete this clone\n\ndefine level 8 (make a level)\nif <(Level) = [8]> then\n    point in direction (90)\n    switch costume to (3 v)\n    repeat until <not <(Level) = [8]>>\n        go to x: ((round ((mouse x) / (12))) * (12)) y: ((round ((mouse y) / (20))) * (20))\n    end\nend\n\nwhen this sprite clicked\nif <<(make mode) = [on]> and <(block) = [spines]>> then\n    if <not <touching (_edge_ v)?>> then\n        if <not <(if mouse pointer touching edit,Play button) = [true]>> then\n            create clone of (_myself_ v)\n        end\n    end\nend\n\nwhen I receive [start v]\nwait until <(Level) = [8]>\nforever\n    if <<(make mode) = [on]> and <(block) = [spines]>> then\n        show\n        go to x: ((round ((mouse x) / (12))) * (12)) y: ((round ((mouse y) / (20))) * (20))\n    else\n        hide\n    end\nend\n\ngo to [back v] layer\n\n@shadow\n\nwhen flag clicked\ngo to [back v] layer\ngo to x: (0) y: (0)\ngo to [back v] layer\nswitch costume to (1 v)\nshow\nset [ghost v] effect to (100)\n\nwhen I receive [start v]\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nset [ghost v] effect to (100)\n\nwhen I receive [nextlevel v]\nnext costume\n\n@Figur1\n\nwhen flag clicked\nhide\n\n@Figur2\n\nwhen flag clicked\nhide\n\nif <mouse down?> then\nend\n\nif  then\nend\n\nbroadcast (NextLevel v)\n\nset [level v] to [8]\n\nchange x by (-5)\n\nwhen this sprite clicked\nif <<not <touching (figur2 v)?>> and <not <touching (_edge_ v)?>>> then\n    if <<not <(if mouse pointer touching edit,Play button) = [true]>> and <(block) = [block]>> then\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I receive [start v]\ngo to [back v] layer\nforever\n    if <<(make mode) = [on]> and <(block) = [block]>> then\n        show\n        go to x: ((round ((mouse x) / (12))) * (12)) y: ((round ((mouse y) / (20))) * (20))\n    else\n        hide\n    end\nend\n\nwhen I receive [delete clone \(block and spines\) v]\ndelete this clone\n\n@Figur3\n\nwhen flag clicked\nset [ghost v] effect to (0)\nswitch costume to (kostüm4 v)\nwait (0.1) seconds\nset [ghost v] effect to (100)\n\n\n\nwait (0.3) seconds\n\nbroadcast (NextLevel v)\n\nset [make mode v] to [on]\nset [level v] to [8]\n\nwhen this sprite clicked\nif <(make mode) = [off]> then\n    set [make mode v] to [on]\n    broadcast (dead v)\nelse\n    if <(make mode) = [on]> then\n        set [make mode v] to [off]\n        broadcast (dead v)\n    end\nend\n\nwhen I receive [make level v]\nset [ghost v] effect to (0)\nrepeat until <not <(Level) = [8]>>\n    set [if mouse pointer touching edit,play button v] to <touching (mouse-pointer v)?>\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (50)\n    else\n        set [brightness v] effect to (0)\n    end\n    if <(make mode) = [on]> then\n        switch costume to (kostüm3 v)\n    else\n        switch costume to (kostüm2 v)\n    end\nend\n\nbroadcast (Play \(make mode\) v)\n\n@Figur4\n\nwhen this sprite clicked\nbroadcast (delete clone \(block and spines\) v)\n\nset [level v] to [8]\nset [make mode v] to [on]\n\nwhen flag clicked\nhide\n\nwait until <(Level) = [8]>\n\nwhen I receive [start v]\nswitch costume to (kostüm1 v)\ncreate clone of (_myself_ v)\nforever\n    if <(make mode) = [on]> then\n        show\n    end\n    set [if mouse touching delete all button v] to <touching (mouse-pointer v)?>\nend\n\nwhen I start as a clone\nswitch costume to (kostüm2 v)\ngo [forward v] (1) layers\nforever\n    if <(if mouse touching delete all button) = [true]> then\n        go to (mouse-pointer v)\n        show\n    else\n        hide\n    end\nend\n\n@Figur5\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nwait until <(Level) = [8]>\nshow\nswitch costume to (kostüm1 v)\ngo to x: (-50) y: (150)\ncreate clone of (_myself_ v)\nchange x by (50)\nswitch costume to (kostüm2 v)\nforever\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        set [block v] to [block]\n    end\n    if <(block) = [block]> then\n        switch costume to (kostüm4 v)\n    else\n        switch costume to (kostüm2 v)\n    end\nend\n\nwhen I start as a clone\nforever\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        set [block v] to [spines]\n    end\n    if <(block) = [spines]> then\n        switch costume to (kostüm3 v)\n    else\n        switch costume to (kostüm1 v)\n    end\nend\n\nset [level v] to [8]\n\n