Teamwork platformer

Instructions: R to restart\nM to toggle music\n\n1 and 2 to toggle whether you can see how many times you've died\n\nWhen on the boss level jump on it's health bar(the pink thing) to attack it\n\nTo flip the switch at the start of the level, only orangey can do it \n\nPlayer 1:\njump=up arrow or space\nleft=left arrow\nright=right arrow\n\nplayer 2:\njump=w\nleft=a\nright=d

@Stage\n\nset [bosshp v] to [0]\n\n@bluey\n\nwhen flag clicked\nforever\n    if <key (r v) pressed?> then\n        go to x: (start point x) y: (start point y)\n        set [blueonportal? v] to [0]\n        set [orangeonportal? v] to [0]\n        set [bluetouchswitch? v] to [0]\n        set [orangetouchswitch? v] to [0]\n        set [switchon? v] to [0]\n        set [purple button pressed v] to [0]\n    end\nend\n\nwhen flag clicked\nset drag mode [not draggable v]\nswitch backdrop to (backdrop1 v)\nset [combined deaths v] to [0]\nset [blue deaths v] to [0]\nset [orangeonportal? v] to [0]\nset [blueonportal? v] to [0]\nset [orange deaths v] to [0]\nset [switchon? v] to [0]\nset [orangetouchswitch? v] to [0]\nset [bluetouchswitch? v] to [0]\nhide variable [orange deaths v]\nhide variable [blue deaths v]\nhide variable [level v]\nset [orange deaths v] to [0]\nhide variable [combined deaths v]\nshow\npoint in direction (90)\nset [yv v] to [0]\nset [xv v] to [0]\nset [level v] to [1]\nset [start point y v] to [20]\nset [start point x v] to [-100]\nshow variable [level v]\nset [xv v] to ((xv) * (0.9))\ngo to x: (start point x) y: (start point y)\nforever\n    change [yv v] by (-1)\n    if <<<(level) = [23]> or <(level) = [24]>> or <(level) = [25]>> then\n        hide variable [level v]\n    else\n        show variable [level v]\n    end\n    if <key (left arrow v) pressed?> then\n        change [xv v] by (-2.25)\n    end\n    if <key (right arrow v) pressed?> then\n        change [xv v] by (2.25)\n    end\n    set [xv v] to ((xv) * (0.7))\n    change x by (xv)\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 x by ((xv) * (-1))\n                            change x by (1)\n                            change y by (-5)\n                            change x by (-1)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (yv)\n    if <touching color (#000000)?> then\n        change y by ((yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching color (#000000)?> and <<key (space v) pressed?> or <key (up arrow v) pressed?>>> then\n        set [yv v] to [15]\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nforever\n    if <<touching color (#ffde00)?> or <touching color (#ffe800)?>> then\n        set [blueonportal? v] to [1]\n    end\n    if <<(blueonportal?) = [1]> and <(orangeonportal?) = [1]>> then\n        go to x: (start point x) y: (start point y)\n        change [level v] by (1)\n        switch backdrop to (next backdrop v)\n        wait (0.001) seconds\n        set [blueonportal? v] to [0]\n        set [orangeonportal? v] to [0]\n        set [xv v] to [0]\n        set [yv v] to [0]\n        set [orangeyv v] to [0]\n        set [orangexv v] to [0]\n        set [orangetouchswitch? v] to [0]\n        set [bluetouchswitch? v] to [0]\n        set [switchon? v] to [0]\n    end\n    if <touching color (#00ffff)?> then\n        set [yv v] to [21]\n        start sound [boing v]\n    end\n    if <touching color (#ff0000)?> then\n        change [combined deaths v] by (1)\n        change [blue deaths v] by (1)\n        go to x: (start point x) y: (start point y)\n        start sound [pop v]\n        set [blueonportal? v] to [0]\n        set [orangeonportal? v] to [0]\n    end\n    if <key (1 v) pressed?> then\n        show variable [orange deaths v]\n        show variable [blue deaths v]\n        show variable [combined deaths v]\n    end\n    if <key (2 v) pressed?> then\n        hide variable [blue deaths v]\n        hide variable [orange deaths v]\n        hide variable [combined deaths v]\n    end\n    if <touching (switch v)?> then\n        set [bluetouchswitch? v] to [1]\n        set [orangetouchswitch? v] to [0]\n    end\nend\n\nwhen flag clicked\nforever\n    show variable [level v]\nend\n\nset [level v] to [29]\n\nwhen flag clicked\nforever\n    if <key (s v) pressed?> then\n        set [level v] to [1]\n        switch backdrop to (next backdrop v)\n    end\nend\n\n@orangey\n\nwhen flag clicked\nforever\n    if <key (r v) pressed?> then\n        go to x: (orange start x) y: (orange start y)\n    end\nend\n\nwhen flag clicked\nset drag mode [not draggable v]\nset [orangeyv v] to [0]\nset [orangexv v] to [0]\nset [orange start x v] to [-130]\nset [orange start y v] to [-20]\nshow\npoint in direction (90)\nset [orangexv v] to ((orangexv) * (0.9))\ngo to x: (orange start x) y: (orange start y)\nforever\n    change [orangeyv v] by (-1)\n    if <key (a v) pressed?> then\n        change [orangexv v] by (-2.25)\n    end\n    if <key (d v) pressed?> then\n        change [orangexv v] by (2.25)\n    end\n    set [orangexv v] to ((orangexv) * (0.7))\n    change x by (orangexv)\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 x by ((orangexv) * (-1))\n                            change x by (1)\n                            change y by (-5)\n                            change x by (-1)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (orangeyv)\n    if <touching color (#000000)?> then\n        change y by ((orangeyv) * (-1))\n        set [orangeyv v] to [0]\n    end\n    change y by (-1)\n    if <<touching color (#000000)?> and <key (w v) pressed?>> then\n        set [orangeyv v] to [15]\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nforever\n    if <<touching color (#ffde00)?> or <touching color (#ffe800)?>> then\n        set [orangeonportal? v] to [1]\n    end\n    if <<(blueonportal?) = [1]> and <(orangeonportal?) = [1]>> then\n        go to x: (orange start x) y: (orange start y)\n        wait (0.001) seconds\n        set [xv v] to [0]\n        set [yv v] to [0]\n        set [bluetouchswitch? v] to [0]\n        set [orangetouchswitch? v] to [0]\n        set [blueonportal? v] to [0]\n        set [orangeonportal? v] to [0]\n        set [orangexv v] to [0]\n        set [orangeyv v] to [0]\n    end\n    if <touching color (#00ffff)?> then\n        set [orangeyv v] to [21]\n        start sound [boing v]\n    end\n    if <touching color (#ff0000)?> then\n        change [combined deaths v] by (1)\n        change [orange deaths v] by (1)\n        go to x: (orange start x) y: (orange start y)\n        start sound [pop v]\n        set [orangeonportal? v] to [0]\n        set [blueonportal? v] to [0]\n    end\n    if <touching (switch v)?> then\n        set [orangetouchswitch? v] to [1]\n        set [bluetouchswitch? v] to [0]\n    end\n    if <<not <touching (switch v)?>> and <(orangetouchswitch?) = [1]>> then\n        set [orangetouchswitch? v] to [1]\n        set [bluetouchswitch? v] to [0]\n    end\nend\n\ngo to x: (-50) y: (0)\n\n@switch\n\nwhen flag clicked\nforever\n    hide\n    switch costume to (costume1 v)\n    if <(level) = [10]> then\n        show\n        go to x: (-40) y: (-10)\n    end\n    if <(level) = [11]> then\n        show\n        go to x: (-60) y: (-40)\n    end\n    if <<(level) = [14]> and <(purple button pressed) = [1]>> then\n        show\n        go to x: (-60) y: (-40)\n    end\n    if <(level) = [15]> then\n        show\n        go to x: (-125) y: (75)\n    end\n    if <(level) = [18]> then\n        show\n        go to x: (125) y: (203)\n    end\n    if <(level) = [19]> then\n        show\n        go to x: (-130) y: (250)\n        if <(switchon?) = [1]> then\n            hide\n        end\n    end\n    if <(level) = [27]> then\n        show\n        go to x: (90) y: (250)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(switchon?) = [1]> then\n        switch costume to (costume2 v)\n    end\n    if <(switchon?) = [0]> then\n        switch costume to (costume1 v)\n    end\nend\n\nset [level v] to [11]\n\nif <(level) = [26]> then\n    show\n    go to x: (90) y: (250)\nend\n\nwhen flag clicked\nforever\n    if <<(switchon?) = [1]> and <(bluetouchswitch?) = [1]>> then\n        set [switchon? v] to [1]\n    end\n    if <<(switchon?) = [1]> and <(bluetouchswitch?) = [0]>> then\n        set [switchon? v] to [0]\n    end\n    if <<(switchon?) = [0]> and <(bluetouchswitch?) = [1]>> then\n        set [switchon? v] to [1]\n    end\n    if <<<(switchon?) = [0]> and <(bluetouchswitch?) = [0]>> and <(orangetouchswitch?) = [1]>> then\n        set [switchon? v] to [1]\n    else\n        set [switchon? v] to [0]\n    end\nend\n\n@button1\n\nwhen flag clicked\nforever\n    set size to (100) %\n    set [purple button pressed v] to [0]\n    hide\n    if <(level) = [3]> then\n        show\n        set size to (120) %\n        go to x: (110) y: (-45)\n        if <touching (orangey v)?> then\n            set [purple button pressed v] to [1]\n        end\n        if <touching (bluey v)?> then\n            set [purple button pressed v] to [1]\n        end\n    end\n    if <(level) = [4]> then\n        show\n        go to x: (-90) y: (100)\n        if <touching (orangey v)?> then\n            set [purple button pressed v] to [1]\n        end\n        if <touching (bluey v)?> then\n            set [purple button pressed v] to [1]\n        end\n    end\n    if <(level) = [7]> then\n        show\n        go to x: (80) y: (70)\n        if <touching (orangey v)?> then\n            set [purple button pressed v] to [1]\n        end\n        if <touching (bluey v)?> then\n            set [purple button pressed v] to [1]\n        end\n    end\n    if <(level) = [8]> then\n        show\n        go to x: (220) y: (-20)\n        if <touching (orangey v)?> then\n            set [purple button pressed v] to [1]\n        end\n        if <touching (bluey v)?> then\n            set [purple button pressed v] to [1]\n        end\n    end\n    if <(level) = [9]> then\n        show\n        go to x: (70) y: (130)\n        if <touching (orangey v)?> then\n            set [purple button pressed v] to [1]\n        end\n        if <touching (bluey v)?> then\n            set [purple button pressed v] to [1]\n        end\n    end\n    if <(level) = [13]> then\n        show\n        go to x: (-40) y: (-145)\n        if <touching (orangey v)?> then\n            set [purple button pressed v] to [1]\n        end\n        if <touching (bluey v)?> then\n            set [purple button pressed v] to [1]\n        end\n    end\n    if <(level) = [14]> then\n        show\n        go to x: (-120) y: (-145)\n        if <touching (orangey v)?> then\n            set [purple button pressed v] to [1]\n        end\n        if <touching (bluey v)?> then\n            set [purple button pressed v] to [1]\n        end\n    end\n    if <<(level) = [15]> and <(switchon?) = [1]>> then\n        show\n        go to x: (150) y: (-100)\n        set size to (140) %\n        if <touching (orangey v)?> then\n            set [purple button pressed v] to [1]\n        end\n        if <touching (bluey v)?> then\n            set [purple button pressed v] to [1]\n        end\n    end\n    if <(level) = [16]> then\n        show\n        go to x: (-200) y: (22)\n        set size to (100) %\n        if <touching (orangey v)?> then\n            set [purple button pressed v] to [1]\n        end\n        if <touching (bluey v)?> then\n            set [purple button pressed v] to [1]\n        end\n    end\n    if <(level) = [26]> then\n        show\n        go to x: (150) y: (-120)\n        set size to (100) %\n        if <touching (orangey v)?> then\n            set [purple button pressed v] to [1]\n        end\n        if <touching (bluey v)?> then\n            set [purple button pressed v] to [1]\n        end\n    end\nend\n\nif <(level) = [28]> then\n    show\n    go to x: (200) y: (-13)\n    set size to (100) %\n    if <touching (orangey v)?> then\n        set [purple button pressed v] to [1]\n    end\n    if <touching (bluey v)?> then\n        set [purple button pressed v] to [1]\n    end\nend\n\n@button2\n\nwhen flag clicked\nforever\n    hide\n    if <(level) = [8]> then\n        show\n        go to x: (40) y: (115)\n        if <touching (bluey v)?> then\n            set [purple button pressed v] to [1]\n        end\n        if <touching (orangey v)?> then\n            set [purple button pressed v] to [1]\n        end\n    end\nend\n\n@music\n\nwhen [m v] key pressed\nif <(music) = [on]> then\n    stop all sounds\n    set [music v] to [off]\nelse\n    if <not <(level) = [30]>> then\n        set [music v] to [on]\n        start sound [Spektrem - Shine _NCS Release_ v]\n    end\nend\n\nwhen flag clicked\nset [music v] to [on]\nstart sound [Spektrem - Shine _NCS Release_ v]\n\nwhen flag clicked\nif <<(music) = [off]> and <key (m v) pressed?>> then\n    set [music v] to [on]\nend\n\nstop all sounds\n\n@obj1\n\nwhen flag clicked\nforever\n    hide\n    if <<(level) = [3]> and <(purple button pressed) = [1]>> then\n        show\n        go to x: (0) y: (-120)\n    end\n    if <<(level) = [10]> and <(switchon?) = [1]>> then\n        show\n        go to x: (0) y: (-110)\n    end\n    if <<(level) = [14]> and <(switchon?) = [1]>> then\n        show\n        go to x: (50) y: (-140)\n    end\n    if <<(level) = [16]> and <(purple button pressed) = [1]>> then\n        set size to (100) %\n        show\n        go to x: (-100) y: (-140)\n    end\n    if <(level) = [24]> then\n        set size to (50) %\n        show\n        go to x: (-40) y: (-140)\n        forever\n            if <(level) = [24]> then\n                forever\n                    change x by (5)\n                    if <touching (_edge_ v)?> then\n                        go to x: (-40) y: (-140)\n                    end\n                end\n            end\n        end\n    end\nend\n\nchange [yv v] by (-10)\n\nset [level v] to [24]\n\nif <<touching color (#fe0000)?> and <(blockonedge) = [1]>> then\n    set [blockonedge v] to [0]\n    forever\n        change x by (10)\n    end\nend\n\nforever\n    change x by (-10)\nend\n\nif <(level) = [24]> then\n\nwhen flag clicked\n\nwhen flag clicked\nforever\n    if <(level) = [25]> then\n        forever\n            hide\n        end\n    end\nend\n\nset [blockonedge v] to [0]\n\nwhen flag clicked\n\nforever\n\nset [blockonedge v] to [1]\n\n@obj2\n\nwhen flag clicked\nforever\n    hide\n    if <<(level) = [4]> and <(purple button pressed) = [1]>> then\n        show\n        go to x: (-76) y: (33)\n    end\nend\n\n@obj3\n\nwhen flag clicked\nforever\n    hide\n    if <<(level) = [7]> and <(purple button pressed) = [1]>> then\n        show\n        go to x: (195) y: (80)\n    end\nend\n\n@obj4\n\nwhen flag clicked\nforever\n    hide\n    if <<(level) = [8]> and <(purple button pressed) = [1]>> then\n        show\n        go to x: (65) y: (-60)\n    end\nend\n\n@obj5\n\nwhen flag clicked\nforever\n    hide\n    if <<(level) = [9]> and <(purple button pressed) = [1]>> then\n        show\n        go to x: (35) y: (60)\n    end\nend\n\n@obj6\n\nwhen flag clicked\nforever\n    hide\n    if <<(level) = [13]> and <(purple button pressed) = [1]>> then\n        show\n        go to x: (0) y: (0)\n        wait (2) seconds\n    end\nend\n\n@obj7\n\nwhen flag clicked\nforever\n    hide\n    if <<(level) = [11]> and <(switchon?) = [1]>> then\n        show\n        go to x: (55) y: (-60)\n    end\nend\n\n@obj8\n\nwhen flag clicked\nforever\n    hide\n    if <(level) = [15]> then\n        show\n        go to x: (37) y: (25)\n    end\n    if <<<(level) = [15]> and <(purple button pressed) = [0]>> and <(switchon?) = [1]>> then\n        show\n        forever\n            if <(switchon?) = [0]> then\n                go to x: (37) y: (25)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nif <not <key (r v) pressed?>> then\n    forever\n        if <<<(level) = [15]> and <(purple button pressed) = [0]>> and <(switchon?) = [1]>> then\n            change y by (-2)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(level) = [15]>> then\n        hide\n    end\nend\n\n@obj9\n\nwhen flag clicked\nforever\n    hide\n    if <<(level) = [15]> and <(purple button pressed) = [1]>> then\n        show\n        go to x: (36) y: (28)\n    end\nend\n\n@obj11\n\nwhen flag clicked\nforever\n    hide\n    if <<(level) = [18]> and <(switchon?) = [1]>> then\n        show\n        go to x: (36) y: (30)\n        go to [back v] layer\n    end\nend\n\n@obj12\n\nwhen flag clicked\nforever\n    hide\n    if <<(level) = [19]> and <(switchon?) = [1]>> then\n        show\n        go to x: (-120) y: (0)\n        go to [back v] layer\n    end\nend\n\n@obj13\n\nwhen flag clicked\nforever\n    hide\n    if <(level) = [20]> then\n        show\n        set [laserbruh v] to (pick random (1) to (2))\n        if <(laserbruh) = [1]> then\n            go to x: (36) y: (28)\n            switch costume to (pick random (1) to (5))\n            point in direction (90)\n            wait (1.5) seconds\n        end\n        if <(laserbruh) = [2]> then\n            go to x: (36) y: (68)\n            switch costume to (pick random (1) to (5))\n            point in direction (0)\n            wait (1.5) seconds\n        end\n    end\nend\n\n@turnsyle1\n\nwhen flag clicked\nforever\n    if <(level) = [23]> then\n        show\n        go to x: (-100) y: (-25)\n        set size to (90) %\n        turn right (5) degrees\n    else\n        hide\n    end\nend\n\n@turnsyle2\n\nwhen flag clicked\nforever\n    if <(level) = [23]> then\n        show\n        go to x: (100) y: (-25)\n        set size to (90) %\n        turn right (5) degrees\n    else\n        hide\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\nforever\n    hide\n    if <<(level) = [27]> and <(switchon?) = [1]>> then\n        show\n        go to x: (250) y: (20)\n        go to [back v] layer\n    end\nend\n\n@Sprite3\n\nwhen flag clicked\nforever\n    hide\n    if <<(level) = [26]> and <(purple button pressed) = [1]>> then\n        show\n        go to x: (210) y: (40)\n        go to [back v] layer\n    end\nend\n\n@Sprite6\n\n@Sprite7\n\nwhen flag clicked\n\nwhen flag clicked\nforever\n    hide\n    if <<(level) = [29]> and <(Bossattack2:\)) = [1]>> then\n        show\n        go to x: (bossx) y: (bossy)\n        switch costume to (costume1 v)\n        wait (2) seconds\n        switch costume to (costume2 v)\n        wait (2) seconds\n        switch costume to (costume3 v)\n        wait (2) seconds\n        switch costume to (costume4 v)\n        wait (2) seconds\n        set [bossattack2:\) v] to [0]\n        set [bossattack v] to (pick random (1) to (5))\n    end\nend\n\n@Sprite8\n\nwhen flag clicked\nforever\n    hide\n    if <<(level) = [29]> and <(bossattack4:\)) = [1]>> then\n        show\n        go to x: (bossx) y: (bossy)\n        switch costume to (costume1 v)\n        wait (0.2) seconds\n        switch costume to (costume2 v)\n        wait (0.2) seconds\n        switch costume to (costume3 v)\n        wait (0.2) seconds\n        switch costume to (costume4 v)\n        wait (0.2) seconds\n        switch costume to (costume5 v)\n        wait (0.2) seconds\n        switch costume to (costume6 v)\n        wait (0.2) seconds\n        switch costume to (costume7 v)\n        wait (0.2) seconds\n        switch costume to (costume8 v)\n        wait (0.2) seconds\n        switch costume to (costume9 v)\n        wait (0.2) seconds\n        switch costume to (costume10 v)\n        wait (0.2) seconds\n        switch costume to (costume11 v)\n        wait (0.2) seconds\n        switch costume to (costume12 v)\n        wait (0.2) seconds\n        switch costume to (costume13 v)\n        wait (0.2) seconds\n        switch costume to (costume14 v)\n        wait (0.2) seconds\n        switch costume to (costume15 v)\n        wait (0.2) seconds\n        switch costume to (costume16 v)\n        wait (0.2) seconds\n        switch costume to (costume17 v)\n        wait (0.2) seconds\n        switch costume to (costume18 v)\n        wait (0.2) seconds\n        set [bossattack4:\) v] to [0]\n        set [bossattack v] to (pick random (1) to (5))\n    end\nend\n\n@Sprite9\n\nwhen flag clicked\nset [bossattack5:\) v] to [0]\nforever\n    go to x: (bossx) y: (bossy)\n    hide\n    if <<(level) = [29]> and <(bossattack5:\)) = [1]>> then\n        go to [front v] layer\n        show\n        switch costume to (costume1 v)\n        wait (1) seconds\n        switch costume to (costume2 v)\n        wait (1) seconds\n        switch costume to (costume3 v)\n        wait (1) seconds\n        switch costume to (costume4 v)\n        wait (1) seconds\n        set [bossattack v] to (pick random (1) to (5))\n        set [bossattack5:\) v] to [0]\n    end\nend\n\n@Sprite10\n\nwhen flag clicked\nforever\n    if <(level) = [24]> then\n        go to x: (-60) y: (-150)\n    end\nend\n\n@Sprite11\n\nwhen flag clicked\nset size to (100) %\ngo to [back v] layer\nset [bossyv v] to [0]\nset [bossattack2:\) v] to [0]\ngo to x: (0) y: (0)\nset [bossattack4:\) v] to [0]\nforever\n    hide\n    if <(level) = [29]> then\n        switch costume to (costume1 v)\n        show\n        set [bossattack v] to (pick random (1) to (5))\n        wait (5) seconds\n    end\n    if <(bossattack) = [1]> then\n        change x by (50)\n        change y by (35)\n        wait (0.25) seconds\n        change x by (-50)\n        change y by (35)\n        wait (0.25) seconds\n        change x by (-50)\n        change y by (35)\n        wait (0.25) seconds\n        change x by (50)\n        change y by (35)\n        wait (0.25) seconds\n        set [bossattack v] to (pick random (1) to (5))\n    end\n    if <(bossattack) = [2]> then\n        set [bossattack2:\) v] to [1]\n    end\n    if <(bossattack) = [3]> then\n        repeat (10)\n            change size by (8)\n            wait (0.15) seconds\n        end\n        repeat (10)\n            change size by (-8)\n            wait (0.15) seconds\n        end\n    end\n    if <(bossattack) = [4]> then\n        set [bossattack4:\) v] to [1]\n    end\n    if <(bossattack) = [5]> then\n        set [bossattack5:\) v] to [1]\n    end\n    if <(bosshp) = [0]> then\n        switch costume to (dd28a9cc255253f2aa3a0fe9f825455a v)\n        play sound [Teleport v] until done\n        wait (2) seconds\n        forever\n            switch costume to (costume2 v)\n            if <(level) = [30]> then\n                hide\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    set [bossx v] to (x position)\n    set [bossy v] to (y position)\nend\n\nwhen flag clicked\nforever\n    change y by (bossyv)\n    if <touching color (#000000)?> then\n        set [bossyv v] to [10]\n    end\nend\n\nwhen flag clicked\nforever\n    change y by (-10)\nend\n\nwhen flag clicked\nforever\n    if <not <(bossattack) = [1]>> then\n        change [bossyv v] by (-1)\n        if <touching color (#000000)?> then\n            change y by (1.5)\n        end\n    end\nend\n\nset [level v] to [29]\n\nwait (111111111111111111111111111) seconds\n\nset [bosshp v] to [12]\n\nswitch costume to (costume1 v)\n\n@Sprite1\n\nwhen flag clicked\nhide\nset [bosshp v] to [12]\nhide variable [bosshp v]\nforever\n    hide\n    if <(level) = [29]> then\n        show\n        show variable [bosshp v]\n        go to x: ((bossx) + (-220)) y: ((bossy) + (180))\n        go to [front v] layer\n    end\n    if <touching (bluey v)?> then\n        set [yv v] to [5]\n        set [yv v] to [75]\n        change [bosshp v] by (-1)\n    end\n    if <touching (orangey v)?> then\n        set [orangeyv v] to [5]\n        set [orangeyv v] to [75]\n        change [bosshp v] by (-1)\n    end\n    if <(bosshp) = [12]> then\n        switch costume to (costume9 v)\n    end\n    if <(bosshp) = [11]> then\n        switch costume to (costume12 v)\n    end\n    if <(bosshp) = [10]> then\n        switch costume to (costume11 v)\n    end\n    if <(bosshp) = [9]> then\n        switch costume to (costume10 v)\n    end\n    if <(bosshp) = [8]> then\n        switch costume to (costume1 v)\n    end\n    if <(bosshp) = [7]> then\n        switch costume to (costume2 v)\n    end\n    if <(bosshp) = [6]> then\n        switch costume to (costume3 v)\n    end\n    if <(bosshp) = [5]> then\n        switch costume to (costume4 v)\n    end\n    if <(bosshp) = [4]> then\n        switch costume to (costume5 v)\n    end\n    if <(bosshp) = [3]> then\n        switch costume to (costume6 v)\n    end\n    if <(bosshp) = [2]> then\n        switch costume to (costume7 v)\n    end\n    if <(bosshp) = [1]> then\n        switch costume to (costume8 v)\n    end\n    if <(bosshp) = [0]> then\n        hide\n    end\nend\n\nset [level v] to [29]\n\n@Sprite4\n\n