Spooky: A PLATFORMER in the dark

Instructions:                 ⋙ Spooky : A PLATFORMER ⋘\n               ⋙ made by @cool_scratch_girl ⋘\n\n⠀⠀✧ ◦ ◦ ◦ ✧ ◦ ◦ ◦ ✧ ◦ ◦ ◦ ✧ ◦ ◦ ◦ ✧ ◦ ◦ ◦ ✧ ◦ ◦ ◦ ✧ ◦ ◦ ◦ ✧\n                                 ⋙ Rules ⋘\n ◦                   Use ➡,⬅,⬆,⬇ or WASD keys.                  ◦\n ◦                  Don't touch the spikes or lava.                    ◦    \n ◦               Press the 'Space' key to have a light             ◦\n\n                            ⋙ From this Series ⋘\n ◦        https://scratch.mit.edu/projects/584953969/       ◦\n                                 ⋙ Shoutout ⋘\n ◦             Follow my sister @_super_scratch_girl_           ◦ \n\n                                     ⋙ Tags ⋘\n ◦       #halloween #spooky #ghost #platformer #all         ◦\n⠀⠀✧ ◦ ◦ ◦ ✧ ◦ ◦ ◦ ✧ ◦ ◦ ◦ ✧ ◦ ◦ ◦ ✧ ◦ ◦ ◦ ✧ ◦ ◦ ◦ ✧ ◦ ◦ ◦ ✧

@Stage\n\nwhen flag clicked\nswitch backdrop to (beginning  v)\n\n@Spirit\n\nwhen flag clicked\nforever\n    if <touching color (#ee67ff)?> then\n        set [y v v] to [20]\n    end\nend\n\nwhen flag clicked\nswitch costume to (middle v)\n\ndefine Reset player variables\nset [x v v] to [0]\nset [y v v] to [0]\nhide variable [level v]\nhide variable [y v v]\nhide variable [x v v]\n\ndefine reset\nset size to (100) %\nshow\ngo to x: (-200) y: (0)\npoint in direction (90)\nReset player variables\n\nwhen flag clicked\nswitch costume to (middle v)\n\ndefine Next level\nchange [level v] by (1)\nReset player variables\nreset\n\nwhen I receive [next level v]\nchange [level v] by (1)\n\ndefine If touching\nif <touching (spikes v)?> then\n    reset\nend\n\nwhen flag clicked\ngo to x: (-190) y: (-100)\nshow\n\nwhen I receive [spooky story done v]\nforever\n    wait until <touching (end v)?>\n    broadcast (NEXT LEVEL v)\n    go to x: (-200) y: (0)\nend\n\nwhen I receive [spooky story done v]\nforever\n    if <(x position) = [240]> then\n        Next level\n    end\nend\n\nwhen I receive [spooky story done v]\nforever\n    if <<not <key (up arrow v) pressed?>> and <<not <key (right arrow v) pressed?>> and <not <<key (left arrow v) pressed?> or <key (down arrow v) pressed?>>>>> then\n        switch costume to (middle v)\n    end\nend\n\nwhen I receive [spooky story done v]\ngo to [front v] layer\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        switch costume to (right v)\n    end\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        switch costume to (up v)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        switch costume to (left v)\n    end\n    if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n        switch costume to (down v)\n    end\nend\n\nwhen I receive [spooky story done v]\nset [level v] to [1]\nset size to (100) %\nreset\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [x v v] by (.9)\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [x v v] by (-.9)\n    end\n    set [x v v] to ((X v) * (0.9))\n    change x by (X v)\n    if <touching (ground v)?> then\n        change y by (1)\n        if <touching (ground v)?> then\n            change y by (1)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (1)\n                        if <touching (ground v)?> then\n                            change x by ((X v) * (-1))\n                            change y by (-5)\n                            if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>>> then\n                                if <(X v) > [0]> then\n                                    set [x v v] to [-5]\n                                else\n                                    set [x v v] to [5]\n                                end\n                                set [y v v] to [15]\n                            else\n                                set [x v v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y v v] by (-1)\n    change y by (Y v)\n    if <touching (ground v)?> then\n        change y by ((Y v) * (-1))\n        set [y v v] to [0]\n    end\n    change y by (-1)\n    if <touching (ground v)?> then\n        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>>> then\n            set [y v v] to [12]\n        end\n    end\n    change y by (1)\n    If touching\nend\n\nwhen I receive [magical candy v]\nforever\n    if <touching (end v)?> then\n        broadcast (Done With Quest! v)\n    end\nend\n\nwhen I receive [declined quest v]\nhide\n\nwhen I receive [work please!! v]\nhide\n\n@Guiding Light\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    go to (spirit v)\nend\n\nwhen flag clicked\nforever\n    if <key (space v) pressed?> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [magicalcandyhide v]\nhide\n\nwhen I receive [declined quest v]\nhide\n\nwhen I receive [work please!! v]\nhide\n\nwhen I receive [bright light v]\nshow\n\nwhen I receive [not bright light v]\nhide\n\n@Ground\n\nwhen flag clicked\nswitch costume to (ground0 v)\ngo to x: (0) y: (-8)\nshow\n\nwhen I receive [accepted quest v]\nswitch costume to (ground0 v)\n\nwhen I receive [accepted quest v]\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [magicalcandyhide v]\nhide\n\nwhen I receive [declined quest v]\nhide\n\nwhen I receive [work please!! v]\nhide\n\n@Spikes\n\nwhen flag clicked\ngo to x: (0) y: (-8)\n\nwhen flag clicked\nshow\nswitch costume to (spikes0 v)\n\nwhen I receive [accepted quest v]\nswitch costume to (spikes1 v)\nshow\n\nwhen I receive [accepted quest v]\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [magicalcandyhide v]\nhide\n\nwhen I receive [declined quest v]\nhide\n\nwhen I receive [work please!! v]\nhide\n\n@End\n\nwhen flag clicked\nswitch costume to (costume0 v)\ngo to x: (0) y: (30)\n\nwhen I receive [accepted quest v]\nshow\nswitch costume to (costume1 v)\n\nwhen I receive [accepted quest v]\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [magicalcandyhide v]\nhide\n\nwhen I receive [declined quest v]\nhide\n\nwhen I receive [accepted quest v]\nforever\n    if <(costume [number v]) = [11]> then\n        if <touching (spirit v)?> then\n            broadcast (Work please!! v)\n        end\n    end\nend\n\nwhen I receive [accepted quest v]\nforever\n    if <(costume [number v]) = [11]> then\n        broadcast (Magical Candy v)\n    end\nend\n\nwhen I receive [work please!! v]\nhide\n\n@Sprite1\n\nwhen flag clicked\nforever\n    go to (spirit v)\nend\n\nwhen flag clicked\nswitch costume to (text1 v)\nshow\n\nwhen flag clicked\nwait until <(costume [name v]) = [Text7]>\nbroadcast (Yes Or No v)\nswitch costume to (text7 v)\n\nwhen I receive [accepted quest v]\nhide\n\nwhen I receive [declined quest v]\nhide\n\nwhen I receive [next speech v]\nnext costume\n\nwhen I receive [previous speech v]\nswitch costume to ((costume [number v]) - (1))\n\nwhen flag clicked\nforever\n    if <(costume [name v]) = [Text1]> then\n        broadcast (Hide Previous Button v)\n    else\n        broadcast (Show Previous Button v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [name v]) = [Text7]> then\n        broadcast (Hide Next Button v)\n        broadcast (Hide Previous Button v)\n    else\n        broadcast (Show Next Button v)\n    end\nend\n\nwhen flag clicked\nbroadcast (Hide Previous Button v)\nbroadcast (boo! speech v)\n\nwhen I receive [magicalcandyhide v]\nhide\n\nwhen I receive [declined quest v]\nhide\n\nwhen I receive [work please!! v]\nhide\n\n@Sprite2\n\nwhen flag clicked\nhide\nforever\n    go to (spirit v)\nend\n\nwhen I receive [yes or no v]\nswitch costume to (costume1 v)\nshow\nask [] and wait\nif <<(answer) = [yes]> or <<<(answer) = [yeah]> or <(answer) = [ye]>> or <<(answer) = [yeh]> or <<(answer) = [of course]> or <<<(answer) = [Yes!]> or <(answer) = [yes!]>> or <<(answer) = [y]> or <<(answer) = [ yes]> or <<(answer) = [sure]> or <<(answer) = [ok]> or <(answer) = [yep]>>>>>>>>>> then\n    switch costume to (yes v)\n    broadcast (Accepted Quest v)\n    broadcast (Spooky Story Done v)\n    stop [this script v]\nelse\n    switch costume to (no v)\n    broadcast (Declined Quest v)\n    stop [this script v]\nend\n\nwhen I receive [accepted quest v]\nwait (2) seconds\nhide\n\nwhen I receive [magicalcandyhide v]\nhide\n\nwhen I receive [declined quest v]\nhide\n\nwhen I receive [work please!! v]\nhide\n\n@Next Button\n\nwhen flag clicked\nforever\n    go to (spirit v)\nend\n\nwhen this sprite clicked\nbroadcast (Next speech v)\n\nwhen I receive [hide next button v]\nhide\n\nwhen I receive [show next button v]\nshow\n\nwhen I receive [yes or no v]\nhide\n\nwhen I receive [magicalcandyhide v]\nhide\n\nwhen I receive [declined quest v]\nhide\n\nwhen I receive [work please!! v]\nhide\n\n@Previous Button\n\nwhen flag clicked\nforever\n    go to (spirit v)\nend\n\nwhen this sprite clicked\nbroadcast (Previous Speech v)\n\nwhen I receive [hide previous button v]\nhide\n\nwhen I receive [show previous button v]\nshow\n\nwhen I receive [yes or no v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [boo! speech v]\nhide\n\nwhen I receive [magicalcandyhide v]\nhide\n\nwhen I receive [declined quest v]\nhide\n\nwhen I receive [work please!! v]\nhide\n\n@Sprite3\n\nwhen flag clicked\nhide\nforever\n    go to (spirit v)\nend\n\nwhen I receive [magical candy v]\nshow\n\nwhen I receive [done with quest! v]\nhide\n\nwhen I receive [declined quest v]\nhide\n\nwhen I receive [work please!! v]\nhide\n\n@Animation\n\nwhen flag clicked\nhide\n\nwhen I receive [work please!! v]\nshow\n\nwhen I receive [declined quest v]\nhide\n\n@Sprite4\n\nwhen flag clicked\nhide\n\nwhen I receive [declined quest v]\nshow\n\n