Platformer Boss Battle

Instructions: NEW GAME!!!   ◆Cαvҽ Plαtϝσɾɱҽɾ◆ https://scratch.mit.edu/projects/463984312\n\n------------------------Instructions------------------------------\nTOP LOVED!!! on 18.12.2020              ඞ ☺\nTOP REMIX!!!  on 30.12.2020\nThank You Soo Much!!!\n\nUpdate : Skip Button!\n\nThanks To  @FUNUT For The awesome Platformer Tutorial On YouTube!\n\nUse Key Right To Go Right = >\nUse Key Left To Go Left = <       Or use W,A,S and D\nUse Key Up To Jump = ↑\n\nSong : TheFatRat MayDay (Instrumental)\nR = Restart\nPurple = Bouncy  

@Stage\n\nwhen flag clicked\nset [level v] to [1]\nset [deaths v] to [0]\nhide variable [deaths v]\nswitch backdrop to (menu v)\nset volume to (50) %\nforever\n    play sound [Wallpaper \(Kevin MacLeod\) v] until done\nend\n\nwhen I receive [menu v]\nswitch backdrop to (menu v)\n\nwhen I receive [story v]\nswitch backdrop to (story v)\n\nwhen I receive [next level v]\nchange [level v] by (1)\nnext backdrop\n\nwhen [m v] key pressed\nif <(volume) = [50]> then\n    set volume to (0) %\n    broadcast (off v)\nelse\n    set volume to (50) %\n    broadcast (on v)\nend\n\nwhen I receive [music v]\nif <(volume) = [50]> then\n    set volume to (0) %\n    broadcast (off v)\nelse\n    set volume to (50) %\n    broadcast (on v)\nend\n\nwhen flag clicked\nbroadcast (menu v)\n\nwhen I receive [start v]\nswitch backdrop to (level 1 v)\nshow variable [level v]\nshow variable [deaths v]\n\n@Player\n\nwhen flag clicked\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [xv v] by (1)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching color (#00cc44)?> then\n        change y by (1)\n        if <touching color (#00cc44)?> then\n            change y by (1)\n            if <touching color (#00cc44)?> then\n                change y by (1)\n                if <touching color (#00cc44)?> then\n                    change y by (1)\n                    if <touching color (#00cc44)?> then\n                        change y by (1)\n                        if <touching color (#00cc44)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-5]\n                                else\n                                    set [xv v] to [5]\n                                end\n                                set [yv v] to [10]\n                            else\n                                set [xv v] to [0]\n                            end\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 color (#00cc44)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#00cc44)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [yv v] to [15]\n        end\n    end\n    change y by (1)\nend\n\nwhen backdrop switches to [level 47 v]\nrepeat until <touching (diamond v)?>\n    if <touching color (#ffcccc)?> then\n        wait (1.5) seconds\n        say [No, the diamond isn't hidden here. Try again.] for (2) seconds\n    end\n    if <touching color (#ffffcc)?> then\n        wait (1.5) seconds\n        say [No, the diamond isn't hidden here. Try again.] for (2) seconds\n    end\n    if <touching color (#ccffdd)?> then\n        wait (1.5) seconds\n        say [Great! You found the hidden diamond! Now collect it!] for (2) seconds\n        broadcast (show v)\n    end\n    if <touching color (#ffe9cc)?> then\n        wait (1.5) seconds\n        say [No, the diamond isn't hidden here. Try again.] for (2) seconds\n    end\n    if <touching color (#ccd8ff)?> then\n        wait (1.5) seconds\n        say [No, the diamond isn't hidden here. Try again.] for (2) seconds\n    end\n    if <touching color (#e5e5e5)?> then\n        wait (1.5) seconds\n        say [No, the diamond isn't hidden here. Try again.] for (2) seconds\n    end\nend\n\nwhen I receive [start v]\ngo to x: (-200) y: (-75)\nforever\n    if <touching (diamond v)?> then\n        go to x: (-200) y: (-75)\n        broadcast (next level v)\n        switch costume to (player v)\n        wait until <not <touching (diamond v)?>>\n    end\nend\n\nwhen flag clicked\nswitch costume to (player v)\nforever\n    if <touching color (#00ff55)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [yv v] to [5]\n        else\n            set [yv v] to [1]\n        end\n        if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n            set [yv v] to [-5]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching color (#ffdf05)?> then\n        switch backdrop to (level 38a v)\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (0)\nforever\n    if <touching color (#ff0000)?> then\n        go to x: (-200) y: (-75)\n        wait until <not <touching color (#ff0000)?>>\n        change [deaths v] by (1)\n        switch costume to (player v)\n    end\nend\n\nwhen flag clicked\nswitch costume to (player v)\nforever\n    if <touching color (#ff00bf)?> then\n        switch costume to (player \(small\) v)\n        wait until <touching (diamond v)?>\n        switch costume to (player v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching color (#0280ff)?> then\n        change [yv v] by (20)\n    end\nend\n\nwhen I receive [start v]\nshow\n\nwhen I receive [menu v]\nhide\nhide variable [level v]\n\nwhen [r v] key pressed\nif <not <(Level) = [52]>> then\n    switch costume to (player v)\n    go to x: (-200) y: (-75)\nend\n\nbroadcast (next level v)\n\n@Diamond\n\nwhen flag clicked\nswitch costume to (1 v)\nforever\n    switch costume to (1 v)\n    wait (0.01) seconds\n    switch costume to (2 v)\n    wait (0.01) seconds\n    switch costume to (3 v)\n    wait (0.01) seconds\n    switch costume to (4 v)\n    wait (0.01) seconds\n    switch costume to (5 v)\n    wait (0.01) seconds\n    switch costume to (6 v)\n    wait (0.01) seconds\n    switch costume to (7 v)\n    wait (0.01) seconds\n    switch costume to (8 v)\n    wait (0.01) seconds\n    switch costume to (7 v)\n    wait (0.01) seconds\n    switch costume to (6 v)\n    wait (0.01) seconds\n    switch costume to (5 v)\n    wait (0.01) seconds\n    switch costume to (4 v)\n    wait (0.01) seconds\n    switch costume to (3 v)\n    wait (0.01) seconds\n    switch costume to (2 v)\n    wait (0.01) seconds\n    switch costume to (1 v)\n    wait (0.01) seconds\nend\n\nwhen flag clicked\nshow\nset size to (73) %\ngo to x: (222) y: (-98)\n\nwhen backdrop switches to [level 5 v]\ngo to x: (222) y: (-98)\n\nwhen backdrop switches to [level 6 v]\ngo to x: (-36) y: (65)\n\nwhen backdrop switches to [level 7 v]\ngo to x: (221) y: (-52)\n\nwhen backdrop switches to [level 8 v]\ngo to x: (221) y: (-52)\n\nwhen backdrop switches to [level 9 v]\ngo to x: (221) y: (-52)\n\nwhen backdrop switches to [level 10 v]\ngo to x: (221) y: (-52)\n\nwhen backdrop switches to [level 11 v]\ngo to x: (221) y: (-52)\n\nwhen backdrop switches to [level 12 v]\ngo to x: (180) y: (129)\n\nwhen backdrop switches to [level 13 v]\ngo to x: (-217) y: (140)\n\nwhen backdrop switches to [level 14 v]\ngo to x: (-221) y: (156)\n\nwhen backdrop switches to [level 15 v]\ngo to x: (201) y: (-55)\n\nwhen backdrop switches to [level 16 v]\ngo to x: (-213) y: (158)\n\nwhen backdrop switches to [level 17 v]\ngo to x: (229) y: (153)\n\nwhen backdrop switches to [level 18 v]\ngo to x: (-223) y: (131)\n\nwhen backdrop switches to [level 19 v]\ngo to x: (-213) y: (120)\n\nwhen backdrop switches to [level 20 v]\ngo to x: (0) y: (85)\n\nwhen backdrop switches to [level 21 v]\ngo to x: (222) y: (123)\n\nwhen backdrop switches to [level 22 v]\ngo to x: (224) y: (-104)\n\nwhen backdrop switches to [level 23 v]\ngo to x: (127) y: (-115)\n\nwhen backdrop switches to [level 24 v]\ngo to x: (150) y: (-117)\n\nwhen backdrop switches to [level 25 v]\ngo to x: (-202) y: (115)\n\nwhen backdrop switches to [level 26 v]\ngo to x: (-46) y: (108)\n\nwhen backdrop switches to [level 27 v]\ngo to x: (206) y: (-42)\n\nwhen backdrop switches to [level 28 v]\ngo to x: (221) y: (144)\n\nwhen backdrop switches to [level 29 v]\ngo to x: (224) y: (-64)\n\nwhen backdrop switches to [level 30 v]\ngo to x: (220) y: (79)\n\nwhen backdrop switches to [level 31 v]\ngo to x: (212) y: (-156)\n\nwhen backdrop switches to [level 32 v]\ngo to x: (-96) y: (-61)\n\nwhen backdrop switches to [level 33 v]\ngo to x: (-218) y: (-161)\n\nwhen backdrop switches to [level 34 v]\ngo to x: (226) y: (128)\n\nwhen backdrop switches to [level 35 v]\ngo to x: (-190) y: (140)\n\nwhen backdrop switches to [level 36 v]\ngo to x: (35) y: (160)\n\nwhen backdrop switches to [level 37 v]\ngo to x: (161) y: (-75)\n\nwhen backdrop switches to [level 38 v]\nhide\ngo to x: (3) y: (-94)\n\nwhen backdrop switches to [level 38a v]\nshow\ngo to x: (3) y: (-94)\n\nwhen backdrop switches to [level 39 v]\ngo to x: (229) y: (-114)\n\nwhen backdrop switches to [level 40 v]\ngo to x: (56) y: (-104)\n\nwhen backdrop switches to [level 41 v]\ngo to x: (222) y: (120)\n\nwhen backdrop switches to [level 42 v]\ngo to x: (22) y: (71)\n\nwhen backdrop switches to [level 43 v]\ngo to x: (220) y: (135)\n\nwhen backdrop switches to [level 44 v]\ngo to x: (46) y: (6)\n\nwhen backdrop switches to [level 45 v]\ngo to x: (-146) y: (120)\n\nwhen backdrop switches to [level 46 v]\ngo to x: (147) y: (-112)\n\nwhen backdrop switches to [level 47 v]\nhide\ngo to x: (153) y: (-113)\n\nwhen backdrop switches to [level 48 v]\ngo to x: (93) y: (-1)\n\nwhen backdrop switches to [level 50 v]\ngo to x: (-219) y: (147)\n\nwhen backdrop switches to [level 4 v]\ngo to x: (222) y: (-98)\n\nwhen backdrop switches to [the end v]\nhide\n\nwhen backdrop switches to [level 2 v]\ngo to x: (222) y: (-98)\n\nwhen backdrop switches to [level 3 v]\ngo to x: (222) y: (-98)\n\nwhen backdrop switches to [level 49 v]\ngo to x: (222) y: (-98)\n\nwhen backdrop switches to [level 51 v]\nset size to (250) %\ngo to x: (180) y: (-50)\n\nwhen I receive [show v]\nshow\n\nwhen I receive [menu v]\nhide\nhide variable [level v]\n\nwhen I receive [start v]\nshow\n\n@Play\n\nwhen flag clicked\nshow\ngo to x: (-61) y: (-50)\ngo [backward v] (5000) layers\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (hover v)\n    else\n        switch costume to (default v)\n    end\nend\n\nwhen this sprite clicked\nstart sound [click v]\nbroadcast (start v)\n\nwhen I receive [menu v]\nshow\n\nwhen I receive [story v]\nhide\n\nwhen I receive [start v]\nhide\n\nwhen I receive [story v]\nhide\n\n@Story\n\nwhen flag clicked\nshow\ngo to x: (103) y: (-50)\ngo [backward v] (5000) layers\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (hover v)\n    else\n        switch costume to (default v)\n    end\nend\n\nwhen I receive [menu v]\nshow\n\nwhen this sprite clicked\nstart sound [click v]\nbroadcast (Story v)\n\nwhen I receive [story v]\nhide\n\nwhen I receive [start v]\nhide\n\n@Back\n\nwhen flag clicked\nhide\ngo to x: (205) y: (-170)\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (hover v)\n    else\n        switch costume to (default v)\n    end\nend\n\nwhen I receive [menu v]\nhide\n\nwhen this sprite clicked\nstart sound [click v]\nbroadcast (menu v)\n\nwhen I receive [story v]\nshow\n\n@50-Level Platformer\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\nset [ghost v] effect to (0)\nwait (1.5) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nset [ghost v] effect to (100)\nhide\n\n@Text\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nshow\n\n