Cubed - A Platformer

Instructions: Pro tip:\nGo into the castle.\nRun under boss.\n___________________________________________\n\nControls:\n*WASD, Arrow Keys and Space to move\n*Z to talk and activate checkpoints\n___________________________________________\n\nSorry it's a bit too short and bad, but I didn't really have the time.\n/ =

@Stage\n\nwhen flag clicked\nforever\n    switch backdrop to (Level)\nend\n\n@Player\n\nwhen flag clicked\nforever\n    if  then\n        switch costume to (costume8 v)\n    else\n        if <<key (up arrow v) pressed?> and <key (right arrow v) pressed?>> then\n            switch costume to (costume5 v)\n        else\n            if <<key (up arrow v) pressed?> and <key (left arrow v) pressed?>> then\n                switch costume to (costume6 v)\n            else\n                if <key (up arrow v) pressed?> then\n                    switch costume to (costume4 v)\n                else\n                    if <key (right arrow v) pressed?> then\n                        switch costume to (costume1 v)\n                    else\n                        if <key (left arrow v) pressed?> then\n                            switch costume to (costume2 v)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    wait (0) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <not > then\n    switch costume to (costume3 v)\nelse\n    switch costume to (costume8 v)\nend\nrepeat (12)\n    change [ghost v] effect by (8)\nend\ndelete this clone\n\nwhen I receive [ded v]\ndelete this clone\n\nwhen I receive [start v]\nset [level v] to [1]\ngo to x: (-219) y: (-86)\nforever\n    repeat until <(Go) = [1]>\n        if  then\n            change [xv v] by (.8)\n        end\n        if  then\n            change [xv v] by (-0.8)\n        end\n        set [xv v] to ((Xv) * (0.9))\n        change x by (Xv)\n        if <touching (platform v)?> then\n            change y by (1)\n            if <touching (platform v)?> then\n                change y by (1)\n                if <touching (platform v)?> then\n                    change y by (1)\n                    if <touching (platform v)?> then\n                        change y by (1)\n                        if <touching (platform v)?> then\n                            change y by (1)\n                            if <touching (platform v)?> then\n                                change x by ((Xv) * (-1))\n                                change y by (-5)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change [yv v] by (-1)\n        change y by (Yv)\n        if <touching (platform v)?> then\n            change y by ((Yv) * (-1))\n            set [yv v] to [0]\n        end\n        change y by (-1)\n        if <touching (platform v)?> then\n            if <key (up arrow v) pressed?> then\n                set [yv v] to [13]\n            end\n        end\n        if <<[228] < (x position)> or <touching (door v)?>> then\n            set [xv v] to [0]\n            set [xv v] to [0]\n            go to x: (-219) y: (-86)\n            point in direction (90)\n            change [level v] by (1)\n            change [money v] by (1)\n        end\n        if <<<<<touching (dangers v)?> or <touching (saws v)?>> or <touching (boss v)?>> or <touching (lava v)?>> or <touching (enemy v)?>> then\n            if <touching (boss v)?> then\n                broadcast (do it again v)\n            end\n            broadcast (ded v)\n            repeat (12)\n                broadcast (ded v)\n                change [ghost v] effect by (8)\n                broadcast (ded v)\n                change size by (-8)\n            end\n            broadcast (ded v)\n            start sound [ouch v]\n            broadcast (ded v)\n            set [xv v] to [0]\n            broadcast (ded v)\n            set [xv v] to [0]\n            broadcast (ded v)\n            set [ghost v] effect to (0)\n            broadcast (ded v)\n            go to x: (-219) y: (-86)\n            broadcast (ded v)\n            set size to (100) %\n            broadcast (ded v)\n        end\n        change y by (1)\n        hide variable [yv v]\n        hide variable [xv v]\n        if <touching (tramps v)?> then\n            set [yv v] to [22]\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (-219) y: (-86)\nforever\n    if <not <key (any v) pressed?>> then\n        switch costume to (costume7 v)\n    end\nend\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\nwhen I receive [go v]\ngo to x: (-219) y: (-86)\n\n@Platform\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [start v]\ngo to [front v] layer\n\nwhen I receive [start v]\nforever\n    if <<key (s v) pressed?> and <not <(Level) = [10]>>> then\n        change [level v] by (1)\n        broadcast (go v)\n        wait (3) seconds\n    end\nend\n\n@Dangers\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    switch costume to (Level)\nend\n\n@clouds\n\nwhen flag clicked\nhide\nset [ghost v] effect to (25)\nforever\n    if <not <[10] < (Level)>> then\n        wait (pick random (3) to (7)) seconds\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\nset x to (-255)\nset y to (pick random (74) to (165))\nswitch costume to (pick random (1) to (5))\nshow\nrepeat (102)\n    change x by (5)\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <[10] < (Level)> then\n        delete this clone\n    end\nend\n\n@haze\n\nwhen flag clicked\nshow\ngo to [front v] layer\nswitch costume to (costume1 v)\nset [level v] to [1]\nset [ghost v] effect to (80)\n\nwhen I receive [start v]\nset [ghost v] effect to (20)\nforever\n    switch costume to ((Level) + (1))\nend\n\nwhen I receive [start v]\nrepeat (30)\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\nend\n\n@preview\n\nwhen flag clicked\ngo to [front v] layer\nshow\nset [ghost v] effect to (0)\nswitch costume to (costume5 v)\nwait (1) seconds\nnext costume\nwait (2) seconds\nnext costume\nwait (2) seconds\nnext costume\nwait (2) seconds\nnext costume\nwait (5) seconds\nrepeat (25)\n    change [ghost v] effect by (4)\nend\nhide\nbroadcast (start v)\n\n@Lava\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nforever\n    repeat (10)\n        change y by (1)\n    end\n    repeat (10)\n        change y by (-1)\n    end\nend\n\n@saws\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    if <(Level) = [1]> then\n        hide\n    else\n        if <(Level) = [2]> then\n            hide\n        else\n            if <(Level) = [3]> then\n                show\n                go to x: (-32) y: (-55)\n            else\n                if <(Level) = [4]> then\n                    hide\n                else\n                    if <(Level) = [5]> then\n                        show\n                        go to x: (-28) y: (-128)\n                    else\n                        if <(Level) = [6]> then\n                            show\n                            go to x: (-28) y: (-125)\n                        else\n                            if <(Level) = [7]> then\n                                hide\n                            else\n                                if <(Level) = [8]> then\n                                    hide\n                                else\n                                    hide\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    turn right (10) degrees\nend\n\n@enemy\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    repeat (20)\n        change x by (-3)\n    end\n    repeat (20)\n        change x by (3)\n    end\nend\n\n@Door\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    switch costume to (Level)\nend\n\n@win screen\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nrepeat (300)\n    go to [front v] layer\nend\n\nwhen I receive [win v]\nset [ghost v] effect to (100)\nshow\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\n\nwhen flag clicked\nforever\n    play sound [Vexento - Syndrome v] until done\nend\n\n@thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n@boss\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [10]> then\n        show\n        broadcast (boss battle v)\n        stop [this script v]\n    else\n        hide\n    end\nend\n\nwhen I receive [boss battle v]\ngo to x: (0) y: (0)\nsay [Y] for (0) seconds\nsay [Yo] for (0) seconds\nsay [You] for (0) seconds\nsay [You ] for (0) seconds\nsay [You s] for (0) seconds\nsay [You sh] for (0) seconds\nsay [You sha] for (0) seconds\nsay [You shal] for (0) seconds\nsay [You shall] for (0) seconds\nsay [You shall ] for (0) seconds\nsay [You shall n] for (0) seconds\nsay [You shall no] for (0) seconds\nsay [You shall not] for (0) seconds\nsay [You shall not ] for (0) seconds\nsay [You shall not p] for (0) seconds\nsay [You shall not pa] for (0) seconds\nsay [You shall not pas] for (0) seconds\nsay [You shall not pass] for (0) seconds\nsay [You shall not pass!] for (3) seconds\nreset timer\nforever\n    repeat until <<touching (player v)?> or <<(timer) = [30]> or <[30] < (timer)>>>\n        if <(x position) > ([x position v] of [player v])> then\n            change x by (-1)\n        end\n        if <([x position v] of [player v]) > (x position)> then\n            change x by (1)\n        end\n    end\n    if <not <touching (player v)?>> then\n        broadcast (win v)\n    end\nend\n\nwhen I receive [do it again v]\nreset timer\nrepeat until <(x position) = [0]>\n    if <[0] < (x position)> then\n        change x by (-3)\n    end\n    if <(x position) < [0]> then\n        change x by (3)\n    end\nend\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\n@Tramps\n\nwhen flag clicked\nforever\n    if <(Level) = [10]> then\n        show\n    else\n        hide\n    end\nend\n\n