Darkness(A dark platformer)

Instructions: Welcome to Darkness!!! Arrow keys to move the player avoid the orange entities, red stuff(lava). You cannot see but you have a torch\nthat torch shall guide you to the green door which will make you proceed into the following room. There are many obstacles in every room like your little brothers. Press space to exit the story.\n\n\nP.S. Get to the green thing to proceed, Step on the button to on the lights. Try to get on the moving platforms

@Stage\n\nwhen flag clicked\nset [deaths v] to [0]\nswitch backdrop to (backdrop1 v)\nforever\n    play sound [FADED - where are you now.mp3 v] until done\nend\n\nwhen I receive [light v]\nswitch backdrop to (backdrop2 v)\n\n@Sprite2\n\nwhen flag clicked\ngo to (player v)\nhide\n\nwhen I receive [start v]\nshow\nforever\n    set [ghost v] effect to (25)\n    go to x: (15) y: (-24)\n    go to (player v)\nend\n\nwhen I receive [light v]\nhide\n\n@Ground\n\nwhen flag clicked\nset [light v] to [0]\nset [level v] to [1]\nhide\n\nwhen I receive [start v]\nshow\nforever\n    go to x: (0) y: (0)\n    switch costume to (level)\nend\n\nwhen I receive [light v]\nchange [level v] by (1)\nset [light v] to [1]\nswitch costume to (costume16 v)\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (-9) y: (32)\nshow\n\nwhen I receive [message1 v]\nhide\n\n@Sprite4\n\nwhen flag clicked\ngo to x: (54) y: (0)\nset [turn v] to [0]\nshow\nforever\n    change y by ([cos v] of (turn) )\n    change [turn v] by (2)\nend\n\nwhen this sprite clicked\nbroadcast (message1 v)\nhide\n\n@Sprite5\n\nwhen flag clicked\ngo to x: (-2) y: (36)\nhide\n\nwhen I receive [message1 v]\nset [ghost v] effect to (0)\nshow\nforever\n    if <key (space v) pressed?> then\n        wait until <not <key (space v) pressed?>>\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        broadcast (Start v)\n        stop [this script v]\n    end\nend\n\n@Sprite6\n\nwhen flag clicked\ngo to x: (190) y: (-133)\nset rotation style [left-right v]\npoint in direction (-90)\nhide\nswitch costume to (costume2 v)\nforever\n    if <(level) = [4]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [4]> then\n        show\n        repeat until <(level) = [5]>\n            point in direction (-90)\n            create clone of (_myself_ v)\n            wait (2) seconds\n            repeat (17.333)\n                change x by (-7.5)\n            end\n            point in direction (90)\n            repeat (17.333)\n                change x by (7.5)\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nshow\nswitch costume to (costume3 v)\nrepeat until <<touching (_edge_ v)?> or <<touching color (#ff0000)?> or <touching (ground v)?>>>\n    move (7.5) steps\nend\ndelete this clone\n\n@Sprite3\n\nwhen flag clicked\ngo to x: (-48) y: (96)\nset rotation style [left-right v]\npoint in direction (-90)\nhide\nswitch costume to (costume2 v)\nforever\n    if <(level) = [4]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I start as a clone\nshow\nswitch costume to (costume3 v)\nrepeat until <<touching (_edge_ v)?> or <<touching color (#00ff55)?> or <<touching color (#ff0000)?> or <touching (ground v)?>>>>\n    move (7.5) steps\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    if <(level) = [4]> then\n        show\n        repeat until <(level) = [5]>\n            point in direction (90)\n            create clone of (_myself_ v)\n            wait (2) seconds\n            repeat (30)\n                change x by (7.5)\n            end\n            point in direction (-90)\n            repeat (30)\n                change x by (-7.5)\n            end\n        end\n    end\nend\n\n@Sprite8\n\nwhen flag clicked\ngo to x: (-150) y: (10)\nhide\nswitch costume to (costume1 v)\nforever\n    if <(level) = [5]> then\n        show\n        repeat until <(level) = [6]>\n            wait (1) seconds\n            repeat (55)\n                change x by (5)\n            end\n            wait (1) seconds\n            repeat (55)\n                change x by (-5)\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (-150) y: (10)\nhide\nforever\n    if <(level) = [6]> then\n        stop [other scripts in sprite v]\n        forever\n            hide\n            switch costume to (costume2 v)\n        end\n    end\nend\n\n@Sprite7\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (-146) y: (-137)\nhide\nforever\n    if <(level) = [6]> then\n        show\n        repeat until <(level) = [7]>\n            wait (1) seconds\n            repeat (55)\n                change x by (5)\n            end\n            wait (1) seconds\n            repeat (55)\n                change x by (-5)\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (-146) y: (-137)\nhide\nforever\n    if <(level) = [7]> then\n        forever\n            hide\n            switch costume to (costume2 v)\n            stop [other scripts in sprite v]\n        end\n    end\nend\n\n@Sprite9\n\nwhen flag clicked\ngo to x: (-82) y: (54)\nset rotation style [left-right v]\npoint in direction (-90)\nhide\nswitch costume to (costume2 v)\nforever\n    if <(level) = [6]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I start as a clone\nshow\nswitch costume to (costume3 v)\nrepeat until <<touching (_edge_ v)?> or <<touching color (#00ff55)?> or <<touching color (#ff0000)?> or <touching (ground v)?>>>>\n    move (7.5) steps\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    if <(level) = [6]> then\n        show\n        repeat until <(level) = [7]>\n            point in direction (90)\n            create clone of (_myself_ v)\n            wait (2) seconds\n            repeat (27)\n                change x by (7.5)\n            end\n            point in direction (-90)\n            repeat (27)\n                change x by (-7.5)\n            end\n        end\n    end\nend\n\n@Sprite10\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (-68) y: (56)\nhide\nforever\n    if <(level) = [7]> then\n        show\n        repeat until <(level) = [8]>\n            wait (1) seconds\n            repeat (50)\n                change x by (5)\n            end\n            wait (1) seconds\n            repeat (50)\n                change x by (-5)\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (-68) y: (56)\nhide\nforever\n    if <(level) = [8]> then\n        stop [other scripts in sprite v]\n        hide\n        forever\n            switch costume to (costume2 v)\n        end\n    end\nend\n\n@Sprite11\n\nwhen flag clicked\ngo to x: (-154) y: (-133)\nset rotation style [left-right v]\npoint in direction (-90)\nhide\nswitch costume to (costume2 v)\nforever\n    if <(level) = [8]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I start as a clone\nshow\nswitch costume to (costume3 v)\nrepeat until <<touching (_edge_ v)?> or <<touching color (#00ff55)?> or <<touching color (#ff0000)?> or <touching (ground v)?>>>>\n    move (7.5) steps\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    if <(level) = [8]> then\n        show\n        repeat until <(level) = [9]>\n            point in direction (90)\n            create clone of (_myself_ v)\n            wait (2) seconds\n            repeat (13)\n                change x by (7.5)\n            end\n            point in direction (-90)\n            repeat (13)\n                change x by (-7.5)\n            end\n        end\n    end\nend\n\n@Sprite12\n\nwhen I start as a clone\nshow\nswitch costume to (costume3 v)\nrepeat until <<touching (_edge_ v)?> or <<touching color (#00ff55)?> or <<touching color (#ff0000)?> or <touching (ground v)?>>>>\n    move (7.5) steps\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    if <(level) = [8]> then\n        show\n        repeat until <(level) = [9]>\n            point in direction (90)\n            create clone of (_myself_ v)\n            wait (2) seconds\n            repeat (13)\n                change x by (7.5)\n            end\n            point in direction (-90)\n            repeat (13)\n                change x by (-7.5)\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (4) y: (-133)\nset rotation style [left-right v]\npoint in direction (-90)\nhide\nswitch costume to (costume2 v)\nforever\n    if <(level) = [8]> then\n        show\n    else\n        hide\n    end\nend\n\n@Sprite13\n\nwhen I start as a clone\nshow\nswitch costume to (costume3 v)\nrepeat until <<touching (_edge_ v)?> or <<touching color (#00ff55)?> or <<touching color (#ff0000)?> or <touching (ground v)?>>>>\n    move (7.5) steps\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    if <(level) = [8]> then\n        show\n        repeat until <(level) = [9]>\n            point in direction (90)\n            create clone of (_myself_ v)\n            wait (2) seconds\n            repeat (15)\n                change x by (7.5)\n            end\n            point in direction (-90)\n            repeat (15)\n                change x by (-7.5)\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (17) y: (87)\nset rotation style [left-right v]\npoint in direction (-90)\nhide\nswitch costume to (costume2 v)\nforever\n    if <(level) = [8]> then\n        show\n    else\n        hide\n    end\nend\n\n@Sprite14\n\nwhen flag clicked\nforever\n    if <(level) = [10]> then\n        hide\n        stop [other scripts in sprite v]\n    end\nend\n\nwhen flag clicked\ngo to x: (-22) y: (5)\npoint in direction (90)\nhide\nforever\n    if <(level) = [9]> then\n        show\n        repeat until <(level) = [10]>\n            turn right ([cos v] of (turn) ) degrees\n            change [turn v] by (2)\n        end\n    end\nend\n\n@Sprite15\n\nwhen flag clicked\nforever\n    if <(level) = [10]> then\n        hide\n        stop [other scripts in sprite v]\n    end\nend\n\nwhen flag clicked\ngo to x: (128) y: (5)\npoint in direction (90)\nhide\nforever\n    if <(level) = [9]> then\n        show\n        repeat until <(level) = [10]>\n            turn right ([cos v] of (turn) ) degrees\n            change [turn v] by (2)\n        end\n    end\nend\n\n@Sprite16\n\nwhen I start as a clone\nshow\nswitch costume to (costume3 v)\nrepeat until <<touching (_edge_ v)?> or <<touching color (#00ff55)?> or <<touching color (#ff0000)?> or <touching (ground v)?>>>>\n    move (7.5) steps\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    if <(level) = [13]> then\n        show\n        repeat until <(level) = [14]>\n            point in direction (-90)\n            create clone of (_myself_ v)\n            wait (2) seconds\n            repeat (35)\n                change x by (-10)\n            end\n            point in direction (90)\n            repeat (35)\n                change x by (10)\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (194) y: (-133)\nset rotation style [left-right v]\npoint in direction (-90)\nhide\nswitch costume to (costume2 v)\nforever\n    if <(level) = [13]> then\n        show\n    else\n        hide\n    end\nend\n\n@Sprite17\n\nwhen flag clicked\nset [deaths v] to [0]\nset size to (400) %\nswitch costume to (costume1 v)\nhide\ngo to x: (22) y: (-130)\nforever\n    if <(level) = [15]> then\n        show\n        if <touching (player v)?> then\n            switch costume to (costume2 v)\n            broadcast (Light v)\n            stop [this script v]\n        end\n    end\nend\n\nwhen flag clicked\nset [level v] to [1]\nforever\n    if <(level) = [17]> then\n        hide\n        wait (1) seconds\n        stop [this script v]\n    end\nend\n\nshow\n\n@Sprite18\n\nwhen flag clicked\nhide variable [deaths v]\ngo to x: (-125) y: (155)\nhide\nforever\n    if <(level) = [17]> then\n        show variable [deaths v]\n        show\n    end\nend\n\n@Player\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (-190) y: (113)\nhide\n\nwhen I receive [start v]\ngo to [front v] layer\nshow\nset rotation style [left-right v]\ngo to x: (-190) y: (113)\nforever\n    change [y v] by (-0.6)\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n        change [x v] by (1)\n    end\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n        change [x v] by (-1)\n    end\n    set [x v] to ((x) * (0.85))\n    change x by (x)\n    if <<touching color (#000000)?> or <touching color (#00cc44)?>> then\n        change y by (1)\n        if <<touching color (#000000)?> or <touching color (#00cc44)?>> then\n            change y by (1)\n            if <<touching color (#000000)?> or <touching color (#00cc44)?>> then\n                change y by (1)\n                if <<touching color (#000000)?> or <touching color (#00cc44)?>> then\n                    change y by (1)\n                    if <<touching color (#000000)?> or <touching color (#00cc44)?>> then\n                        change y by (1)\n                        if <<touching color (#000000)?> or <touching color (#00cc44)?>> then\n                            change y by (-5)\n                            change x by ((x) * (-1))\n                            if <key (up arrow v) pressed?> then\n                                set [y v] to [10]\n                                if <([abs v] of (x) ) = (x)> then\n                                    set [x v] to [-10]\n                                else\n                                    set [x v] to [10]\n                                end\n                            else\n                                set [x v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (y)\n    if <<touching color (#000000)?> or <touching color (#00cc44)?>> then\n        change y by ((y) - ((y) * (2)))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<touching color (#000000)?> or <touching color (#00cc44)?>> then\n        if <key (up arrow v) pressed?> then\n            set [y v] to [10]\n        end\n    end\n    change y by (1)\n    if <<touching color (#ff9400)?> or <touching color (#ff0000)?>> then\n        change [deaths v] by (1)\n        go to x: (-207) y: (70)\n    end\n    if <touching color (#00ff55)?> then\n        go to x: (-207) y: (70)\n        change [level v] by (1)\n    end\nend\n\ndefine physics\nphysics\n\ndefine physics\n\nwhen I receive [light v]\nswitch costume to (costume2 v)\n\n@Thumbnail\n\nwhen flag clicked\nset [brightness v] effect to (0)\ngo to x: (107) y: (-26)\nshow\nwait (3) seconds\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nhide\n\nwhen flag clicked\n\nwhen [a v] key pressed\nif <(username) = [y-velocity]> then\n    go to [front v] layer\n    show\n    stop [all v]\nend\n\n