Trolled! - A Platformer [Mobile]
@Stage\n\nwhen flag clicked\nwait (12.5) seconds\nif <(Level) = [1]> then\n    repeat until <(Level) = [2]>\n        play sound [09 Grass Land 1 v] until done\n        wait (1) seconds\n    end\nend\nif <(Level) = [2]> then\n    repeat until <(Level) = [3]>\n        play sound [12 Grass Land 4 v] until done\n        wait (1) seconds\n    end\nend\nif <(Level) = [3]> then\n    repeat until <(Level) = [4]>\n        play sound [11 Grass Land 3 v] until done\n        wait (1) seconds\n    end\nend\nif <(Level) = [4]> then\n    repeat until <(Level) = [5]>\n        play sound [43 Staff Roll v] until done\n        wait (5) seconds\n    end\nend\n\nwhen flag clicked\nset volume to (100) %\nwait (12.5) seconds\nwait until <(DoorsPassed) = [3]>\nrepeat (20)\n    change volume by (-5)\nend\nwait (3) seconds\nstop all sounds\nwait (0) seconds\nset volume to (100) %\nwait until <(DoorsPassed) = [6]>\nrepeat (20)\n    change volume by (-5)\nend\nwait (3) seconds\nstop all sounds\nwait (0) seconds\nset volume to (100) %\nwait until <(DoorsPassed) = [9]>\nrepeat (20)\n    change volume by (-5)\nend\nwait (2) seconds\nstop all sounds\nwait (0) seconds\nset volume to (100) %\n\nwhen I receive [fademusic v]\nrepeat (20)\n    change volume by (-5)\nend\nwait (3) seconds\nstop all sounds\nwait (0) seconds\nset volume to (100) %\n\n@Blank\n\n@Kirby\n\nwhen I receive [third v]\nif <(Level) < [4]> then\n    show\n    PlayerMovementScript\n    GeneralPlayerScript\n    if <(Dead) = [0]> then\n        if <(y position) < [-173]> then\n            set [health v] to [0]\n            broadcast (Death v)\n        end\n    end\n    if <(Crouching) = [1]> then\n        switch costume to (bottom v)\n    else\n        switch costume to (fullhitbox v)\n    end\n    broadcast (Fourth v)\nend\n\nwhen I receive [costuming v]\nif <not <(Dead) = [0]>> then\n    if <(Dead) = [2]> then\n        switch costume to ((([floor v] of ((Global#) * (32)) ) mod (4)) + (84))\n    else\n        switch costume to (84 v)\n    end\n    if <(y position) < [-175]> then\n        hide\n    end\nelse\n    if <<(DoorCooldown) > [6]> or <<(DoorCooldown) > [0]> and <((DoorsPassed) mod (3)) = [0]>>> then\n        if <((DoorsPassed) mod (3)) = [0]> then\n            switch costume to (48 v)\n            if <(DoorCooldown) > [3.2]> then\n                switch costume to (47 v)\n                if <(DoorCooldown) > [3.8]> then\n                    switch costume to (46 v)\n                    if <(DoorCooldown) > [4.4]> then\n                        switch costume to (45 v)\n                        if <(DoorCooldown) > [5]> then\n                            switch costume to (70 v)\n                            if <(DoorCooldown) > [9.8]> then\n                                switch costume to (48 v)\n                                if <(DoorCooldown) > [13.4]> then\n                                    switch costume to (47 v)\n                                    if <(DoorCooldown) > [14]> then\n                                        switch costume to (46 v)\n                                        if <(DoorCooldown) > [14.6]> then\n                                            switch costume to (45 v)\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        else\n            switch costume to (48 v)\n            if <(DoorCooldown) > [13.4]> then\n                switch costume to (47 v)\n                if <(DoorCooldown) > [14]> then\n                    switch costume to (46 v)\n                    if <(DoorCooldown) > [14.6]> then\n                        switch costume to (45 v)\n                    end\n                end\n            end\n        end\n    else\n        if <not <(AbilityUse) = [0]>> then\n            if <(Ability) = [Cutter]> then\n                CutterCostumes\n            else\n                if <(Ability) = [Burning]> then\n                    BurningCostumes\n                else\n                    if <(Ability) = [Spark]> then\n                        SparkCostumes\n                    else\n                        if <(Ability) = [Spike]> then\n                            SpikeCostumes\n                        else\n                            if <(Ability) = [Clean]> then\n                                CleanCostumes\n                            end\n                        end\n                    end\n                end\n            end\n        else\n            if <not <(Shooting) = [0]>> then\n                if <(Shooting) > [0.6]> then\n                    switch costume to (29 v)\n                else\n                    if <(Shooting) > [0.3]> then\n                        switch costume to (28 v)\n                    else\n                        switch costume to (27 v)\n                    end\n                end\n                change [shooting v] by (-0.1)\n                if <(Shooting) < [0]> then\n                    set [shooting v] to [0]\n                end\n            else\n                if <(Holding) = [1]> then\n                    if <not <<(YVel) = [0]> or <<(YVel) = ((Gravity) / (6.1))> or <(YVel) = ((Gravity) / (3.05))>>>> then\n                        if <(YVel) > [4]> then\n                            switch costume to (41 v)\n                        else\n                            if <(YVel) > [0]> then\n                                switch costume to (42 v)\n                            else\n                                switch costume to (43 v)\n                            end\n                        end\n                    else\n                        if <not <(Jumping) = [0]>> then\n                            switch costume to (44 v)\n                            change [jumping v] by (0.2)\n                            if <(Jumping) > [1]> then\n                                set [jumping v] to [0]\n                            end\n                        else\n                            if <(Turning) = [1]> then\n                                switch costume to (33 v)\n                            else\n                                if <([abs v] of (XVel) ) > [0.1]> then\n                                    switch costume to ((([floor v] of ((Global#) * (24)) ) mod (7)) + (34))\n                                else\n                                    switch costume to ((([floor v] of ((Global#) * (16)) ) mod (3)) + (30))\n                                end\n                            end\n                        end\n                    end\n                else\n                    if <not <(Sucking) = [0]>> then\n                        if <(Sucking) > [0.7]> then\n                            switch costume to (29 v)\n                        else\n                            if <(Sucking) > [0.4]> then\n                                switch costume to (28 v)\n                            else\n                                switch costume to (27 v)\n                            end\n                        end\n                        change [sucking v] by (0.1)\n                        if <(Sucking) > [1]> then\n                            set [sucking v] to [1]\n                            start sound [Inhale2 v]\n                        end\n                    else\n                        if <(Crouching) = [1]> then\n                            switch costume to ((([floor v] of ((Global#) * (24)) ) mod (3)) + (49))\n                        else\n                            if <(Floating) = [1]> then\n                                if <(Turning) = [1]> then\n                                    switch costume to (26 v)\n                                else\n                                    switch costume to ((([floor v] of ((Global#) * (16)) ) mod (5)) + (21))\n                                end\n                            else\n                                if <not <<(YVel) = [0]> or <<(YVel) = ((Gravity) / (6.1))> or <(YVel) = ((Gravity) / (3.05))>>>> then\n                                    if <(YVel) > [4]> then\n                                        switch costume to (17 v)\n                                    else\n                                        if <(YVel) > [0]> then\n                                            switch costume to (18 v)\n                                        else\n                                            if <(YVel) > [-4]> then\n                                                switch costume to (19 v)\n                                            else\n                                                switch costume to (20 v)\n                                            end\n                                        end\n                                    end\n                                else\n                                    if <<<(Jumping) > [0.5]> and <([abs v] of (XVel) ) < [0.1]>> or <<not <(Jumping) = [0]>> and <(Jumping) < [0.51]>>> then\n                                        if <(Jumping) > [0.5]> then\n                                            switch costume to (70 v)\n                                        else\n                                            switch costume to (49 v)\n                                        end\n                                        change [jumping v] by (0.1)\n                                        if <(Jumping) > [2]> then\n                                            set [jumping v] to [0]\n                                        end\n                                    else\n                                        if <(Turning) = [1]> then\n                                            switch costume to (4 v)\n                                        else\n                                            if <([abs v] of (XVel) ) > [0.1]> then\n                                                if <(Running) = [1]> then\n                                                    switch costume to ((([floor v] of ((Global#) * (48)) ) mod (5)) + (12))\n                                                else\n                                                    switch costume to ((([floor v] of ((Global#) * (24)) ) mod (7)) + (5))\n                                                end\n                                            else\n                                                switch costume to ((([floor v] of ((Global#) * (16)) ) mod (3)) + (1))\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine GeneralPlayerScript\nset [playerx v] to ((x position) - (MapX))\nset [playery v] to ((y position) - (MapY))\nchange y by (-1)\n\ndefine PlayerMovementScript\ngo to x: ((MapX) + (PlayerX)) y: ((MapY) + (PlayerY))\nif <(AllowMovement) = [1]> then\n    if <not <<(Ability) = [Burning]> and <not <(AbilityUse) = [0]>>>> then\n        set [turning v] to [0]\n        if <<(AllowJump) = [0]> and <not <key (up arrow v) pressed?>>> then\n            set [allowjump v] to [1]\n        end\n        if <<(AllowShot) = [0]> and <not <key (z v) pressed?>>> then\n            set [allowshot v] to [1]\n        end\n        if <<<<key (up arrow v) pressed?> and <(SpatOut) = [0]>> and <<<<(AllowJump) = [1]> and <(Holding) = [0]>> and <(Sucking) = [0]>> and <(YVel) < [6]>>> and <not <<(YVel) = [0]> or <(YVel) = ((Gravity) / (6.1))>>>> then\n            set [floating v] to [1]\n            set [yvel v] to [9]\n            set [allowjump v] to [0]\n            start sound [Jump v]\n        end\n        if <(Holding) = [1]> then\n            set [floating v] to [0]\n            set [sucking v] to [0]\n        end\n        if <<key (z v) pressed?> and <<(Floating) = [1]> and <(AllowShot) = [1]>>> then\n            AirShot\n            set [allowshot v] to [0]\n            set [floating v] to [0]\n            set [spatout v] to [1]\n        end\n        if <(Floating) = [1]> then\n            change [yvel v] by ((Gravity) / (8.4))\n            if <(YVel) < [-2]> then\n                set [yvel v] to [-2]\n            end\n        else\n            change [yvel v] by ((Gravity) / (6.1))\n            if <<not <key (up arrow v) pressed?>> and <(YVel) > [0]>> then\n                set [yvel v] to ((YVel) / (1.1))\n            end\n            if <(YVel) < [-14]> then\n                set [yvel v] to [-14]\n            end\n        end\n        if <((Gravity) + (YVel)) > [0]> then\n            switch costume to (top v)\n        else\n            switch costume to (bottom v)\n        end\n        change y by ((Gravity) + (YVel))\n        if <<<touching (map v)?> or <touching (blocks v)?>> or <<<touching (semisolids v)?> and <not <<key (down arrow v) pressed?> and <<<(Shooting) = [0]> and <(Floating) = [0]>> and <<(Sucking) = [0]> and <(AbilityUse) = [0]>>>>>> and <not <((Gravity) + (YVel)) > [0]>>>> then\n            if <((Gravity) + (YVel)) > [0]> then\n                FindCeiling\n                set [yvel v] to [-0.1]\n            else\n                change y by (((Gravity) + (YVel)) * (-1))\n                FindFloor\n                if <(Floating) = [1]> then\n                    AirShot\n                    set [floating v] to [0]\n                end\n                set [spatout v] to [0]\n                set [yvel v] to [0]\n                if <<key (up arrow v) pressed?> and <<(AllowJump) = [1]> and <(Sucking) = [0]>>> then\n                    set [allowjump v] to [0]\n                    set [yvel v] to ((17) - (<(Holding) = [1]> * (2)))\n                    start sound [Jump v]\n                    set [jumping v] to [0.1]\n                end\n            end\n        end\n        if <<not <<key (left arrow v) pressed?> and <key (right arrow v) pressed?>>> and <<(Sucking) = [0]> and <<(Crouching) = [0]> and <(AbilityUse) = [0]>>>> then\n            if <key (right arrow v) pressed?> then\n                change [xvel v] by (0.5)\n                point in direction (90)\n                if <(XVel) < [0.5]> then\n                    set [turning v] to [1]\n                end\n            end\n            if <key (left arrow v) pressed?> then\n                change [xvel v] by (-0.5)\n                point in direction (-90)\n                if <(XVel) > [-0.5]> then\n                    set [turning v] to [1]\n                end\n            end\n        end\n        set [running v] to [0]\n        if <<<key (space v) pressed?> and <<<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> and <not <<key (left arrow v) pressed?> and <key (right arrow v) pressed?>>>>> and <<<(Floating) = [0]> and <(Sucking) = [0]>> and <<(Crouching) = [0]> and <(Shooting) = [0]>>>> then\n            set [running v] to [1]\n        end\n        if <<(Ability) = [Spike]> and <not <(AbilityUse) = [0]>>> then\n    end\n    change x by (XVel)\n    switch costume to (fullhitbox v)\n    if <<touching (map v)?> or <<touching (blocks v)?> or <touching (semisolids v)?>>> then\n        YSmoothing\n    end\n    if <<touching (map v)?> or <touching (blocks v)?>> then\n        change x by ((XVel) * (-1))\n        XFix\n        set [xvel v] to ((([abs v] of (XVel) ) / (XVel)) * (0.05))\n    end\n    if <<<(Floating) = [0]> and <<(Sucking) = [0]> and <(AbilityUse) = [0]>>> and <<<(Shooting) = [0]> and <(Holding) = [0]>> and <(AllowShot) = [1]>>> then\n        if <key (z v) pressed?> then\n            if <(Ability) = [None]> then\n                start sound [Inhale v]\n                set [sucking v] to [0.1]\n            else\n                set [jumping v] to [0]\n                set [allowshot v] to [0]\n                UseAbility\n            end\n        end\n    end\n    if <<(Sucking) = [1]> and <not <key (z v) pressed?>>> then\n        set [sucking v] to [0]\n    end\n    if <not <(Sucking) = [0]>> then\n        Inhaling\n    end\n    if <<<(Holding) = [1]> and <(AllowShot) = [1]>> and <key (z v) pressed?>> then\n        StarShot\n    end\n    set [crouching v] to [0]\n    if <<<key (down arrow v) pressed?> and <(Shooting) = [0]>> and <<(YVel) = [0]> or <<(YVel) = ((Gravity) / (6.1))> or <(YVel) = ((Gravity) / (3.05))>>>> then\n        set [crouching v] to [1]\n        if <(Holding) = [1]> then\n            set [ability v] to (HoldingType)\n            if <not <(Ability) = [None]>> then\n                start sound [Ability v]\n                broadcast (NewAbility v)\n            end\n            set [holding v] to [0]\n        end\n        set [jumping v] to [0]\n    end\n    if <<key (a v) pressed?> and <<<(AllowShot) = [1]> and <(AbilityUse) = [0]>> and <not <(Ability) = [None]>>>> then\n        AbilityStar\n        set [ability v] to [None]\n    end\nend\n\ndefine YSmoothing\nrepeat (12)\n    if <<touching (map v)?> or <<touching (blocks v)?> or <<touching (semisolids v)?> and <not <key (down arrow v) pressed?>>>>> then\n        change y by (1)\n    end\nend\nif <<touching (map v)?> or <<touching (blocks v)?> or <<touching (semisolids v)?> and <not <key (down arrow v) pressed?>>>>> then\n    change y by (-12)\nend\n\ndefine FindFloor\nrepeat until <<<touching (map v)?> or <touching (blocks v)?>> or <<<touching (semisolids v)?> and <not <<key (down arrow v) pressed?> and <<<(Shooting) = [0]> and <(Floating) = [0]>> and <<(Sucking) = [0]> and <(AbilityUse) = [0]>>>>>> and <not <((Gravity) + (YVel)) > [0]>>>>\n    change y by (-1)\nend\nchange y by (1)\n\ndefine FindCeiling\nrepeat until <not <<touching (map v)?> or <touching (blocks v)?>>>\n    change y by (-1)\nend\n\nwhen I receive [resetplayer v]\nset [gravity v] to [-4]\nset [xvel v] to [0]\nset [yvel v] to [0]\nset [playerx v] to [-750]\nset [mapx v] to [600]\nset [playery v] to [474]\nset [mapy v] to [-474]\nset [shooting v] to [0]\nset [sucking v] to [0]\nset [floating v] to [0]\nset [holding v] to [0]\nset [jumping v] to [0]\nset [allowmovement v] to [1]\nset [abilityuse v] to [0]\nset [allowdamage v] to [1]\nset [bosslocked v] to [0]\nset [health v] to [5]\nset [dead v] to [0]\nset [spatout v] to [0]\n\ndefine XFix\nset [playerx v] to ((x position) - (MapX))\nset [offset v] to [0]\nrepeat until <<<touching (map v)?> or <touching (blocks v)?>> or <(Offset) > [84]>>\n    set x to ((PlayerX) + (MapX))\n    if <(Offset) > [0]> then\n        change [offset v] by (0.5)\n    else\n        change [offset v] by (-0.5)\n    end\n    set [offset v] to ((Offset) * (-1))\n    change x by (Offset)\nend\nif <(Offset) > [84]> then\n    set x to ((PlayerX) + (MapX))\nend\n\nwhen I receive [door v]\nif <((DoorsPassed) mod (3)) = [0]> then\n    wait (2) seconds\nelse\n    wait (1.3) seconds\nend\npoint in direction (90)\nset [playerx v] to [-750]\nset [mapx v] to [600]\nif <(MapY) = [-474]> then\n    set [mapy v] to [-54]\nelse\n    if <(MapY) = [-54]> then\n        set [mapy v] to [450]\n    end\nend\nset [playery v] to ((MapY) * (-1))\n\ndefine AirShot\nstart sound [Pop v]\nadd (direction) to [attackdir v]\nadd [0] to [attackstate v]\nadd [1] to [attacktype v]\nadd ((((x position) + ((direction) / (9))) - (MapX)) / (28)) to [attackx v]\nadd (((y position) - (MapY)) / (28)) to [attacky v]\nadd [1] to [playerowned v]\nset [shooting v] to [1]\n\ndefine Inhaling\nif <(((Global#) * (96)) mod (3)) < [1]> then\n    add (direction) to [attackdir v]\n    add [0] to [attackstate v]\n    add [2] to [attacktype v]\n    add ((((x position) + ((direction) / (0.8))) - (MapX)) / (28)) to [attackx v]\n    add ((((y position) - (MapY)) / (28)) + (([sin v] of ((Global#) * (2160)) ) * (2))) to [attacky v]\n    add [1] to [playerowned v]\nend\n\ndefine StarShot\nstart sound [Pop v]\nadd (direction) to [attackdir v]\nadd [0] to [attackstate v]\nadd [3] to [attacktype v]\nadd ((((x position) + ((direction) / (9))) - (MapX)) / (28)) to [attackx v]\nadd (((y position) - (MapY)) / (28)) to [attacky v]\nadd [1] to [playerowned v]\nset [shooting v] to [1]\nset [holding v] to [0]\n\ndefine Cutter\nadd (direction) to [attackdir v]\nadd [0] to [attackstate v]\nadd [4] to [attacktype v]\nadd ((((x position) + ((direction) / (6))) - (MapX)) / (28)) to [attackx v]\nadd (((y position) - (MapY)) / (28)) to [attacky v]\nadd [1] to [playerowned v]\n\ndefine UseAbility\nset [abilityuse v] to [1]\nif <(Ability) = [Cutter]> then\n    broadcast (UseCutter v)\n    start sound [Cutter v]\nend\nif <(Ability) = [Burning]> then\n    set [allowdamage v] to [0]\n    broadcast (UseBurning v)\n    broadcast (UsingAbility v)\n    start sound [Burning v]\nend\nif <(Ability) = [Spike]> then\n    set [allowdamage v] to [0]\n    broadcast (UsingAbility v)\n    start sound [Spike v]\nend\nif <(Ability) = [Spark]> then\n    set [allowdamage v] to [0]\n    broadcast (UseSpark v)\n    broadcast (UsingAbility v)\n    start sound [Spark v]\nend\nif <(Ability) = [Clean]> then\n    set [allowdamage v] to [0]\n    broadcast (UseClean v)\n    broadcast (UsingAbility v)\n    start sound [Sweep v]\nend\n\nwhen I receive [usecutter v]\nwait (0.1) seconds\nCutter\n\nwhen I receive [newability v]\nset [xvel v] to [0]\nwait (0.2) seconds\nUseAbility\n\ndefine CutterCostumes\nif <(AbilityUse) > [0.9]> then\n    switch costume to (52 v)\nelse\n    if <(AbilityUse) > [0.8]> then\n        switch costume to (53 v)\n    else\n        if <(AbilityUse) > [0.7]> then\n            switch costume to (54 v)\n        else\n            if <(AbilityUse) > [0.6]> then\n                switch costume to (55 v)\n            else\n                if <(AbilityUse) > [0.5]> then\n                    switch costume to (56 v)\n                else\n                    if <(AbilityUse) > [0.4]> then\n                        switch costume to (57 v)\n                    else\n                        switch costume to (58 v)\n                        set [abilityuse v] to [0]\n                    end\n                end\n            end\n        end\n    end\nend\nchange [abilityuse v] by (-0.05)\nif <(AbilityUse) < [0]> then\n    set [abilityuse v] to [0]\nend\n\ndefine BurningCostumes\nif <(AbilityUse) > [0.95]> then\n    switch costume to (59 v)\nelse\n    if <(AbilityUse) > [0.9]> then\n        switch costume to (60 v)\n    else\n        if <(AbilityUse) > [0.6]> then\n            switch costume to ((([floor v] of ((Global#) * (48)) ) mod (3)) + (61))\n        else\n            if <(AbilityUse) > [0.3]> then\n                switch costume to ((([floor v] of ((Global#) * (48)) ) mod (3)) + (64))\n            else\n                switch costume to ((([floor v] of ((Global#) * (48)) ) mod (3)) + (67))\n            end\n        end\n    end\nend\nif <<not <key (z v) pressed?>> and <<(AbilityUse) > [0.1]> and <(AbilityUse) < [0.8]>>> then\n    set [abilityuse v] to [0.05]\nend\nchange [abilityuse v] by (-0.034)\nif <(AbilityUse) < [0]> then\n    set [abilityuse v] to [0]\nend\n\nwhen I receive [useburning v]\nset [yvel v] to ((Gravity) * (-1))\nrepeat until <(AbilityUse) = [0]>\n    set [xvel v] to ((direction) / (13.5))\n    if <<touching (enemies v)?> or <touching (boss v)?>> then\n        set [attackx v] to (x position)\n        set [attacky v] to (y position)\n        broadcast (AttackHit v)\n    end\n    move (2) steps\n    if <touching (blocks v)?> then\n        set [attackx v] to (x position)\n        set [attacky v] to (y position)\n        broadcast (AttackHit v)\n    end\n    move (-2) steps\nend\nset [yvel v] to ((Gravity) * (-1))\n\ndefine AbilityStar\nadd ((direction) / (-9)) to [attackdir v]\nadd [0] to [attackstate v]\nadd [5] to [attacktype v]\nadd (((x position) - (MapX)) / (28)) to [attackx v]\nadd (((y position) - (MapY)) / (28)) to [attacky v]\nadd (Ability) to [playerowned v]\n\ndefine Spark\nif <((((Global#) * (2160)) * (2)) mod (2)) < [1]> then\n    add ((((Global#) * (2160)) * (2)) mod (360)) to [attackdir v]\n    add [0] to [attackstate v]\n    add [6] to [attacktype v]\n    add (((x position) - (MapX)) / (28)) to [attackx v]\n    add (((y position) - (MapY)) / (28)) to [attacky v]\n    add [1] to [playerowned v]\nend\n\nwhen I receive [usespark v]\nrepeat until <(AbilityUse) = [0]>\n    Spark\nend\n\ndefine SparkCostumes\nif <(AbilityUse) > [0.95]> then\n    switch costume to (71 v)\nelse\n    if <(AbilityUse) > [0.9]> then\n        switch costume to (72 v)\n    else\n        if <(AbilityUse) < [0.3]> then\n            switch costume to ((([floor v] of ((Global#) * (96)) ) mod (2)) + (73))\n        else\n            switch costume to ((([floor v] of ((Global#) * (96)) ) mod (3)) + (73))\n        end\n    end\nend\nchange [abilityuse v] by (-0.06)\nif <(AbilityUse) < [0]> then\n    set [abilityuse v] to [0]\nend\n\ndefine SpikeCostumes\nif <<(AbilityUse) > [0.9]> or <(AbilityUse) < [0.06]>> then\n    switch costume to (76 v)\nelse\n    switch costume to ((([floor v] of ((Global#) * (48)) ) mod (2)) + (77))\nend\nchange [abilityuse v] by (-0.06)\nif <(AbilityUse) < [0]> then\n    set [abilityuse v] to [0]\nend\n\nwhen I receive [resetall v]\nset rotation style [left-right v]\ngo to x: (-150) y: (0)\npoint in direction (90)\nset size to (350) %\nbroadcast (ResetPlayer v) and wait\n\nwhen flag clicked\nset [ability v] to [None]\ngo to x: (-150) y: (0)\n\ndefine CleanCostumes\nif <(AbilityUse) > [0.92]> then\n    switch costume to (79 v)\nelse\n    if <(AbilityUse) > [0.85]> then\n        switch costume to (80 v)\n    else\n        if <(AbilityUse) > [0.15]> then\n            switch costume to ((([floor v] of (((AbilityUse) + (.15)) * (-7.5)) ) mod (3)) + (81))\n        else\n            if <(AbilityUse) > [0.07]> then\n                switch costume to (80 v)\n            else\n                switch costume to (79 v)\n            end\n        end\n    end\nend\nchange [abilityuse v] by (-0.04)\nif <(AbilityUse) < [0]> then\n    set [abilityuse v] to [0]\nend\n\ndefine Clean\nadd (direction) to [attackdir v]\nadd [0] to [attackstate v]\nadd [7] to [attacktype v]\nadd ((((x position) + ((direction) / (9))) - (MapX)) / (28)) to [attackx v]\nadd ((((y position) - (12)) - (MapY)) / (28)) to [attacky v]\nadd [1] to [playerowned v]\n\nwhen I receive [useclean v]\nset [xvel v] to [0]\nwait (0.2) seconds\nrepeat (2)\n    if <<(YVel) = [0]> or <<(YVel) = ((Gravity) / (6.1))> or <(YVel) = ((Gravity) / (3.05))>>> then\n        Clean\n    end\n    wait (0.3) seconds\nend\n\nwhen I receive [takedamage v]\nchange [health v] by (-0.5)\nif <(Health) < [0.1]> then\n    broadcast (Death v)\nelse\n    start sound [Damage v]\n    if <(x position) > (AttackX)> then\n        set [xvel v] to [10]\n    else\n        set [xvel v] to [-10]\n    end\n    set [yvel v] to [16]\n    set [allowdamage v] to [0]\n    repeat (5)\n        set [ghost v] effect to (100)\n        wait (0.1) seconds\n        set [ghost v] effect to (0)\n        wait (0.1) seconds\n    end\n    repeat (5)\n        set [ghost v] effect to (100)\n        wait (0.04) seconds\n        set [ghost v] effect to (0)\n        wait (0.04) seconds\n    end\n    set [allowdamage v] to [1]\nend\n\nwhen I receive [usingability v]\nrepeat until <(AbilityUse) = [0]>\n    set [allowdamage v] to [0]\nend\nset [allowdamage v] to [1]\n\nwhen I receive [death v]\nstart sound [Death v]\nset [ability v] to [None]\nset [dead v] to [1]\nset [allowdamage v] to [0]\nset [allowmovement v] to [0]\nbroadcast (FadeMusic v)\nwait (1) seconds\nset [yvel v] to [14]\nset [dead v] to [2]\nrepeat (45)\n    change [playery v] by (YVel)\n    change [yvel v] by ((Gravity) / (4))\nend\nbroadcast (Fade v)\nwait (1) seconds\nset [doorspassed v] to (((Level) - (1)) * (3))\nrepeat (2)\n    broadcast (ResetAll v)\nend\n\nif <(AbilityUse) = [0]> then\n    if <key (right arrow v) pressed?> then\n        change [cameraoffset v] by (0.05)\n        if <(CameraOffset) > [1]> then\n            set [cameraoffset v] to [1]\n        end\n    else\n        if <key (left arrow v) pressed?> then\n            change [cameraoffset v] by (-0.05)\n            if <(CameraOffset) < [-1]> then\n                set [cameraoffset v] to [-1]\n            end\n        else\n            if <([abs v] of (XVel) ) < [0.05]> then\n                set [cameraoffset v] to ((CameraOffset) / (1.1))\n            end\n        end\n    end\nend\nif <(BossLocked) = [0]> then\n    change [mapx v] by (((((PlayerX) + ((CameraOffset) * (120))) * (-1)) - (MapX)) / (6))\nend\nif <(MapX) > [600]> then\n    set [mapx v] to [600]\nend\nif <(MapX) < [-2280]> then\n    set [mapx v] to [-2280]\nend\n\n@Map\n\nwhen I receive [first v]\nswitch costume to (empty v)\nset size to (350) %\nif <(Clone#) = [1]> then\n    switch costume to (join (join [Part] ((Level) * (2))) [Coll])\nelse\n    switch costume to (join (join [Part] (((Level) * (2)) - (1))) [Coll])\nend\ngo to x: ((MapX) + ((Clone#) * ((480) * (3.5)))) y: (MapY)\nif <([abs v] of ((MapX) + ((Clone#) * ((480) * (3.5)))) ) > [1080]> then\n    hide\nelse\n    show\nend\nif <(Clone#) = [0]> then\n    broadcast (Second v)\nend\n\nwhen I receive [costuming v]\nswitch costume to (empty v)\nset size to (350) %\nif <(Clone#) = [1]> then\n    switch costume to (join [Part] ((Level) * (2)))\nelse\n    switch costume to (join [Part] (((Level) * (2)) - (1)))\nend\n\nwhen I receive [resetall v]\nif <[1] = [1]> then\n    delete this clone\nend\nset [clone# v] to [1]\ncreate clone of (_myself_ v)\nset [clone# v] to [0]\n\n@Enemies\n\nwhen I receive [second v]\nset [x v] to (round (((mouse x) - (MapX)) / (28)))\nset [y v] to (round (((mouse y) - (MapY)) / (28)))\nif <[1] = [1]> then\n    delete this clone\nend\nDeleteStuff\nLoadEnemies\nbroadcast (Third v)\n\ndefine LoadEnemies\nshow\nset [scan# v] to [0]\nrepeat (length of [enemyx v])\n    change [scan# v] by (1)\n    if <<([abs v] of (((item (Scan#) of [enemyx v]) * (28)) + (MapX)) ) < [235]> and <([abs v] of (((item (Scan#) of [enemyy v]) * (28)) + (MapY)) ) < [175]>> then\n        go to x: (((item (Scan#) of [enemyx v]) * (28)) + (MapX)) y: (((item (Scan#) of [enemyy v]) * (28)) + (MapY))\n        point in direction (item (Scan#) of [enemydir v])\n        create clone of (_myself_ v)\n    end\nend\nchange [scan# v] by (1)\nhide\n\ndefine DeleteStuff\nrepeat (length of [deleteenemies v])\n    delete (item (1) of [deleteenemies v]) of [enemydir v]\n    delete (item (1) of [deleteenemies v]) of [enemyhealth v]\n    delete (item (1) of [deleteenemies v]) of [enemystate v]\n    delete (item (1) of [deleteenemies v]) of [enemytype v]\n    delete (item (1) of [deleteenemies v]) of [enemyx v]\n    delete (item (1) of [deleteenemies v]) of [enemyy v]\n    delete (item (1) of [deleteenemies v]) of [enemyyvelocity v]\n    delete (1) of [deleteenemies v]\nend\n\ndefine AddEnemy (x) (y) (dir) (type) (health)\nadd (dir) to [enemydir v]\nadd (health) to [enemyhealth v]\nif <(type) = [3]> then\n    add [0.2] to [enemystate v]\nelse\n    add [0] to [enemystate v]\nend\nadd (type) to [enemytype v]\nadd (x) to [enemyx v]\nadd (y) to [enemyy v]\nadd [0] to [enemyyvelocity v]\n\nwhen I receive [costuming v]\nif <(item (Scan#) of [enemyhealth v]) > [0]> then\n    if <(item (Scan#) of [enemytype v]) = [1]> then\n        switch costume to ((([floor v] of ((Global#) * (16)) ) mod (4)) + (1))\n    end\n    if <(item (Scan#) of [enemytype v]) = [2]> then\n        if <(((Global#) / (2)) mod (1)) > [0.5]> then\n            if <(((Global#) / (2)) mod (1)) > [0.75]> then\n                switch costume to (11 v)\n            else\n                switch costume to ((([floor v] of ((Global#) * (24)) ) mod (2)) + (9))\n            end\n        else\n            switch costume to ((([floor v] of ((Global#) * (16)) ) mod (4)) + (5))\n        end\n    end\n    if <(item (Scan#) of [enemytype v]) = [3]> then\n        if <(item (Scan#) of [enemyyvelocity v]) = [0]> then\n            switch costume to (12 v)\n        else\n            if <(item (Scan#) of [enemyyvelocity v]) > [1]> then\n                switch costume to (14 v)\n            else\n                switch costume to (13 v)\n            end\n        end\n    end\n    if <(item (Scan#) of [enemytype v]) = [4]> then\n        switch costume to ((([floor v] of ((Global#) * (16)) ) mod (4)) + (15))\n    end\n    if <(item (Scan#) of [enemytype v]) = [5]> then\n        switch costume to ((([floor v] of ((Global#) * (16)) ) mod (3)) + (19))\n    end\n    if <(item (Scan#) of [enemytype v]) = [6]> then\n        switch costume to ((([floor v] of ((Global#) * (16)) ) mod (4)) + (22))\n    end\n    if <(item (Scan#) of [enemytype v]) = [7]> then\n        if <(item (Scan#) of [enemystate v]) = [0]> then\n            if <(item (Scan#) of [enemyyvelocity v]) = [0]> then\n                switch costume to ((([floor v] of ((Global#) * (8)) ) mod (2)) + (26))\n            else\n                switch costume to (26 v)\n            end\n        else\n            if <(item (Scan#) of [enemystate v]) > [6]> then\n                if <(([floor v] of ((Global#) * (48)) ) mod (2)) = [1]> then\n                    switch costume to (30 v)\n                else\n                    switch costume to (28 v)\n                end\n            else\n                switch costume to ((([floor v] of ((Global#) * (24)) ) mod (2)) + (28))\n            end\n        end\n    end\n    if <(item (Scan#) of [enemytype v]) = [8]> then\n        if <<(item (Scan#) of [enemystate v]) = [0]> or <(item (Scan#) of [enemystate v]) > [7]>> then\n            switch costume to ((([floor v] of ((Global#) * (16)) ) mod (2)) + (31))\n        else\n            switch costume to (([floor v] of (item (Scan#) of [enemystate v]) ) + (33))\n        end\n    end\n    if <(item (Scan#) of [enemytype v]) = [9]> then\n        switch costume to ((([floor v] of ((Global#) * (16)) ) mod (4)) + (40))\n    end\n    if <(item (Scan#) of [enemytype v]) = [10]> then\n        switch costume to ((([floor v] of ((Global#) * (16)) ) mod (2)) + (44))\n    end\nelse\n    show\n    switch costume to (join [Dead] ([abs v] of (([floor v] of (item (Scan#) of [enemyhealth v]) ) + (1)) ))\n    if <(item (Scan#) of [enemyhealth v]) < [-19]> then\n        hide\n    end\nend\nchange y by (-1)\n\nwhen I start as a clone\nif <not <(item (Scan#) of [enemyhealth v]) > [0]>> then\n    hide\n    replace item (Scan#) of [enemyhealth v] with ((item (Scan#) of [enemyhealth v]) - (1))\n    if <(item (Scan#) of [enemyhealth v]) < [-19]> then\n        add (Scan#) to [deleteenemies v]\n    end\nelse\n    if <<<<(Ability) = [Spark]> and <(distance to [kirby v]) < [64]>> or <<(Ability) = [Spike]> and <(distance to [kirby v]) < [48]>>> and <not <(AbilityUse) = [0]>>> then\n        replace item (Scan#) of [enemyhealth v] with ((item (Scan#) of [enemyhealth v]) - (0.2))\n        if <(item (Scan#) of [enemyhealth v]) < [1]> then\n            replace item (Scan#) of [enemyhealth v] with [0]\n        end\n    else\n        if <<<<([x position v] of [kirby v]) > ((x position) + (6))> and <([direction v] of [kirby v]) = [-90]>> or <<not <([x position v] of [kirby v]) > ((x position) - (6))>> and <([direction v] of [kirby v]) = [90]>>> and <<not <(Sucking) = [0]>> and <(distance to [kirby v]) < [90]>>> then\n            change y by (-4)\n            point towards (kirby v)\n            change y by (4)\n            move ([abs v] of (((distance to [kirby v]) / (18)) - (6)) ) steps\n            replace item (Scan#) of [enemyx v] with (((x position) - (MapX)) / (28))\n            replace item (Scan#) of [enemyy v] with (((y position) - (MapY)) / (28))\n            replace item (Scan#) of [enemyyvelocity v] with [0]\n            if <(distance to [kirby v]) < [20]> then\n                set [holding v] to [1]\n                set [allowshot v] to [0]\n                add (Scan#) to [deleteenemies v]\n                set [holdingtype v] to [None]\n                if <(item (Scan#) of [enemytype v]) = [2]> then\n                    set [holdingtype v] to [Cutter]\n                end\n                if <(item (Scan#) of [enemytype v]) = [6]> then\n                    set [holdingtype v] to [Burning]\n                end\n                if <(item (Scan#) of [enemytype v]) = [7]> then\n                    set [holdingtype v] to [Spark]\n                end\n                if <(item (Scan#) of [enemytype v]) = [8]> then\n                    set [holdingtype v] to [Spike]\n                end\n                if <<(item (Scan#) of [enemytype v]) = [9]> or <(item (Scan#) of [enemytype v]) = [10]>> then\n                    set [holdingtype v] to [Clean]\n                end\n            end\n        else\n            if <(item (Scan#) of [enemytype v]) = [1]> then\n                switch costume to (hitbox v)\n                YMovement\n                XMovement [1]\n                replace item (Scan#) of [enemyx v] with (((x position) - (MapX)) / (28))\n                replace item (Scan#) of [enemyy v] with (((y position) - (MapY)) / (28))\n            end\n            if <(item (Scan#) of [enemytype v]) = [2]> then\n                switch costume to (hitbox v)\n                YMovement\n                if <(((Global#) / (2)) mod (1)) > [0.75]> then\n                    if <not <((((Global#) - (0.01)) / (2)) mod (1)) > [0.75]>> then\n                        Cutter\n                    end\n                end\n                replace item (Scan#) of [enemyx v] with (((x position) - (MapX)) / (28))\n                replace item (Scan#) of [enemyy v] with (((y position) - (MapY)) / (28))\n                if <(((Global#) / (2)) mod (1)) < [0.5]> then\n                    if <([x position v] of [kirby v]) > (x position)> then\n                        point in direction (90)\n                    else\n                        point in direction (-90)\n                    end\n                    replace item (Scan#) of [enemydir v] with (direction)\n                end\n            end\n            if <(item (Scan#) of [enemytype v]) = [3]> then\n                switch costume to (hitbox v)\n                YMovement\n                if <not <(item (Scan#) of [enemyyvelocity v]) = [0]>> then\n                    XMovement [1]\n                end\n                if <<((item (Scan#) of [enemystate v]) mod (1)) = [0]> and <(item (Scan#) of [enemyyvelocity v]) = [0]>> then\n                    replace item (Scan#) of [enemyyvelocity v] with [12]\n                    replace item (Scan#) of [enemystate v] with ((item (Scan#) of [enemystate v]) + (0.2))\n                    if <(item (Scan#) of [enemystate v]) > [3]> then\n                        replace item (Scan#) of [enemystate v] with [0.2]\n                        replace item (Scan#) of [enemyyvelocity v] with [15]\n                    end\n                else\n                    if <(item (Scan#) of [enemyyvelocity v]) = [0]> then\n                        replace item (Scan#) of [enemystate v] with ((item (Scan#) of [enemystate v]) + (0.2))\n                        if <((item (Scan#) of [enemystate v]) mod (1)) < [0.2]> then\n                            replace item (Scan#) of [enemystate v] with ([floor v] of (item (Scan#) of [enemystate v]) )\n                        end\n                    end\n                end\n                replace item (Scan#) of [enemyx v] with (((x position) - (MapX)) / (28))\n                replace item (Scan#) of [enemyy v] with (((y position) - (MapY)) / (28))\n            end\n            if <(item (Scan#) of [enemytype v]) = [4]> then\n                switch costume to (hitbox v)\n                YMovement\n                XMovement [1.5]\n                replace item (Scan#) of [enemyx v] with (((x position) - (MapX)) / (28))\n                replace item (Scan#) of [enemyy v] with (((y position) - (MapY)) / (28))\n            end\n            if <(item (Scan#) of [enemytype v]) = [5]> then\n                switch costume to (hitbox v)\n                change y by (([sin v] of ((Global#) * (360)) ) * (3.8))\n                if <(y position) > [150]> then\n                    set y to (150)\n                end\n                XMovement [1]\n                replace item (Scan#) of [enemyx v] with (((x position) - (MapX)) / (28))\n                replace item (Scan#) of [enemyy v] with (((y position) - (MapY)) / (28))\n            end\n            if <(item (Scan#) of [enemytype v]) = [6]> then\n                switch costume to (hitbox v)\n                YMovement\n                XMovement [1]\n                replace item (Scan#) of [enemyx v] with (((x position) - (MapX)) / (28))\n                replace item (Scan#) of [enemyy v] with (((y position) - (MapY)) / (28))\n            end\n            if <(item (Scan#) of [enemytype v]) = [7]> then\n                switch costume to (hitbox v)\n                YMovement\n                if <(item (Scan#) of [enemystate v]) = [0]> then\n                    if <<(item (Scan#) of [enemyyvelocity v]) = [0]> and <(((Global#) * (5)) mod (5)) < [0.1]>> then\n                        replace item (Scan#) of [enemyyvelocity v] with [11.5]\n                    end\n                    if <not <(item (Scan#) of [enemyyvelocity v]) = [0]>> then\n                        XMovement [1.5]\n                    end\n                    if <(item (Scan#) of [enemyyvelocity v]) = [0]> then\n                        if <([x position v] of [kirby v]) > (x position)> then\n                            point in direction (90)\n                        else\n                            point in direction (-90)\n                        end\n                        replace item (Scan#) of [enemydir v] with (direction)\n                        if <(distance to [kirby v]) < [90]> then\n                            replace item (Scan#) of [enemystate v] with [1]\n                        end\n                    end\n                else\n                    replace item (Scan#) of [enemystate v] with ((item (Scan#) of [enemystate v]) + (0.1))\n                    if <(item (Scan#) of [enemystate v]) > [6]> then\n                        Spark\n                    end\n                    if <(item (Scan#) of [enemystate v]) > [10]> then\n                        replace item (Scan#) of [enemystate v] with [0]\n                    end\n                end\n                replace item (Scan#) of [enemyx v] with (((x position) - (MapX)) / (28))\n                replace item (Scan#) of [enemyy v] with (((y position) - (MapY)) / (28))\n            end\n            if <(item (Scan#) of [enemytype v]) = [8]> then\n                switch costume to (hitbox v)\n                YMovement\n                if <(item (Scan#) of [enemystate v]) = [0]> then\n                    if <([x position v] of [kirby v]) > (x position)> then\n                        point in direction (90)\n                    else\n                        point in direction (-90)\n                    end\n                    replace item (Scan#) of [enemydir v] with (direction)\n                    if <<([abs v] of (([x position v] of [kirby v]) - (x position)) ) < [48]> and <([y position v] of [kirby v]) > ((y position) + (2))>> then\n                        start sound [Spike v]\n                        replace item (Scan#) of [enemystate v] with [0.5]\n                    end\n                else\n                    if <<(item (Scan#) of [enemystate v]) > [5]> and <(item (Scan#) of [enemystate v]) < [6]>> then\n                        replace item (Scan#) of [enemystate v] with ((item (Scan#) of [enemystate v]) + (0.1))\n                    else\n                        replace item (Scan#) of [enemystate v] with ((item (Scan#) of [enemystate v]) + (0.5))\n                    end\n                    if <(item (Scan#) of [enemystate v]) > [4]> then\n                        switch costume to (hitboxspike v)\n                        if <<touching (kirby v)?> and <(AllowDamage) = [1]>> then\n                            broadcast (TakeDamage v)\n                        end\n                        if <touching (blocks v)?> then\n                            set [attackx v] to (x position)\n                            set [attacky v] to ((y position) + (56))\n                            broadcast (AttackHit v)\n                        end\n                        switch costume to (hitbox v)\n                    end\n                    if <(item (Scan#) of [enemystate v]) > [8]> then\n                        replace item (Scan#) of [enemystate v] with [0]\n                    end\n                end\n                replace item (Scan#) of [enemyy v] with (((y position) - (MapY)) / (28))\n            end\n            if <(item (Scan#) of [enemytype v]) = [9]> then\n                switch costume to (hitbox v)\n                XMovement [1]\n                replace item (Scan#) of [enemyx v] with (((x position) - (MapX)) / (28))\n                change y by (([sin v] of ((Global#) * (180)) ) * (14))\n            end\n            if <(item (Scan#) of [enemytype v]) = [10]> then\n                switch costume to (hitbox v)\n                YMovement\n                if <([sin v] of ((Global#) * (420)) ) > [0]> then\n                    if <(direction) = [-90]> then\n                        point in direction (90)\n                        replace item (Scan#) of [enemydir v] with (direction)\n                        if <not <([sin v] of (((Global#) - (0.01)) * (420)) ) > [0]>> then\n                            point in direction (-90)\n                            Clean\n                        end\n                    end\n                else\n                    if <(direction) = [90]> then\n                        point in direction (-90)\n                        replace item (Scan#) of [enemydir v] with (direction)\n                        if <not <([sin v] of (((Global#) - (0.01)) * (420)) ) < [0]>> then\n                            point in direction (90)\n                            Clean\n                        end\n                    end\n                end\n                XMovement [1]\n                replace item (Scan#) of [enemyx v] with (((x position) - (MapX)) / (28))\n                replace item (Scan#) of [enemyy v] with (((y position) - (MapY)) / (28))\n            end\n            switch costume to (damagehitbox v)\n            if <<touching (kirby v)?> and <(AllowDamage) = [1]>> then\n                broadcast (TakeDamage v)\n                replace item (Scan#) of [enemyhealth v] with ((item (Scan#) of [enemyhealth v]) - (0.2))\n                if <(item (Scan#) of [enemyhealth v]) < [1]> then\n                    replace item (Scan#) of [enemyhealth v] with [0]\n                    start sound [Hit v]\n                end\n            end\n        end\n    end\nend\n\ndefine YMovement\nif <(item (Scan#) of [enemyyvelocity v]) > [-8]> then\n    replace item (Scan#) of [enemyyvelocity v] with ((item (Scan#) of [enemyyvelocity v]) + ((Gravity) / (6.1)))\nend\nchange y by ((Gravity) + (item (Scan#) of [enemyyvelocity v]))\nif <not <((Gravity) + (item (Scan#) of [enemyyvelocity v])) > [0]>> then\n    switch costume to (hitboxfloor v)\nend\nif <<<touching (map v)?> or <touching (blocks v)?>> or <<touching (semisolids v)?> and <not <((Gravity) + (item (Scan#) of [enemyyvelocity v])) > [0]>>>> then\n    if <((Gravity) + (item (Scan#) of [enemyyvelocity v])) > [0]> then\n        replace item (Scan#) of [enemyyvelocity v] with [0]\n        FindCeiling\n    else\n        replace item (Scan#) of [enemyyvelocity v] with [0]\n        FindFloor\n    end\nend\nswitch costume to (hitbox v)\n\ndefine FindFloor\nset [offset v] to [0]\nrepeat until <<not <<<touching (map v)?> or <touching (blocks v)?>> or <touching (semisolids v)?>>> or <(Offset) > [24]>>\n    if <(Offset) > [0]> then\n        change [offset v] by (0.5)\n    else\n        change [offset v] by (-0.5)\n    end\n    set [offset v] to ((Offset) * (-1))\n    change y by (Offset)\nend\nif <(Offset) > [24]> then\n\ndefine FindCeiling\nrepeat until <not <<touching (map v)?> or <touching (blocks v)?>>>\n    change y by (-1)\nend\n\nwhen I receive [attackhit v]\nif <<<([abs v] of ((x position) - (AttackX)) ) < [48]> and <([abs v] of ((y position) - (AttackY)) ) < [48]>> and <(item (Scan#) of [enemyhealth v]) > [0]>> then\n    replace item (Scan#) of [enemyhealth v] with [0]\n    start sound [Hit v]\nend\n\ndefine Cutter\nadd (direction) to [attackdir v]\nadd [0] to [attackstate v]\nadd [4] to [attacktype v]\nadd ((((x position) + ((direction) / (6))) - (MapX)) / (28)) to [attackx v]\nadd (((y position) - (MapY)) / (28)) to [attacky v]\nadd [0] to [playerowned v]\n\ndefine XMovement (speed)\nmove (speed) steps\nif <<touching (map v)?> or <touching (blocks v)?>> then\n    repeat (14)\n        if <<touching (map v)?> or <touching (blocks v)?>> then\n            change y by (1)\n        end\n    end\n    if <<touching (map v)?> or <touching (blocks v)?>> then\n        change y by (-14)\n        turn right (180) degrees\n        move (speed) steps\n        replace item (Scan#) of [enemydir v] with (direction)\n    end\nend\n\ndefine Spark\nif <((((Global#) * (2160)) * (2)) mod (3)) < [1]> then\n    add ((((Global#) * (2160)) * (2)) mod (360)) to [attackdir v]\n    add [0] to [attackstate v]\n    add [6] to [attacktype v]\n    add (((x position) - (MapX)) / (28)) to [attackx v]\n    add (((y position) - (MapY)) / (28)) to [attacky v]\n    add [0] to [playerowned v]\nend\n\nwhen I receive [resetall v]\nClearEnemies\nif <[1] = [1]> then\n    delete this clone\nend\nwait (0) seconds\nswitch costume to (1 v)\nset rotation style [left-right v]\ngo to x: (0) y: (0)\nset size to (350) %\nhide\nif <(Level) = [1]> then\n    AddEnemy [-21] [18] [90] [1] [1]\n    AddEnemy [-10.5] [17] [-90] [2] [1]\n    AddEnemy [-5] [18] [-90] [5] [1]\n    AddEnemy [0] [18] [-90] [5] [1]\n    AddEnemy [2] [15] [-90] [2] [1]\n    AddEnemy [14] [14] [-90] [1] [1]\n    AddEnemy [14] [18] [-90] [1] [1]\n    AddEnemy [24] [18] [-90] [2] [1]\n    AddEnemy [45] [13] [-90] [4] [1]\n    AddEnemy [39] [16] [-90] [1] [1]\n    AddEnemy [39] [16] [-90] [1] [1]\n    AddEnemy [52] [16] [-90] [5] [1]\n    AddEnemy [56] [16] [-90] [5] [1]\n    AddEnemy [61] [14] [-90] [2] [1]\n    AddEnemy [73] [13] [-90] [4] [1]\n    AddEnemy [78] [17] [-90] [5] [1]\n    AddEnemy [83] [15] [-90] [6] [1]\n    wait until <(DoorsPassed) > [0]>\n    ClearEnemies\n    AddEnemy [-10] [-2] [-90] [3] [1]\n    AddEnemy [0] [-1] [-90] [3] [1]\n    AddEnemy [5] [2] [-90] [5] [1]\n    AddEnemy [12] [1] [-90] [6] [1]\n    AddEnemy [25] [3] [-90] [1] [1]\n    AddEnemy [17] [1] [-90] [1] [1]\n    AddEnemy [24] [-1] [-90] [7] [1]\n    AddEnemy [35] [3] [-90] [5] [1]\n    AddEnemy [42] [-1] [-90] [6] [1]\n    AddEnemy [45] [4] [-90] [4] [1]\n    AddEnemy [55] [0] [-90] [2] [1]\n    AddEnemy [53] [-2] [-90] [1] [1]\n    AddEnemy [69] [-2] [-90] [4] [1]\n    AddEnemy [79] [-1] [-90] [1] [1]\n    AddEnemy [84] [-1] [-90] [7] [1]\n    wait until <(DoorsPassed) > [1]>\n    ClearEnemies\n    AddEnemy [-16] [-17] [-90] [7] [1]\n    AddEnemy [1] [-18] [-90] [3] [1]\n    AddEnemy [15] [-15] [-90] [3] [1]\n    AddEnemy [14] [-17] [-90] [1] [1]\n    AddEnemy [34] [-12] [-90] [7] [1]\n    AddEnemy [53] [-19] [-90] [1] [1]\n    AddEnemy [57] [-19] [-90] [6] [1]\n    AddEnemy [61] [-19] [-90] [1] [1]\n    AddEnemy [66] [-16] [-90] [7] [1]\n    AddEnemy [63] [-14] [-90] [3] [1]\n    AddEnemy [82] [-16] [-90] [1] [1]\n    AddEnemy [84] [-20] [-90] [1] [1]\nend\nif <(Level) = [2]> then\n    AddEnemy [-15] [18] [-90] [5] [1]\n    AddEnemy [-10] [18] [-90] [5] [1]\n    AddEnemy [-13] [13] [-90] [6] [1]\n    AddEnemy [2] [14] [-90] [1] [1]\n    AddEnemy [12] [15] [-90] [1] [1]\n    AddEnemy [14] [13] [90] [4] [1]\n    AddEnemy [33] [15] [-90] [6] [1]\n    AddEnemy [33] [15] [-90] [6] [1]\n    AddEnemy [8] [18] [-90] [5] [1]\n    AddEnemy [51] [13] [-90] [8] [1]\n    AddEnemy [45] [16] [-90] [8] [1]\n    AddEnemy [44] [19] [-90] [1] [1]\n    AddEnemy [55] [14] [-90] [6] [1]\n    AddEnemy [66] [13] [-90] [4] [1]\n    AddEnemy [72] [13] [-90] [4] [1]\n    AddEnemy [89] [22] [-90] [2] [1]\n    AddEnemy [86] [18] [-90] [3] [1]\n    AddEnemy [75] [14] [-90] [3] [1]\n    wait until <(DoorsPassed) > [3]>\n    ClearEnemies\n    AddEnemy [-20] [-1] [-90] [8] [1]\n    AddEnemy [-16] [1] [-90] [8] [1]\n    AddEnemy [-11] [3] [-90] [1] [1]\n    AddEnemy [-5] [0] [90] [1] [1]\n    AddEnemy [12.5] [-2] [-90] [4] [1]\n    AddEnemy [19] [2] [-90] [2] [1]\n    AddEnemy [25] [4] [-90] [9] [1]\n    AddEnemy [29] [-2] [-90] [1] [1]\n    AddEnemy [50] [-1] [-90] [4] [1]\n    AddEnemy [61] [1] [-90] [4] [1]\n    AddEnemy [85] [1] [-90] [10] [1]\n    AddEnemy [74] [2] [-90] [1] [1]\n    AddEnemy [74] [-2] [-90] [1] [1]\n    wait until <(DoorsPassed) > [4]>\n    ClearEnemies\n    AddEnemy [-20] [-20] [-90] [8] [1]\n    AddEnemy [-6] [-14] [-90] [10] [1]\n    AddEnemy [15] [-15] [-90] [6] [1]\n    AddEnemy [8] [-20] [-90] [2] [1]\n    AddEnemy [8] [-14] [-90] [9] [1]\n    AddEnemy [23] [-20] [-90] [10] [1]\n    AddEnemy [36] [-19] [-90] [6] [1]\n    AddEnemy [-13] [-15] [-90] [5] [1]\n    AddEnemy [74] [-13] [-90] [5] [1]\n    AddEnemy [69] [-15] [-90] [1] [1]\n    AddEnemy [87] [-14] [-90] [9] [1]\n    AddEnemy [77] [-17] [-90] [4] [1]\nend\nif <(Level) = [3]> then\n    AddEnemy [-15] [18] [-90] [9] [1]\n    AddEnemy [-16] [13] [-90] [10] [1]\n    AddEnemy [1] [15] [-90] [3] [1]\n    AddEnemy [-3] [14] [-90] [1] [1]\n    AddEnemy [-7] [13] [-90] [3] [1]\n    AddEnemy [9] [15] [-90] [1] [1]\n    AddEnemy [6] [13] [-90] [8] [1]\n    AddEnemy [20] [15] [-90] [2] [1]\n    AddEnemy [26] [14] [-90] [1] [1]\n    AddEnemy [30] [14] [-90] [1] [1]\n    AddEnemy [34] [14] [-90] [1] [1]\n    AddEnemy [65] [15] [-90] [4] [1]\n    AddEnemy [85] [13] [-90] [1] [1]\n    AddEnemy [89] [13] [-90] [1] [1]\n    wait until <(DoorsPassed) > [6]>\n    ClearEnemies\n    AddEnemy [-15] [0] [-90] [10] [1]\n    AddEnemy [-13] [4] [-90] [10] [1]\n    AddEnemy [0] [2] [-90] [10] [1]\n    AddEnemy [1] [-1] [-90] [4] [1]\n    AddEnemy [16] [2] [-90] [6] [1]\n    AddEnemy [10] [4] [-90] [1] [1]\n    AddEnemy [15] [0] [-90] [10] [1]\n    AddEnemy [33] [1] [-90] [1] [1]\n    AddEnemy [28] [1] [-90] [1] [1]\n    AddEnemy [48] [0] [-90] [7] [1]\n    AddEnemy [36] [0] [-90] [4] [1]\n    AddEnemy [44] [3] [-90] [5] [1]\n    AddEnemy [64] [2] [-90] [2] [1]\n    AddEnemy [76] [2] [-90] [2] [1]\n    AddEnemy [89] [3] [-90] [6] [1]\n    wait until <(DoorsPassed) > [7]>\n    ClearEnemies\n    AddEnemy [-10] [-18] [-90] [6] [1]\n    AddEnemy [-14] [-19] [-90] [1] [1]\n    AddEnemy [-18] [-20] [-90] [1] [1]\n    AddEnemy [2] [-14] [-90] [9] [1]\n    AddEnemy [8] [-18] [-90] [4] [1]\n    AddEnemy [16] [-15] [-90] [10] [1]\n    AddEnemy [19] [-19] [-90] [1] [1]\n    AddEnemy [-5] [-20] [-90] [7] [1]\n    AddEnemy [25] [-16] [-90] [1] [1]\n    AddEnemy [36] [-18] [-90] [1] [1]\n    AddEnemy [41] [-18] [-90] [1] [1]\n    AddEnemy [45] [-17] [-90] [2] [1]\n    AddEnemy [58] [-19] [-90] [4] [1]\n    AddEnemy [53] [-20] [-90] [4] [1]\n    AddEnemy [62] [-15] [-90] [9] [1]\n    AddEnemy [48] [-20] [-90] [8] [1]\n    AddEnemy [73.5] [-18] [-90] [2] [1]\n    AddEnemy [81] [-20] [-90] [1] [1]\n    AddEnemy [85] [-20] [-90] [1] [1]\n    AddEnemy [89] [-20] [-90] [1] [1]\nend\n\ndefine ClearEnemies\nwait (0.4) seconds\ndelete all of [enemydir v]\ndelete all of [enemyhealth v]\ndelete all of [enemystate v]\ndelete all of [enemytype v]\ndelete all of [enemyx v]\ndelete all of [enemyy v]\ndelete all of [enemyyvelocity v]\ndelete all of [deleteenemies v]\nwait (0.1) seconds\n\ndefine Clean\nadd (direction) to [attackdir v]\nadd [0] to [attackstate v]\nadd [7] to [attacktype v]\nadd ((((x position) + ((direction) / (9))) - (MapX)) / (28)) to [attackx v]\nadd ((((y position) - (12)) - (MapY)) / (28)) to [attacky v]\nadd [0] to [playerowned v]\n\nwhen flag clicked\nClearEnemies\n\n@Blocks\n\nwhen I receive [second v]\nif <[1] = [1]> then\n    delete this clone\nend\nDeleteStuff\nLoadBlocks\n\ndefine LoadBlocks\nshow\nset [scan# v] to [0]\nrepeat (length of [blockx v])\n    change [scan# v] by (1)\n    if <<([abs v] of (((item (Scan#) of [blockx v]) * (28)) + (MapX)) ) < [247]> and <([abs v] of (((item (Scan#) of [blocky v]) * (28)) + (MapY)) ) < [175]>> then\n        go to x: (((item (Scan#) of [blockx v]) * (28)) + (MapX)) y: (((item (Scan#) of [blocky v]) * (28)) + (MapY))\n        if <not <(item (Scan#) of [blockstate v]) > [0]>> then\n            hide\n        else\n            show\n        end\n        create clone of (_myself_ v)\n    end\nend\nchange [scan# v] by (1)\nhide\n\ndefine DeleteStuff\nrepeat (length of [deleteblocks v])\n    delete (item (1) of [deleteblocks v]) of [blockstate v]\n    delete (item (1) of [deleteblocks v]) of [blockx v]\n    delete (item (1) of [deleteblocks v]) of [blocky v]\n    delete (1) of [deleteblocks v]\nend\n\nwhen I start as a clone\nchange y by (-1)\nif <not <(item (Scan#) of [blockstate v]) > [0]>> then\n    hide\n    replace item (Scan#) of [blockstate v] with ((item (Scan#) of [blockstate v]) - (1))\n    if <(item (Scan#) of [blockstate v]) < [-8]> then\n        add (Scan#) to [deleteblocks v]\n    end\nelse\n    if <<<<(Ability) = [Spark]> and <(distance to [kirby v]) < [64]>> or <<(Ability) = [Spike]> and <(distance to [kirby v]) < [48]>>> and <not <(AbilityUse) = [0]>>> then\n        replace item (Scan#) of [blockstate v] with [0]\n    else\n        if <<([abs v] of (([x position v] of [kirby v]) - (x position)) ) < [12]> and <<(([y position v] of [kirby v]) - (y position)) > [-32]> and <<(([y position v] of [kirby v]) - (y position)) < [0]> and <not <(YVel) > [0]>>>>> then\n            replace item (Scan#) of [blockstate v] with [0]\n        end\n    end\nend\n\nwhen I receive [attackhit v]\nif <<<([abs v] of ((x position) - (AttackX)) ) < [28]> and <([abs v] of ((y position) - (AttackY)) ) < [28]>> and <(item (Scan#) of [blockstate v]) > [0]>> then\n    replace item (Scan#) of [blockstate v] with [0]\n    start sound [Hit v]\nend\n\nwhen I receive [costuming v]\nif <(item (Scan#) of [blockstate v]) > [0]> then\n    switch costume to (1 v)\nelse\n    show\n    switch costume to (join [Dead] ([abs v] of ([floor v] of (item (Scan#) of [blockstate v]) ) ))\n    if <(item (Scan#) of [blockstate v]) < [-8]> then\n        hide\n    end\nend\nchange y by (1)\n\ndefine Block (x) (y)\nadd ((x) + (-0.5)) to [blockx v]\nadd (y) to [blocky v]\nadd [1] to [blockstate v]\n\nwhen I receive [resetall v]\nif <[1] = [1]> then\n    delete this clone\nend\nswitch costume to (1 v)\nset rotation style [don't rotate v]\ngo to x: (0) y: (0)\nset size to (350) %\nhide\nClearBlocks\nif <(Level) = [1]> then\n    Block [-9] [16]\n    Block [-10] [16]\n    Block [-11] [16]\n    Block [13] [17]\n    Block [14] [17]\n    Block [15] [17]\n    wait until <(DoorsPassed) > [0]>\n    ClearBlocks\n    Block [-14] [1]\n    Block [-13] [1]\n    Block [-12] [1]\n    Block [41] [3]\n    Block [42] [3]\n    Block [45] [3]\n    Block [46] [3]\nend\nif <(Level) = [2]> then\n    wait until <(DoorsPassed) > [3]>\n    ClearBlocks\n    Block [72] [1]\n    Block [73] [1]\n    Block [74] [1]\n    Block [75] [1]\n    Block [76] [1]\nend\nif <(Level) = [3]> then\n    wait until <(DoorsPassed) > [6]>\n    ClearBlocks\n    Block [-13] [3]\n    Block [-12] [3]\n    Block [-11] [3]\n    wait until <(DoorsPassed) > [7]>\n    ClearBlocks\n    Block [16] [-16]\n    Block [17] [-16]\n    Block [18] [-16]\nend\n\ndefine ClearBlocks\ndelete all of [blockstate v]\ndelete all of [blockx v]\ndelete all of [blocky v]\ndelete all of [deleteblocks v]\n\n@Boss\n\nwhen I receive [third v]\nswitch costume to (empty v)\nhide\nif <(BossHealth) > [-1]> then\n    if <<<([abs v] of (((BossX) * (28)) + (MapX)) ) < [235]> and <([abs v] of (((BossY) * (28)) + (MapY)) ) < [176]>> or <(BossLocked) = [1]>> then\n        go to x: (((BossX) * (28)) + (MapX)) y: (((BossY) * (28)) + (MapY))\n        show\n        if <(BossHealth) > [0]> then\n            BossScript\n            if <(Level) = [2]> then\n                change [mapx v] by (((-1412) - (MapX)) / (12))\n            else\n                change [mapx v] by (((-1372) - (MapX)) / (12))\n            end\n        else\n            DeadScript\n            set [bosslocked v] to [0]\n        end\n    end\nend\n\nwhen I receive [resetall v]\nstop [other scripts in sprite v]\nset [bossx v] to [500]\nset [bossy v] to [500]\nset [bosslocked v] to [0]\nset [bosshealth v] to [-1]\nset [bossyvel v] to [0]\nset [bossstate v] to [0]\nhide\nif <(Level) = [2]> then\n    switch costume to (1 v)\n    set rotation style [left-right v]\n    go to x: (0) y: (0)\n    set size to (350) %\n    hide\n    wait until <(DoorsPassed) = [5]>\n    wait (0) seconds\n    set [bossx v] to [56]\n    set [bossy v] to [-20]\n    set [bosslocked v] to [0]\n    set [bossstate v] to [0]\n    set [bossyvel v] to [0]\n    set [bosshealth v] to [5]\n    wait (1) seconds\n    wait until <<([abs v] of (((BossX) * (28)) + (MapX)) ) < [235]> and <([abs v] of (((BossY) * (28)) + (MapY)) ) < [175]>>\n    set [bosslocked v] to [1]\n    repeat until <(BossHealth) < [0.1]>\n        wait (2) seconds\n        set [bossstate v] to [1]\n        wait (0.1) seconds\n        wait until <(BossYVel) = [0]>\n        SidePuffs\n        set [bossstate v] to [0]\n        wait (1) seconds\n        set [bossstate v] to [3]\n        wait until <<([abs v] of (([x position v] of [kirby v]) - (x position)) ) < [72]> or <<<([x position v] of [kirby v]) < (x position)> and <(direction) = [90]>> or <<([x position v] of [kirby v]) > (x position)> and <(direction) = [-90]>>>>\n        set [bosssweeping v] to [0]\n        set [bossstate v] to [4]\n        wait (0.1) seconds\n        if <<(BossHealth) > [0]> and <((BossHealth) mod (1)) = [0]>> then\n            start sound [Sweep v]\n            Clean\n        end\n        wait (0.1) seconds\n        set [bossstate v] to [0]\n    end\nend\nif <(Level) = [3]> then\n    switch costume to (1 v)\n    set rotation style [left-right v]\n    go to x: (0) y: (0)\n    set size to (350) %\n    hide\n    wait until <(DoorsPassed) = [6]>\n    wait (0) seconds\n    set [bossx v] to [56]\n    set [bossy v] to [15]\n    set [bosslocked v] to [0]\n    set [bossstate v] to [0]\n    set [bossyvel v] to [0]\n    set [bosshealth v] to [5]\n    wait (1) seconds\n    wait until <<([abs v] of (((BossX) * (28)) + (MapX)) ) < [235]> and <([abs v] of (((BossY) * (28)) + (MapY)) ) < [175]>>\n    set [bosslocked v] to [1]\n    repeat until <(BossHealth) < [0.1]>\n        wait (2) seconds\n        set [bossstate v] to [1]\n        set [bossyvel v] to ((([y position v] of [kirby v]) - (y position)) / (12))\n        wait until <([abs v] of (x position) ) > [227]>\n        if <(BossHealth) > [0]> then\n            SpikesBroke\n        end\n        set [bossstate v] to [2]\n        set [bossyvel v] to [9]\n        wait until <(BossYVel) = [0]>\n        wait (3) seconds\n        set [bossstate v] to [3]\n        if <([y position v] of [kirby v]) > (y position)> then\n            set [bossyvel v] to [14]\n        else\n            set [bossyvel v] to [9]\n        end\n        if <([x position v] of [kirby v]) > (x position)> then\n            point in direction (90)\n        else\n            point in direction (-90)\n        end\n        wait until <(BossYVel) < [4]>\n        set [bossstate v] to [4]\n        wait (1) seconds\n        set [bossstate v] to [5]\n        if <(BossHealth) > [0]> then\n            Spikes\n        end\n        wait (4) seconds\n        set [bossstate v] to [0]\n    end\nend\n\ndefine FindFloor\nrepeat until <not <<touching (map v)?> or <touching (semisolids v)?>>>\n    change y by (1)\nend\n\ndefine FindCeiling\nrepeat until <not <touching (map v)?>>\n    change y by (-1)\nend\n\nwhen I receive [costuming v]\nif <(Level) = [2]> then\n    switch costume to (8 v)\nelse\n    switch costume to (16 v)\nend\nif <(Level) = [2]> then\n    if <(BossHealth) > [0]> then\n        if <((BossHealth) mod (1)) < [0.4]> then\n            if <(BossState) = [0]> then\n                switch costume to ((([floor v] of ((Global#) * (24)) ) mod (4)) + (1))\n                if <((([floor v] of ((Global#) * (24)) ) mod (4)) + (1)) = [4]> then\n                    switch costume to (2 v)\n                end\n            else\n                if <(BossState) = [3]> then\n                    switch costume to (4 v)\n                else\n                    if <(BossState) = [4]> then\n                        change [bosssweeping v] by (0.05)\n                        if <(BossSweeping) > [0.5]> then\n                            switch costume to (6 v)\n                        else\n                            switch costume to (5 v)\n                        end\n                    else\n                        switch costume to (3 v)\n                    end\n                end\n            end\n        else\n            switch costume to (8 v)\n        end\n    else\n        if <(BossHealth) > [-1]> then\n            switch costume to (8 v)\n        end\n    end\n    if <not <((BossHealth) mod (1)) = [0]>> then\n        change [bosshealth v] by (-0.04)\n        set [bossyvel v] to [4]\n        if <((BossHealth) mod (1)) > [0.9]> then\n            set [bosshealth v] to (round (BossHealth))\n            if <(BossHealth) < [0.1]> then\n                start sound [Extinction of the Living Brooms. v]\n                set [bossyvel v] to [12]\n                change [bossy v] by (0.5)\n            end\n        end\n    end\nelse\n    if <(BossHealth) > [0]> then\n        if <((BossHealth) mod (1)) < [0.2]> then\n            if <(BossState) = [0]> then\n                switch costume to ((([floor v] of ((Global#) * (24)) ) mod (4)) + (9))\n                if <((([floor v] of ((Global#) * (24)) ) mod (4)) + (1)) = [4]> then\n                    switch costume to (10 v)\n                end\n            else\n                if <<(BossState) = [1]> or <(BossState) = [3]>> then\n                    switch costume to (12 v)\n                else\n                    if <<(BossState) = [2]> or <(BossState) = [5]>> then\n                        switch costume to (14 v)\n                    else\n                        if <(BossState) = [4]> then\n                            switch costume to (13 v)\n                        else\n                            if <((([floor v] of ((Global#) * (24)) ) mod (2)) + (1)) = [1]> then\n                                switch costume to (14 v)\n                            else\n                                switch costume to (15 v)\n                            end\n                        end\n                    end\n                end\n            end\n        else\n            if <((([floor v] of ((Global#) * (24)) ) mod (2)) + (1)) = [1]> then\n                switch costume to (14 v)\n            else\n                switch costume to (15 v)\n            end\n        end\n    else\n        switch costume to (16 v)\n    end\n    if <not <((BossHealth) mod (1)) = [0]>> then\n        change [bosshealth v] by (-0.04)\n        set [bossyvel v] to [4]\n        if <((BossHealth) mod (1)) > [0.9]> then\n            set [bosshealth v] to (round (BossHealth))\n            if <(BossHealth) < [0.1]> then\n                start sound [Extinction of the Living Brooms. v]\n                set [bossyvel v] to [12]\n                change [bossy v] by (0.5)\n            end\n        end\n    end\nend\n\ndefine BossScript\nif <(Level) = [2]> then\n    if <((BossHealth) mod (1)) < [0.4]> then\n        if <<<<(Ability) = [Spark]> and <(distance to [kirby v]) < [64]>> or <<(Ability) = [Spike]> and <(distance to [kirby v]) < [48]>>> and <not <(AbilityUse) = [0]>>> then\n            change [bosshealth v] by (-0.1)\n            start sound [Hit v]\n        else\n            switch costume to (normalhitbox v)\n            if <(BossState) = [0]> then\n                change [bossyvel v] by ((Gravity) / (6.1))\n                change y by ((Gravity) + (BossYVel))\n                if <not <((Gravity) + (BossYVel)) > [0]>> then\n                    switch costume to (hitboxfloor v)\n                end\n                if <<touching (map v)?> or <<touching (semisolids v)?> and <not <((Gravity) + (BossYVel)) > [0]>>>> then\n                    if <((Gravity) + (BossYVel)) > [0]> then\n                        set [bossyvel v] to [0]\n                        FindCeiling\n                    else\n                        set [bossyvel v] to [0]\n                        FindFloor\n                        if <([x position v] of [kirby v]) > (x position)> then\n                            point in direction (90)\n                        else\n                            point in direction (-90)\n                        end\n                    end\n                end\n            end\n            if <(BossState) = [1]> then\n                if <(BossYVel) = [0]> then\n                    set [bossyvel v] to [18]\n                    if <([x position v] of [kirby v]) > (x position)> then\n                        point in direction (90)\n                    else\n                        point in direction (-90)\n                    end\n                end\n                change [bossyvel v] by ((Gravity) / (6.1))\n                change y by ((Gravity) + (BossYVel))\n                if <not <((Gravity) + (BossYVel)) > [0]>> then\n                    switch costume to (hitboxfloor v)\n                end\n                if <<touching (map v)?> or <<touching (semisolids v)?> and <not <((Gravity) + (BossYVel)) > [0]>>>> then\n                    if <((Gravity) + (BossYVel)) > [0]> then\n                        set [bossyvel v] to [0]\n                        FindCeiling\n                    else\n                        set [bossyvel v] to [0]\n                        FindFloor\n                    end\n                end\n                switch costume to (normalhitbox v)\n                move (3) steps\n                if <touching (map v)?> then\n                    move (-3) steps\n                end\n            end\n            if <(BossState) = [3]> then\n                switch costume to (normalhitbox v)\n                move (5) steps\n                if <touching (map v)?> then\n                    move (-5) steps\n                end\n            end\n            switch costume to (hitbox v)\n            if <<touching (kirby v)?> and <(AllowDamage) = [1]>> then\n                broadcast (TakeDamage v)\n            end\n        end\n    end\n    switch costume to (hitbox v)\nelse\n    if <<<<(Ability) = [Spark]> and <(distance to [kirby v]) < [64]>> or <<(Ability) = [Spike]> and <(distance to [kirby v]) < [48]>>> and <<not <(AbilityUse) = [0]>> and <<((BossHealth) mod (1)) = [0]> and <<(BossState) = [5]> or <(BossState) = [2]>>>>> then\n        change [bosshealth v] by (-0.1)\n        start sound [Hit v]\n    else\n        switch costume to (hitbox2 v)\n        if <(BossState) = [0]> then\n            change [bossyvel v] by ((Gravity) / (6.1))\n            change y by ((Gravity) + (BossYVel))\n            if <not <((Gravity) + (BossYVel)) > [0]>> then\n                switch costume to (hitboxfloor v)\n            end\n            if <<touching (map v)?> or <<touching (semisolids v)?> and <not <((Gravity) + (BossYVel)) > [0]>>>> then\n                if <((Gravity) + (BossYVel)) > [0]> then\n                    set [bossyvel v] to [0]\n                    FindCeiling\n                else\n                    set [bossyvel v] to [0]\n                    FindFloor\n                end\n            end\n            move (((Global#) * (45)) mod (4)) steps\n            if <([x position v] of [kirby v]) > (x position)> then\n                point in direction (90)\n            else\n                point in direction (-90)\n            end\n        else\n            if <(BossState) = [1]> then\n                move (7) steps\n                if <(BossYVel) > [4]> then\n                    change [bossyvel v] by ((Gravity) / (6.1))\n                    change y by ((Gravity) + (BossYVel))\n                end\n            else\n                if <(BossState) = [2]> then\n                    change [bossyvel v] by ((Gravity) / (6.1))\n                    change y by ((Gravity) + (BossYVel))\n                    if <not <((Gravity) + (BossYVel)) > [0]>> then\n                        switch costume to (hitboxfloor v)\n                    end\n                    if <<touching (map v)?> or <<touching (semisolids v)?> and <not <((Gravity) + (BossYVel)) > [0]>>>> then\n                        if <((Gravity) + (BossYVel)) > [0]> then\n                            set [bossyvel v] to [0]\n                            FindCeiling\n                        else\n                            set [bossyvel v] to [0]\n                            FindFloor\n                        end\n                    else\n                        move (-2) steps\n                    end\n                else\n                    if <(BossState) = [3]> then\n                        change [bossyvel v] by ((Gravity) / (6.1))\n                        change y by ((Gravity) + (BossYVel))\n                        if <not <((Gravity) + (BossYVel)) > [0]>> then\n                            switch costume to (hitboxfloor v)\n                        end\n                        if <<touching (map v)?> or <<touching (semisolids v)?> and <not <((Gravity) + (BossYVel)) > [0]>>>> then\n                            if <((Gravity) + (BossYVel)) > [0]> then\n                                set [bossyvel v] to [0]\n                                FindCeiling\n                            else\n                                set [bossyvel v] to [0]\n                                FindFloor\n                            end\n                        end\n                    else\n                        if <(BossState) = [4]> then\n                            change y by ((([y position v] of [kirby v]) - (y position)) / (8))\n                            if <touching (map v)?> then\n                                FindFloor\n                            end\n                            if <([x position v] of [kirby v]) > (x position)> then\n                                point in direction (90)\n                            else\n                                point in direction (-90)\n                            end\n                            move (2) steps\n                        else\n                            if <(BossState) = [5]> then\n                                change y by (([sin v] of ((Global#) * (1080)) ) * (1))\n                                if <touching (map v)?> then\n                                    FindFloor\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        if <<((BossHealth) mod (1)) < [0.2]> and <not <(BossState) = [2]>>> then\n            if <<touching (kirby v)?> and <(AllowDamage) = [1]>> then\n                broadcast (TakeDamage v)\n            end\n        end\n    end\nend\nif <([abs v] of (x position) ) > [230]> then\n    set x to ((([abs v] of (x position) ) / (x position)) * (230))\nend\nset [bossx v] to (((x position) - (MapX)) / (28))\nset [bossy v] to (((y position) - (MapY)) / (28))\n\ndefine Clean\nadd (direction) to [attackdir v]\nadd [0] to [attackstate v]\nadd [8] to [attacktype v]\nadd (((x position) - (MapX)) / (28)) to [attackx v]\nadd ((((y position) - (12)) - (MapY)) / (28)) to [attacky v]\nadd [0] to [playerowned v]\n\nwhen I receive [attackhit v]\nif <<<([abs v] of ((x position) - (AttackX)) ) < [56]> and <([abs v] of ((y position) - (AttackY)) ) < [84]>> and <<(BossHealth) > [0]> and <((BossHealth) mod (1)) = [0]>>> then\n    if <(Level) = [2]> then\n        change [bosshealth v] by (-0.1)\n        start sound [Hit v]\n    else\n        if <<(BossState) = [2]> or <(BossState) = [5]>> then\n            change [bosshealth v] by (-0.1)\n            start sound [Hit v]\n        end\n    end\nend\n\ndefine DeadScript\nif <(Level) = [2]> then\n    switch costume to (normalhitbox v)\nelse\n    switch costume to (hitbox2 v)\nend\nshow\nif <<<<([x position v] of [kirby v]) > ((x position) + (6))> and <([direction v] of [kirby v]) = [-90]>> or <<not <([x position v] of [kirby v]) > ((x position) - (6))>> and <([direction v] of [kirby v]) = [90]>>> and <<not <(Sucking) = [0]>> and <(distance to [kirby v]) < [90]>>> then\n    change y by (-4)\n    point towards (kirby v)\n    change y by (4)\n    move ([abs v] of (((distance to [kirby v]) / (18)) - (6)) ) steps\n    if <(distance to [kirby v]) < [32]> then\n        set [holding v] to [1]\n        set [allowshot v] to [0]\n        if <(Level) = [2]> then\n            set [holdingtype v] to [Clean]\n        else\n            set [holdingtype v] to [Spike]\n        end\n        set [bosshealth v] to [-1]\n    end\nelse\n    show\n    change [bossyvel v] by ((Gravity) / (6.1))\n    change y by ((Gravity) + (BossYVel))\n    if <not <((Gravity) + (BossYVel)) > [0]>> then\n        switch costume to (hitboxfloor v)\n    end\n    if <<touching (map v)?> or <<touching (semisolids v)?> and <not <((Gravity) + (BossYVel)) > [0]>>>> then\n        if <((Gravity) + (BossYVel)) > [0]> then\n            set [bossyvel v] to [0]\n            FindCeiling\n        else\n            set [bossyvel v] to [0]\n            FindFloor\n        end\n    end\n    switch costume to (normalhitbox v)\nend\nset [bossx v] to (((x position) - (MapX)) / (28))\nset [bossy v] to (((y position) - (MapY)) / (28))\n\ndefine SidePuffs\nadd [90] to [attackdir v]\nadd [0] to [attackstate v]\nadd [9] to [attacktype v]\nadd (((x position) - (MapX)) / (28)) to [attackx v]\nadd ((((y position) - (14)) - (MapY)) / (28)) to [attacky v]\nadd [0] to [playerowned v]\nadd [-90] to [attackdir v]\nadd [0] to [attackstate v]\nadd [9] to [attacktype v]\nadd (((x position) - (MapX)) / (28)) to [attackx v]\nadd ((((y position) - (14)) - (MapY)) / (28)) to [attacky v]\nadd [0] to [playerowned v]\n\ndefine Spikes\nadd (direction) to [attackdir v]\nadd [0] to [attackstate v]\nadd [10] to [attacktype v]\nadd ((((x position) + ((direction) / (9))) - (MapX)) / (28)) to [attackx v]\nadd (((y position) - (MapY)) / (28)) to [attacky v]\nadd [0] to [playerowned v]\n\ndefine SpikesBroke\nadd ((direction) / (-9)) to [attackdir v]\nadd [1] to [attackstate v]\nadd [10] to [attacktype v]\nadd (((x position) - (MapX)) / (28)) to [attackx v]\nadd (((y position) - (MapY)) / (28)) to [attacky v]\nadd [0] to [playerowned v]\n\n@Doors\n\nwhen I receive [first v]\nshow\nif <(DoorCooldown) > [0]> then\n    change [doorcooldown v] by (-0.2)\n    if <(DoorCooldown) < [0]> then\n        set [doorcooldown v] to [0]\n    end\nend\nswitch costume to (empty v)\nset size to (350) %\nswitch costume to (join [Part] ((Level) * (2)))\ngo to x: ((MapX) + ((480) * (3.5))) y: (MapY)\nif <<<touching (kirby v)?> and <key (down arrow v) pressed?>> and <<<(DoorCooldown) = [0]> and <(Holding) = [0]>> and <(YVel) = [0]>>> then\n    start sound [Door v]\n    set [allowdamage v] to [0]\n    set [doorcooldown v] to [15]\n    change [doorspassed v] by (1)\n    set [abilityuse v] to [0]\n    broadcast (Door v)\nend\nhide\n\nwhen I receive [resetall v]\nif <[1] = [1]> then\n    delete this clone\nend\n\nstart sound [Door v]\nset [allowdamage v] to [0]\nset [doorcooldown v] to [15]\nchange [doorspassed v] by (1)\nset [abilityuse v] to [0]\nbroadcast (Door v)\n\n@Background\n\nwhen I receive [costuming v]\ngo to [back v] layer\nswitch costume to (empty v)\nset size to (430.5) %\nswitch costume to (round (Level))\ngo to x: ((((MapX) * (0.6)) mod ((128) * (4.3))) + ((Clone#) * ((-128) * (4.3)))) y: (1)\n\nwhen I receive [resetall v]\nif <[1] = [1]> then\n    delete this clone\nend\nset [clone# v] to [1]\ncreate clone of (_myself_ v)\nset [clone# v] to [0]\ngo to x: (0) y: (0)\nset [global# v] to [0]\nforever\n    change [global# v] by (0.01)\n    if <(AbilityUse) = [0]> then\n        if <key (right arrow v) pressed?> then\n            change [cameraoffset v] by (0.05)\n            if <(CameraOffset) > [1]> then\n                set [cameraoffset v] to [1]\n            end\n        else\n            if <key (left arrow v) pressed?> then\n                change [cameraoffset v] by (-0.05)\n                if <(CameraOffset) < [-1]> then\n                    set [cameraoffset v] to [-1]\n                end\n            else\n                if <([abs v] of (XVel) ) < [0.05]> then\n                    set [cameraoffset v] to ((CameraOffset) / (1.1))\n                end\n            end\n        end\n    end\n    if <(BossLocked) = [0]> then\n        change [mapx v] by (((((PlayerX) + ((CameraOffset) * (120))) * (-1)) - (MapX)) / (6))\n    end\n    if <(MapX) > [600]> then\n        set [mapx v] to [600]\n    end\n    if <(MapX) < [-2280]> then\n        set [mapx v] to [-2280]\n    end\n    broadcast (First v)\nend\n\n@Foreground\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [clone# v] to [1]\ncreate clone of (_myself_ v)\nset [clone# v] to [0]\n\nwhen I receive [costuming v]\ngo to [front v] layer\ngo [backward v] (9) layers\nswitch costume to (empty v)\nset size to (431) %\nswitch costume to (Level)\ngo to x: ((((MapX) * (1.4)) mod ((128) * (4.3))) + ((Clone#) * ((-128) * (4.3)))) y: (-138)\nif <(Level) = [1]> then\n    clear graphic effects\n    set [fisheye v] effect to (([sin v] of ((Global#) * (180)) ) * (2))\nelse\n    clear graphic effects\n    set [ghost v] effect to (25)\nend\n\n@SemiSolids\n\nwhen I receive [first v]\nshow\nswitch costume to (empty v)\nset size to (350) %\nif <(Clone#) = [1]> then\n    switch costume to (join (join [Part] ((Level) * (2))) [Coll])\nelse\n    switch costume to (join (join [Part] (((Level) * (2)) - (1))) [Coll])\nend\ngo to x: ((MapX) + ((Clone#) * ((480) * (3.5)))) y: (MapY)\n\nwhen flag clicked\nset [clone# v] to [1]\ncreate clone of (_myself_ v)\nset [clone# v] to [0]\n\nwhen I receive [costuming v]\nhide\n\n@Border\n\n@Attacks\n\nwhen I receive [fourth v]\nif <[1] = [1]> then\n    delete this clone\nend\nDeleteStuff\nLoadAttacks\nbroadcast (Costuming v)\n\ndefine LoadAttacks\nshow\nset [scan# v] to [0]\nrepeat (length of [attackx v])\n    change [scan# v] by (1)\n    if <<<([abs v] of (((item (Scan#) of [attackx v]) * (28)) + (MapX)) ) < [235]> and <([abs v] of (((item (Scan#) of [attacky v]) * (28)) + (MapY)) ) < [175]>> or <(item (Scan#) of [attacktype v]) = [4]>> then\n        go to x: (((item (Scan#) of [attackx v]) * (28)) + (MapX)) y: (((item (Scan#) of [attacky v]) * (28)) + (MapY))\n        point in direction (item (Scan#) of [attackdir v])\n        create clone of (_myself_ v)\n    end\nend\nhide\n\nwhen I start as a clone\nswitch costume to (hitbox v)\nset rotation style [left-right v]\nif <(item (Scan#) of [attacktype v]) = [1]> then\n    move ((12) - ((item (Scan#) of [attackstate v]) * (2))) steps\n    if <<<touching (enemies v)?> or <touching (boss v)?>> or <touching (blocks v)?>> then\n        set [attackx v] to (x position)\n        set [attacky v] to (y position)\n        broadcast (AttackHit v)\n        add (Scan#) to [deleteattacks v]\n    end\n    replace item (Scan#) of [attackx v] with (((x position) - (MapX)) / (28))\n    replace item (Scan#) of [attackstate v] with ((item (Scan#) of [attackstate v]) + (0.5))\n    if <(item (Scan#) of [attackstate v]) > [6]> then\n        add (Scan#) to [deleteattacks v]\n    end\nend\nif <(item (Scan#) of [attacktype v]) = [2]> then\n    change y by (-4)\n    point towards (kirby v)\n    change y by (4)\n    move (((distance to [kirby v]) / (24)) + (1)) steps\n    replace item (Scan#) of [attackx v] with (((x position) - (MapX)) / (28))\n    replace item (Scan#) of [attacky v] with (((y position) - (MapY)) / (28))\n    if <<(distance to [kirby v]) < [24]> or <(Sucking) = [0]>> then\n        add (Scan#) to [deleteattacks v]\n    end\nend\nif <(item (Scan#) of [attacktype v]) = [3]> then\n    if <<touching (map v)?> or <touching (blocks v)?>> then\n        add (Scan#) to [deleteattacks v]\n    end\n    move (7) steps\n    if <<<touching (enemies v)?> or <touching (boss v)?>> or <touching (blocks v)?>> then\n        set [attackx v] to (x position)\n        set [attacky v] to (y position)\n        broadcast (AttackHit v)\n        add (Scan#) to [deleteattacks v]\n    end\n    replace item (Scan#) of [attackx v] with (((x position) - (MapX)) / (28))\n    replace item (Scan#) of [attacky v] with (((y position) - (MapY)) / (28))\nend\nif <(item (Scan#) of [attacktype v]) = [4]> then\n    replace item (Scan#) of [attackstate v] with ((item (Scan#) of [attackstate v]) + (0.5))\n    move ((12.5) - (item (Scan#) of [attackstate v])) steps\n    replace item (Scan#) of [attackx v] with (((x position) - (MapX)) / (28))\n    replace item (Scan#) of [attacky v] with (((y position) - (MapY)) / (28))\n    if <(item (Scan#) of [playerowned v]) = [1]> then\n        if <<<touching (enemies v)?> or <touching (boss v)?>> or <touching (blocks v)?>> then\n            set [attackx v] to (x position)\n            set [attacky v] to (y position)\n            broadcast (AttackHit v)\n            add (Scan#) to [deleteattacks v]\n        end\n        if <<<(item (Scan#) of [attackstate v]) > [12]> and <touching (kirby v)?>> or <([abs v] of (x position) ) > [230]>> then\n            add (Scan#) to [deleteattacks v]\n        end\n    else\n        if <<touching (kirby v)?> and <(AllowDamage) = [1]>> then\n            broadcast (TakeDamage v)\n            add (Scan#) to [deleteattacks v]\n        end\n        if <<<(item (Scan#) of [attackstate v]) > [12]> and <touching (enemies v)?>> or <([abs v] of (x position) ) > [230]>> then\n            add (Scan#) to [deleteattacks v]\n        end\n    end\nend\nif <(item (Scan#) of [attacktype v]) = [5]> then\n    if <<<<([x position v] of [kirby v]) > ((x position) + (6))> and <([direction v] of [kirby v]) = [-90]>> or <<not <([x position v] of [kirby v]) > ((x position) - (6))>> and <([direction v] of [kirby v]) = [90]>>> and <<not <(Sucking) = [0]>> and <(distance to [kirby v]) < [90]>>> then\n        change y by (-4)\n        point towards (kirby v)\n        change y by (4)\n        move ([abs v] of (((distance to [kirby v]) / (18)) - (6)) ) steps\n        replace item (Scan#) of [attackx v] with (((x position) - (MapX)) / (28))\n        replace item (Scan#) of [attacky v] with (((y position) - (MapY)) / (28))\n        if <(distance to [kirby v]) < [20]> then\n            set [holding v] to [1]\n            set [allowshot v] to [0]\n            set [holdingtype v] to (item (Scan#) of [playerowned v])\n            add (Scan#) to [deleteattacks v]\n        end\n    else\n        if <(item (Scan#) of [attackstate v]) < [3]> then\n            move (4) steps\n            change y by (([cos v] of (direction) ) * (4))\n            if <(direction) > [0]> then\n                turn right (4) degrees\n                if <(direction) > [135]> then\n                    point in direction (135)\n                end\n            else\n                turn left (4) degrees\n                if <(direction) < [-135]> then\n                    point in direction (-135)\n                end\n            end\n            if <<<touching (map v)?> or <touching (blocks v)?>> or <<touching (semisolids v)?> and <([abs v] of (direction) ) > [90]>>> then\n                if <not <<touching (semisolids v)?> and <([abs v] of (direction) ) > [90]>>> then\n                    replace item (Scan#) of [attackstate v] with ((item (Scan#) of [attackstate v]) + (1))\n                end\n                move (-4) steps\n                if <([abs v] of (direction) ) > [90]> then\n                    point in direction ((180) - (direction))\n                else\n                    point in direction ((direction) * (-1))\n                end\n                move (4) steps\n            end\n            replace item (Scan#) of [attackdir v] with (direction)\n            replace item (Scan#) of [attackx v] with (((x position) - (MapX)) / (28))\n            replace item (Scan#) of [attacky v] with (((y position) - (MapY)) / (28))\n        end\n    end\nend\nif <(item (Scan#) of [attacktype v]) = [6]> then\n    if <(item (Scan#) of [attackstate v]) = [0]> then\n        move (6) steps\n    end\n    move ((9) - ((item (Scan#) of [attackstate v]) * (2))) steps\n    if <(item (Scan#) of [playerowned v]) = [0]> then\n        if <<touching (kirby v)?> and <(AllowDamage) = [1]>> then\n            broadcast (TakeDamage v)\n        end\n    end\n    replace item (Scan#) of [attackx v] with (((x position) - (MapX)) / (28))\n    replace item (Scan#) of [attacky v] with (((y position) - (MapY)) / (28))\n    replace item (Scan#) of [attackstate v] with ((item (Scan#) of [attackstate v]) + (0.5))\n    if <(item (Scan#) of [attackstate v]) > [5]> then\n        add (Scan#) to [deleteattacks v]\n    end\nend\nif <(item (Scan#) of [attacktype v]) = [7]> then\n    if <(item (Scan#) of [playerowned v]) = [1]> then\n        move ((9) - ((item (Scan#) of [attackstate v]) * (1))) steps\n    else\n        move ((5) - ((item (Scan#) of [attackstate v]) * (0.5))) steps\n    end\n    change y by (0.5)\n    replace item (Scan#) of [attackx v] with (((x position) - (MapX)) / (28))\n    replace item (Scan#) of [attacky v] with (((y position) - (MapY)) / (28))\n    replace item (Scan#) of [attackstate v] with ((item (Scan#) of [attackstate v]) + (0.8))\n    if <(item (Scan#) of [playerowned v]) = [1]> then\n        if <<<touching (enemies v)?> or <touching (boss v)?>> or <touching (blocks v)?>> then\n            set [attackx v] to (x position)\n            set [attacky v] to (y position)\n            broadcast (AttackHit v)\n            add (Scan#) to [deleteattacks v]\n        end\n    else\n        if <<touching (kirby v)?> and <(AllowDamage) = [1]>> then\n            broadcast (TakeDamage v)\n            add (Scan#) to [deleteattacks v]\n        end\n    end\n    if <(item (Scan#) of [attackstate v]) > [9]> then\n        add (Scan#) to [deleteattacks v]\n    end\nend\nif <(item (Scan#) of [attacktype v]) = [8]> then\n    move ((9) - ((item (Scan#) of [attackstate v]) * (1))) steps\n    change y by (0.5)\n    replace item (Scan#) of [attackx v] with (((x position) - (MapX)) / (28))\n    replace item (Scan#) of [attacky v] with (((y position) - (MapY)) / (28))\n    replace item (Scan#) of [attackstate v] with ((item (Scan#) of [attackstate v]) + (0.8))\n    if <<touching (kirby v)?> and <(AllowDamage) = [1]>> then\n        broadcast (TakeDamage v)\n        add (Scan#) to [deleteattacks v]\n    end\n    if <(item (Scan#) of [attackstate v]) > [9]> then\n        add (Scan#) to [deleteattacks v]\n    end\nend\nif <(item (Scan#) of [attacktype v]) = [9]> then\n    if <<<<([x position v] of [kirby v]) > ((x position) + (6))> and <([direction v] of [kirby v]) = [-90]>> or <<not <([x position v] of [kirby v]) > ((x position) - (6))>> and <([direction v] of [kirby v]) = [90]>>> and <<not <(Sucking) = [0]>> and <(distance to [kirby v]) < [90]>>> then\n        change y by (-4)\n        point towards (kirby v)\n        change y by (4)\n        move ([abs v] of (((distance to [kirby v]) / (18)) - (6)) ) steps\n        if <(distance to [kirby v]) < [20]> then\n            set [holding v] to [1]\n            set [allowshot v] to [0]\n            add (Scan#) to [deleteattacks v]\n            set [holdingtype v] to [None]\n        end\n        replace item (Scan#) of [attackx v] with (((x position) - (MapX)) / (28))\n        replace item (Scan#) of [attacky v] with (((y position) - (MapY)) / (28))\n    else\n        if <(item (Scan#) of [attackstate v]) < [1]> then\n            move ((6) - ((item (Scan#) of [attackstate v]) * (6))) steps\n        end\n        if <(item (Scan#) of [attackstate v]) < [6]> then\n            replace item (Scan#) of [attackstate v] with ((item (Scan#) of [attackstate v]) + (0.08))\n        else\n            add (Scan#) to [deleteattacks v]\n        end\n        replace item (Scan#) of [attackx v] with (((x position) - (MapX)) / (28))\n        replace item (Scan#) of [attacky v] with (((y position) - (MapY)) / (28))\n    end\nend\nif <(item (Scan#) of [attacktype v]) = [10]> then\n    if <(item (Scan#) of [attackstate v]) = [0]> then\n        switch costume to (hitbox2 v)\n        move (6) steps\n        if <<touching (kirby v)?> and <(AllowDamage) = [1]>> then\n            broadcast (TakeDamage v)\n        end\n        if <<([abs v] of (x position) ) > [225]> or <(BossLocked) = [0]>> then\n            switch costume to (hitbox v)\n            move (-6) steps\n            point in direction ((direction) / (-18))\n            move (2) steps\n            replace item (Scan#) of [attackstate v] with [1]\n            replace item (Scan#) of [attackdir v] with (direction)\n        end\n    end\n    if <(item (Scan#) of [attackstate v]) = [1]> then\n        if <<<<([x position v] of [kirby v]) > ((x position) + (6))> and <([direction v] of [kirby v]) = [-90]>> or <<not <([x position v] of [kirby v]) > ((x position) - (6))>> and <([direction v] of [kirby v]) = [90]>>> and <<not <(Sucking) = [0]>> and <(distance to [kirby v]) < [90]>>> then\n            change y by (-4)\n            point towards (kirby v)\n            change y by (4)\n            move ([abs v] of (((distance to [kirby v]) / (18)) - (6)) ) steps\n            if <(distance to [kirby v]) < [20]> then\n                set [holding v] to [1]\n                set [allowshot v] to [0]\n                add (Scan#) to [deleteattacks v]\n                set [holdingtype v] to [None]\n            end\n        else\n            if <not <(item (Scan#) of [attackdir v]) = [0]>> then\n                if <(item (Scan#) of [attackdir v]) > [0]> then\n                    turn right (5) degrees\n                    if <(direction) > [160]> then\n                        point in direction (160)\n                    end\n                else\n                    turn left (5) degrees\n                    if <(direction) < [-160]> then\n                        point in direction (-160)\n                    end\n                end\n                replace item (Scan#) of [attackdir v] with (direction)\n                move (4) steps\n                if <<touching (map v)?> and <([abs v] of (item (Scan#) of [attackdir v]) ) > [90]>> then\n                    replace item (Scan#) of [attackdir v] with [0]\n                    FindFloor\n                end\n            end\n        end\n    end\n    replace item (Scan#) of [attackx v] with (((x position) - (MapX)) / (28))\n    replace item (Scan#) of [attacky v] with (((y position) - (MapY)) / (28))\nend\n\ndefine DeleteStuff\nrepeat (length of [deleteattacks v])\n    delete (item (1) of [deleteattacks v]) of [attackdir v]\n    delete (item (1) of [deleteattacks v]) of [attackstate v]\n    delete (item (1) of [deleteattacks v]) of [attacktype v]\n    delete (item (1) of [deleteattacks v]) of [attackx v]\n    delete (item (1) of [deleteattacks v]) of [attacky v]\n    delete (item (1) of [deleteattacks v]) of [playerowned v]\n    delete (1) of [deleteattacks v]\nend\n\nwhen I receive [costuming v]\nif <(item (Scan#) of [attacktype v]) = [1]> then\n    switch costume to (1 v)\nend\nif <(item (Scan#) of [attacktype v]) = [2]> then\n    switch costume to (2 v)\n    if <([sin v] of ((Global#) * (2160)) ) > [0]> then\n        set rotation style [all around v]\n        point in direction (-90)\n    end\nend\nif <(item (Scan#) of [attacktype v]) = [3]> then\n    switch costume to ((([floor v] of ((Global#) * (60)) ) mod (4)) + (3))\nend\nif <(item (Scan#) of [attacktype v]) = [4]> then\n    if <(item (Scan#) of [playerowned v]) = [1]> then\n        switch costume to ((([floor v] of ((Global#) * (45)) ) mod (4)) + (19))\n    else\n        switch costume to ((([floor v] of ((Global#) * (45)) ) mod (4)) + (7))\n    end\nend\nif <(item (Scan#) of [attacktype v]) = [5]> then\n    switch costume to ((([floor v] of ((Global#) * (60)) ) mod (4)) + (3))\nend\nif <(item (Scan#) of [attacktype v]) = [6]> then\n    switch costume to ((([floor v] of ((Global#) * (96)) ) mod (2)) + (11))\nend\nif <(item (Scan#) of [attacktype v]) = [7]> then\n    if <(item (Scan#) of [attackstate v]) > [4]> then\n        switch costume to (15 v)\n    else\n        if <(item (Scan#) of [attackstate v]) > [2.5]> then\n            switch costume to (14 v)\n        else\n            switch costume to (13 v)\n        end\n    end\nend\nif <(item (Scan#) of [attacktype v]) = [8]> then\n    if <(item (Scan#) of [attackstate v]) > [4]> then\n        switch costume to (18 v)\n    else\n        if <(item (Scan#) of [attackstate v]) > [2.5]> then\n            switch costume to (17 v)\n        else\n            switch costume to (16 v)\n        end\n    end\nend\nif <(item (Scan#) of [attacktype v]) = [9]> then\n    if <(item (Scan#) of [attackstate v]) > [0.99]> then\n        switch costume to ((([floor v] of ((Global#) * (48)) ) mod (4)) + (3))\n    else\n        if <(item (Scan#) of [attackstate v]) > [0.66]> then\n            switch costume to (18 v)\n        else\n            if <(item (Scan#) of [attackstate v]) > [0.33]> then\n                switch costume to (17 v)\n            else\n                switch costume to (16 v)\n            end\n        end\n    end\nend\nif <(item (Scan#) of [attacktype v]) = [10]> then\n    if <(item (Scan#) of [attackstate v]) = [1]> then\n        switch costume to (24 v)\n    else\n        switch costume to (23 v)\n    end\nend\n\nwhen I receive [resetall v]\nif <[1] = [1]> then\n    delete this clone\nend\nswitch costume to (1 v)\nset rotation style [left-right v]\ngo to x: (0) y: (0)\nset size to (350) %\nhide\nClearAttacks\n\nif <(item (Scan#) of [playerowned v]) = [1]> then\n    if <<touching (enemies v)?> or <touching (blocks v)?>> then\n        set [attackx v] to (x position)\n        set [attacky v] to (y position)\n        broadcast (AttackHit v)\n        add (Scan#) to [deleteattacks v]\n    end\nelse\n    if <<touching (kirby v)?> and <(AllowDamage) = [1]>> then\n        broadcast (TakeDamage v)\n    end\nend\n\ndefine ClearAttacks\ndelete all of [attackdir v]\ndelete all of [attackstate v]\ndelete all of [attacktype v]\ndelete all of [attackx v]\ndelete all of [attacky v]\ndelete all of [playerowned v]\ndelete all of [deleteattacks v]\n\nwhen I receive [door v]\nif <[1] = [1]> then\n    delete this clone\nend\nswitch costume to (1 v)\nset rotation style [left-right v]\ngo to x: (0) y: (0)\nset size to (350) %\nhide\nClearAttacks\n\ndefine FindFloor\nrepeat until <not <touching (map v)?>>\n    change y by (1)\nend\n\n@Overlay\n\nwhen I receive [door v]\nset [allowmovement v] to [0]\nshow\nif <((DoorsPassed) mod (3)) = [0]> then\n    show\n    switch costume to (empty v)\n    set size to (5000) %\n    switch costume to (circle v)\n    go to (kirby v)\n    repeat (24)\n        switch costume to (empty v)\n        change size by (-175)\n        switch costume to (circle v)\n    end\n    wait (1) seconds\n    repeat (5)\n        switch costume to (empty v)\n        change size by (-100)\n        switch costume to (circle v)\n    end\n    switch costume to (empty v)\n    set size to (100) %\n    switch costume to (costume1 v)\n    go to x: (0) y: (0)\n    wait (0.5) seconds\n    change [level v] by (1)\n    if <(Level) > [3]> then\n        switch costume to (empty v)\n        set size to (225) %\n        switch costume to (end v)\n        go to x: (0) y: (0)\n        set [brightness v] effect to (-100)\n        wait (0.5) seconds\n        repeat (10)\n            change [brightness v] effect by (10)\n        end\n        reset timer\n        forever\n            switch costume to (empty v)\n            set size to ((([sin v] of (((timer) * (103)) * (1)) ) * (10)) + (225)) %\n            switch costume to (end v)\n        end\n    else\n        switch costume to (empty v)\n        set size to (225) %\n        switch costume to (join [Level] (Level))\n        go to x: (0) y: (0)\n        set [brightness v] effect to (-100)\n        repeat (10)\n            change [brightness v] effect by (10)\n        end\n        wait (2) seconds\n        if <(Level) = [2]> then\n            start sound [LevelChange v]\n        end\n        repeat (10)\n            change [brightness v] effect by (-10)\n        end\n        broadcast (ResetAll v)\n        wait (0.2) seconds\n        switch costume to (empty v)\n        set size to (100) %\n        switch costume to (circle v)\n        set [allowmovement v] to [1]\n        set [allowdamage v] to [1]\n        repeat (30)\n            switch costume to (empty v)\n            change size by (160)\n            switch costume to (circle v)\n        end\n        clear graphic effects\n        hide\n    end\nelse\n    switch costume to (empty v)\n    set size to (5000) %\n    switch costume to (circle v)\n    go to (kirby v)\n    repeat (30)\n        switch costume to (empty v)\n        change size by (-160)\n        switch costume to (circle v)\n    end\n    switch costume to (empty v)\n    set size to (100) %\n    switch costume to (costume1 v)\n    go to x: (0) y: (0)\n    wait (0.5) seconds\n    switch costume to (empty v)\n    set size to (100) %\n    switch costume to (circle v)\n    set [allowmovement v] to [1]\n    set [allowdamage v] to [1]\n    repeat (30)\n        switch costume to (empty v)\n        change size by (160)\n        switch costume to (circle v)\n    end\n    hide\nend\n\nwhen flag clicked\npoint in direction (90)\nset [level v] to [0]\nbroadcast (ResetAll v)\nset [doorspassed v] to [0]\nset [allowmovement v] to [0]\nclear graphic effects\nset [brightness v] effect to (-100)\nswitch costume to (empty v)\nset size to (200) %\nswitch costume to (warning2 v)\ngo to x: (-18) y: (0)\nshow\nwait (0.5) seconds\nbroadcast (ResetAll v)\nset [allowmovement v] to [0]\nset [level v] to [1]\nset [doorspassed v] to (((Level) - (1)) * (3))\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nwait (4) seconds\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nwait (0.5) seconds\nswitch costume to (empty v)\nset size to (170) %\nswitch costume to (logo1 v)\ngo to x: (0) y: (0)\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nwait (2) seconds\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nwait (1) seconds\nswitch costume to (empty v)\nset size to (225) %\nswitch costume to (join [Level] (Level))\ngo to x: (0) y: (0)\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nwait (1.5) seconds\nbroadcast (ResetAll v)\nwait (0.5) seconds\nstart sound [LevelChange v]\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nwait (0.2) seconds\nswitch costume to (empty v)\nset size to (100) %\nswitch costume to (circle v)\nset [allowmovement v] to [1]\nrepeat (30)\n    switch costume to (empty v)\n    change size by (160)\n    switch costume to (circle v)\nend\nclear graphic effects\n\nwhen I receive [fade v]\nshow\nswitch costume to (empty v)\nset size to (5000) %\nswitch costume to (circle v)\ngo to x: (0) y: (0)\nrepeat (30)\n    switch costume to (empty v)\n    change size by (-160)\n    switch costume to (circle v)\nend\nswitch costume to (empty v)\nset size to (100) %\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nwait (0.5) seconds\nswitch costume to (empty v)\nset size to (100) %\nswitch costume to (circle v)\nset [allowmovement v] to [1]\nrepeat (30)\n    switch costume to (empty v)\n    change size by (160)\n    switch costume to (circle v)\nend\nhide\n\n@HUD\n\nwhen I receive [first v]\nhide\nif <[1] = [1]> then\n    delete this clone\nend\nshow\nHealth\ngo to x: (-200) y: (-140)\nswitch costume to (Ability)\n\nwhen I receive [resetall v]\nhide\ngo to x: (0) y: (0)\nset size to (350) %\n\ndefine Health\ngo to x: (-168) y: (-162)\nset [myno. v] to [0]\nrepeat (5)\n    change [myno. v] by (1)\n    change x by (28)\n    if <(Health) > ((MyNo.) - (0.1))> then\n        switch costume to (full v)\n    else\n        if <(Health) > ((MyNo.) - (0.6))> then\n            switch costume to (half v)\n        else\n            switch costume to (empty v)\n        end\n    end\n    create clone of (_myself_ v)\nend\n\n@Thumbnail\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\ngo to [front v] layer\nrepeat (5)\n    change [pixelate v] effect by (5)\nend\nrepeat (10)\n    change [pixelate v] effect by (15)\n    change [ghost v] effect by (10)\nend\nclear graphic effects\nset [ghost v] effect to (100)\ngo to [front v] layer\n\n
#13 on trending?!? \nAlso go follow @k0stya because I owe him SO much credit for this.\nArrow keys to rotate the camera, WASD to move and Space Bar to jump.\n0 to skip a level.\n4 levels in total.\nYellow is bouncy.\nRed is lava.\nNeon Blue is platform.\nGreen is the goal.