Ice Platformer

Instructions: Arrow keys to move or WASD (Space can jump also). I made this because I heard the song Ice Fight while doing homework, and thought 'Hey, that would make a good boss theme.' So I made it the boss theme.\nI may add more levels in the future. If you find any bugs, please tell me in the comments. I will try to fix them ASAP. 

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nforever\n    play sound [Ice Cavern - The Legend of Zelda - Ocarina of Time Music Extended v] until done\nend\n\nwhen flag clicked\nwait (.01) seconds\nwait until <([costume name v] of [ground v]) = [BOSS]>\nswitch backdrop to (backdrop2 v)\nstop [other scripts in sprite v]\nrepeat until <([backdrop name v] of [_stage_ v]) = [End]>\n    play sound [04 - Ice Fight - Red vs Blue Revelation Soundtrack \(By Jeff Williams\) v] until done\nend\n\nwhen I receive [fused shadow v]\nswitch backdrop to (backdrop1 v)\n\nwhen flag clicked\nwait until <([costume name v] of [ground v]) = [End]>\nstop [all v]\n\nwhen flag clicked\nhide variable [☁ world record v]\nhide variable [time v]\nset [time v] to [0]\nreset timer\nrepeat until <([costume # v] of [ground v]) = [11]>\n    set [time v] to (timer)\nend\n\nwhen I receive [world record? v]\nshow variable [☁ world record v]\nshow variable [time v]\nif <(☁ World Record) > (Time)> then\n    set [☁ world record v] to (Time)\nend\n\nwhen [p v] key pressed\nset [☁ world record v] to (☁ World Record)\n\nwhen [z v] key pressed\nhide variable [time v]\nhide variable [☁ world record v]\n\n@Platformer Script\n\nwhen I receive [teleport v]\ngo to x: (X Spawn) y: (Y Spawn)\n\nbroadcast (heal v)\nbroadcast (teleport v)\n\nwhen flag clicked\nwait (.1) seconds\nforever\n    go to [front v] layer\n    if <key (right arrow v) pressed?> then\n        switch costume to (rest_side_1 v)\n    end\n    if <key (left arrow v) pressed?> then\n        switch costume to (rest_side_2 v)\n    end\n    if <touching color (#59d2ed)?> then\n        go to x: (X Spawn) y: (Y Spawn)\n        broadcast (next v)\n    end\nend\n\nwhen flag clicked\nwait (1) seconds\npoint in direction (90)\nset [y spawn v] to [-80]\nset [x spawn v] to [-212]\ngo to x: (X Spawn) y: (Y Spawn)\nshow\nset size to (25) %\nset [x v] to [0]\nset [y v] to [0]\nforever\n    if on edge, bounce\n    change [y v] by (-0.5)\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [x v] by (-1)\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [x v] by (1)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching color (#cdf1f9)?> then\n        change y by (1)\n        if <touching color (#cdf1f9)?> then\n            change y by (1)\n            if <touching color (#cdf1f9)?> then\n                change y by (1)\n                if <touching color (#cdf1f9)?> then\n                    change y by (1)\n                    if <touching color (#cdf1f9)?> then\n                        change y by (1)\n                        if <touching color (#cdf1f9)?> then\n                            change y by (1)\n                            if <touching color (#cdf1f9)?> then\n                                change y by (-6)\n                                change x by ((x) * (-1))\n                                if <<key (up arrow v) pressed?> or <<key (space v) pressed?> or <key (w v) pressed?>>> then\n                                    set [y v] to [10]\n                                    if <(x) > [0]> 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    end\n    change y by (y)\n    if <touching color (#cdf1f9)?> then\n        change y by ((y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-0.5)\n    if <<touching color (#cdf1f9)?> and <<key (up arrow v) pressed?> or <<key (space v) pressed?> or <key (w v) pressed?>>>> then\n        set [y v] to [10]\n    end\n    change y by (0.5)\n    if <touching color (#beeef9)?> then\n        go to x: (X Spawn) y: (Y Spawn)\n        set [deaths v] to ((Deaths) + (1))\n    end\n    if <touching color (#003fff)?> then\n        set [y v] to [16]\n    end\nend\n\nwhen flag clicked\nshow\ngo to x: (X Spawn) y: (Y Spawn)\ngo to [front v] layer\ngo [backward v] (1) layers\n\nwhen I receive [the end v]\nhide\n\nwhen [z v] key pressed\nhide\n\nwhen I receive [the end v]\nhide\n\nwhen flag clicked\nforever\n    if <touching color (#c2edff)?> then\n        broadcast (BL;\) v)\n    end\nend\n\n@ground\n\nwhen I receive [next v]\nnext costume\n\nwhen flag clicked\nshow\nswitch costume to (level1 v)\n\nwhen [z v] key pressed\nhide\n\nwhen I receive [bl;\) v]\nswitch costume to (boss v)\n\n@BOSS\n\nwhen flag clicked\nwait (.01) seconds\nhide variable [boss hp: v]\nset [boss hp: v] to [500]\ngo to x: (0) y: (0)\nhide\nwait until <([costume name v] of [ground v]) = [BOSS]>\nshow\nbroadcast (bossy boss v)\nshow variable [boss hp: v]\nbroadcast (do projectile thing v)\nforever\n    if <touching (platformer script v)?> then\n        repeat (4)\n            next costume\n            wait (0.1) seconds\n        end\n        change [boss hp: v] by (-10)\n        if <(Boss hp:) < [1]> then\n            stop [other scripts in sprite v]\n            repeat (10)\n                change [whirl v] effect by (10)\n                change [ghost v] effect by (10)\n                wait (0.1) seconds\n            end\n            hide\n            broadcast (next v)\n            hide variable [boss hp: v]\n            broadcast (heal v)\n            broadcast (fused shadow v)\n            stop [other scripts in sprite v]\n            stop [this script v]\n        end\n    end\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\n    repeat (10)\n        change y by (1)\n    end\n    repeat (10)\n        change y by (-1)\n    end\nend\n\nwhen I receive [spike ground v]\nsay [Here come my Ground Spikes!] for (2) seconds\n\nwhen [o v] key pressed\nset [boss hp: v] to [10]\n\n@Ground Spikes\n\nwhen I receive [bossy boss v]\nshow\nforever\n    wait (pick random (10) to (20)) seconds\n    broadcast (Spike Ground v)\n    wait (5) seconds\n    repeat (10)\n        change y by (10)\n    end\n    wait (2) seconds\n    repeat (10)\n        change y by (-10)\n    end\n    wait (pick random (15) to (30)) seconds\nend\n\nwhen [z v] key pressed\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [fused shadow v]\nhide\nstop [other scripts in sprite v]\n\nwhen flag clicked\ngo to x: (13) y: (-160)\n\n@border\n\nwhen flag clicked\nshow\n\nwhen [z v] key pressed\nhide\n\n@projectile\n\nwhen flag clicked\nset size to (50) %\ngo to x: (0) y: (10)\nhide\n\nwhen I receive [heal v]\nset size to (50) %\ngo to x: (0) y: (10)\nhide\n\nwhen I receive [heal v]\nstop [other scripts in sprite v]\n\nwhen I start as a clone\nshow\nforever\n    point towards (platformer script v)\n    repeat until <touching color (#cdf1f9)?>\n        move (10) steps\n    end\n    delete this clone\nend\n\nwhen I receive [bossy boss v]\nforever\n    wait (1.5) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I receive [hide the shadow v]\nstop [other scripts in sprite v]\nstop [this script v]\n\n@Sprite1\n\nwhen flag clicked\nhide\nwait (1) seconds\nwait until <([costume name v] of [ground v]) = [End]>\nshow\nbroadcast (the end v)\nwait (.01) seconds\nbroadcast (world record? v)\nwait (.01) seconds\nstop [all v]\n\nwhen [z v] key pressed\nhide\n\n@Thumbnail\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (100)\n\nwhen [z v] key pressed\nset [ghost v] effect to (0)\n\n