A Hero's Journey || Platformer (Two scripts)

Instructions: Arrow keys to move/WASD/Motion Controls\nCollect the blue orb or key to be able to go to the next level.\nThe ghost following you will kill you! Only his eyes are deadly though to make the game a bit more forgiving. \nSpace to pause\n\nDon't forget to love follow and favorite!\n\nThis is part two of the 10 part series called scripts. In this series every game will have one more script than the last from one all the way up to 10. I am allowed to use any number of sprites and costumes.  

@Stage\n\n@Sprite1\n\nwhen flag clicked\ncreate clone of (_myself_ v)\ndelete all of [x v]\ndelete all of [y v]\ndelete all of [costume # v]\nset [delete clone v] to [0]\nhide\nset size to (100) %\nerase all\nset [pause v] to [0]\nset [clone go v] to [0]\nhide variable [volume v]\ngo to [front v] layer\ngo to x: (0) y: (0)\nset volume to (20) %\nset [wall jump v] to [0]\nset [jumping v] to [0]\nset [y velocity v] to [0]\nset [delete key v] to [0]\nset [up jump v] to [0]\nset [key v] to [2]\nset [next level v] to [1]\nset [level # v] to [1]\nswitch backdrop to (intro v)\nstart sound [Heart of Courage -TSFH v]\nshow\nswitch costume to (intro 1 v)\nwait (2) seconds\nrepeat (20)\n    change [ghost v] effect by (3)\nend\nswitch costume to (intro 2 v)\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (3) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nswitch costume to (intro 3 v)\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (3) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nswitch costume to (intro 4 v)\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (3) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nswitch costume to (intro 5 v)\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (3) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nswitch costume to (intro 6 v)\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (4) seconds\nrepeat (40)\n    change [ghost v] effect by (2.5)\nend\ngo to x: (0) y: (0)\nset [old time v] to (((current [hour v]) * (3600)) + (((current [minute v]) * (60)) + (current [second v])))\nset [ghost v] effect to (0)\nerase all\ngo to x: (0) y: (0)\nswitch backdrop to (backdrop1 v)\nswitch costume to (costume3 v)\nstamp\nstart sound [Victory v]\nswitch costume to (costume2 v)\ngo to x: (-76) y: (-40)\ncreate clone of (_myself_ v)\nforever\n    set size to (100) %\n    change y by (Y velocity)\n    set [current time v] to (((current [hour v]) * (3600)) + (((current [minute v]) * (60)) + (current [second v])))\n    if <not <touching color (#000000)?>> then\n        change [y velocity v] by (-1)\n    end\n    if <(Y velocity) < [-40]> then\n        set [y velocity v] to [-40]\n    end\n    if <touching color (#000000)?> then\n        if <<(Y velocity) = [0]> or <(Y velocity) < [0]>> then\n            change y by ((Y velocity) * (-1))\n            set [jumping v] to [0]\n            set [y velocity v] to [0]\n            if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > [0]>>>> then\n                set [y velocity v] to [12]\n            end\n        else\n            change y by ((Y velocity) * (-1))\n            set [y velocity v] to ((Y velocity) * (-1))\n        end\n    end\n    change [x velocity v] by (X acceleraion)\n    change x by (X velocity)\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 y by (1)\n                        if <touching color (#000000)?> then\n                            change y by (-5)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <touching color (#000000)?> then\n        if <(X velocity) > [0]> then\n            set [x velocity v] to [0]\n            if <touching color (#000000)?> then\n                if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > [0]>>>> then\n                    set [jumping v] to [1]\n                    set [y velocity v] to [8]\n                    set [x velocity v] to [-8]\n                    if <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > [0]>>>> then\n                        set [x acceleraion v] to [2]\n                    else\n                        set [x acceleraion v] to [0]\n                    end\n                end\n                change x by (-1)\n                if <touching color (#000000)?> then\n                    change x by (-1)\n                    if <touching color (#000000)?> then\n                        change x by (-1)\n                        if <touching color (#000000)?> then\n                            change x by (-1)\n                            if <touching color (#000000)?> then\n                                change x by (-1)\n                                if <touching color (#000000)?> then\n                                    change x by (-1)\n                                    if <touching color (#000000)?> then\n                                        change x by (-1)\n                                        if <touching color (#000000)?> then\n                                            change x by (-1)\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        else\n            set [x velocity v] to [0]\n            if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > [0]>>>> then\n                set [jumping v] to [1]\n                set [y velocity v] to [8]\n                set [x velocity v] to [8]\n                if <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(mouse x) < [0]>>>> then\n                    set [x acceleraion v] to [-2]\n                else\n                    set [x acceleraion v] to [0]\n                end\n            end\n            if <touching color (#000000)?> then\n                change x by (1)\n                if <touching color (#000000)?> then\n                    change x by (1)\n                    if <touching color (#000000)?> then\n                        change x by (1)\n                        if <touching color (#000000)?> then\n                            change x by (1)\n                            if <touching color (#000000)?> then\n                                change x by (1)\n                                if <touching color (#000000)?> then\n                                    change x by (1)\n                                    if <touching color (#000000)?> then\n                                        change x by (1)\n                                        if <touching color (#000000)?> then\n                                            change x by (1)\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <touching color (#ee00ff)?> then\n        set [y velocity v] to [20]\n    end\n    if <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > [0]>>>> then\n        switch costume to (costume2 v)\n        if <(Jumping) = [0]> then\n            set [x velocity v] to [7]\n        end\n    end\n    if <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(mouse x) < [0]>>>> then\n        switch costume to (costume1 v)\n        if <(Jumping) = [0]> then\n            set [x velocity v] to [-7]\n        end\n    end\n    if <not <<<<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> or <mouse down?>> or <<key (a v) pressed?> or <key (d v) pressed?>>>> then\n        set [x velocity v] to ((X velocity) * (0.7))\n        set [x acceleraion v] to ((X acceleraion) * (0.25))\n    end\n    if <(X acceleraion) < [-4]> then\n        if <(Jumping) = [0]> then\n            set [x acceleraion v] to [-4]\n        end\n    end\n    if <(X acceleraion) > [4]> then\n        if <(Jumping) = [0]> then\n            set [x acceleraion v] to [4]\n        end\n    end\n    if <(X velocity) > [4]> then\n        if <(Jumping) = [0]> then\n            set [x velocity v] to [4]\n        end\n    end\n    if <(X velocity) < [-4]> then\n        if <(Jumping) = [0]> then\n            set [x velocity v] to [-4]\n        end\n    end\n    if <(Jumping) = [1]> then\n        if <(X acceleraion) < [-4]> then\n            if <(Jumping) = [1]> then\n                set [x acceleraion v] to [-4]\n            end\n        end\n        if <(X acceleraion) > [4]> then\n            if <(Jumping) = [1]> then\n                set [x acceleraion v] to [4]\n            end\n        end\n        if <(X velocity) > [10]> then\n            if <(Jumping) = [1]> then\n                set [x velocity v] to [10]\n            end\n        end\n        if <(X velocity) < [-10]> then\n            if <(Jumping) = [1]> then\n                set [x velocity v] to [-10]\n            end\n        end\n    end\n    if <(Jumping) = [1]> then\n        change [wall time v] by (1)\n    end\n    if <<(Wall time) > [8]> or <(Wall time) = [8]>> then\n        set [wall time v] to [0]\n        set [jumping v] to [0]\n    end\n    if <(Jumping) = [0]> then\n        set [x acceleraion v] to ((X acceleraion) * (0.25))\n    end\n    if <<<touching color (#ff0000)?> or <key (r v) pressed?>> or <(y position) < [-170]>> then\n        start sound [Crunch v]\n        set [delete key v] to [1]\n        set [wall jump v] to [0]\n        set [jumping v] to [0]\n        set [y velocity v] to [0]\n        set [up jump v] to [0]\n        set [x acceleraion v] to [0]\n        set [x velocity v] to [0]\n        set [clone go v] to [0]\n        set [key v] to [2]\n        create clone of (_myself_ v)\n        set [delete clone v] to [1]\n        set [explode v] to [1]\n        create clone of (_myself_ v)\n        delete all of [costume # v]\n        delete all of [x v]\n        delete all of [y v]\n        go to x: (-211) y: (item (Level #) of [start y v])\n        wait until <not <key (r v) pressed?>>\n    end\n    if <<(Key) = [0]> and <(x position) > [239]>> then\n        set [wall jump v] to [0]\n        set [jumping v] to [0]\n        set [y velocity v] to [0]\n        set [up jump v] to [0]\n        set [x acceleraion v] to [0]\n        set [x velocity v] to [0]\n        set [next level v] to [1]\n        change [level # v] by (1)\n        set [clone go v] to [0]\n        set [delete key v] to [1]\n        set [delete clone v] to [1]\n        set [key v] to [2]\n        create clone of (_myself_ v)\n        delete all of [costume # v]\n        delete all of [x v]\n        delete all of [y v]\n        go to x: (-211) y: (item (Level #) of [start y v])\n    end\n    if <(Next Level) = [1]> then\n        set [next level v] to [0]\n        go to x: (0) y: (0)\n        erase all\n        switch costume to ((Level #) + (14))\n        stamp\n        switch costume to (costume2 v)\n        go to x: (-211) y: (item (Level #) of [start y v])\n    end\n    if <<<((Old time) + (317)) = (Current Time)> or <((Old time) + (317)) < (Current Time)>> or <(Current Time) < (Old time)>> then\n        set [old time v] to (((current [hour v]) * (3600)) + (((current [minute v]) * (60)) + (current [second v])))\n        start sound [Victory v]\n    end\n    if <key (space v) pressed?> then\n        wait until <not <key (space v) pressed?>>\n        set [pause v] to [1]\n        set size to (300) %\n        set [ghost v] effect to (30)\n        set [old costume v] to (costume [number v])\n        switch costume to (pause v)\n        show variable [volume v]\n        set [volume v] to (volume)\n        repeat until <key (space v) pressed?>\n            set volume to (Volume) %\n        end\n        wait until <not <key (space v) pressed?>>\n        set [ghost v] effect to (0)\n        set [pause v] to [0]\n        set size to (100) %\n        hide variable [volume v]\n        switch costume to (Old costume)\n    end\n    if <not <<(x position) = [-211]> and <(Clone go) = [0]>>> then\n        add (x position) to [x v]\n        add (y position) to [y v]\n        add (costume [number v]) to [costume # v]\n    end\n    if <<<<(length of [costume # v]) > [39]> or <<(length of [x v]) > [39]> or <(length of [y v]) > [39]>>> and <(Clone go) = [0]>> and <not <(x position) = [-211]>>> then\n        set [clone go v] to [1]\n        set [delete clone v] to [0]\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\nif <(Clone go) = [1]> then\n    repeat until <(Delete Clone) = [1]>\n        if <(Pause) = [0]> then\n            go to x: (item (1) of [x v]) y: (item (1) of [y v])\n            switch costume to ((item (1) of [costume # v]) + (2))\n            delete (1) of [x v]\n            delete (1) of [y v]\n            delete (1) of [costume # v]\n        end\n    end\n    delete this clone\nend\nif <(Key) = [2]> then\n    set [key v] to [1]\n    repeat until <(Delete key) = [1]>\n        go to x: (join (letter (1) of (item (Level #) of [key pos v])) (join (letter (2) of (item (Level #) of [key pos v])) (join (letter (3) of (item (Level #) of [key pos v])) (letter (4) of (item (Level #) of [key pos v]))))) y: (join (letter (5) of (item (Level #) of [key pos v])) (join (letter (6) of (item (Level #) of [key pos v])) (join (letter (7) of (item (Level #) of [key pos v])) (letter (8) of (item (Level #) of [key pos v])))))\n        show\n        switch costume to (key v)\n        set [delete key v] to [0]\n        if <touching color (#ffffff)?> then\n            hide\n            set [key v] to [0]\n            start sound [Collect v]\n            wait until <(Delete key) = [1]>\n        end\n    end\n    set [delete key v] to [0]\n    delete this clone\nend\nif <(Explode) = [1]> then\n    set [explode v] to [2]\n    switch costume to (effect v)\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\n    create clone of (_myself_ v)\n    delete this clone\nend\nif <(Explode) = [2]> then\n    switch costume to (effect v)\n    point in direction (pick random (0) to (360))\n    repeat (pick random (8) to (10))\n        move (pick random (5) to (10)) steps\n        change [ghost v] effect by (6)\n        if <<<touching color (#000000)?> or <touching (_edge_ v)?>> or <touching color (#ff0000)?>> then\n            delete this clone\n        end\n    end\n    delete this clone\nend\n\n