Platformer Demo copy-2

Instructions:   Arrow keys or AWSD, get to the right edge or maybe collect the yellow things, or just whatever.\n  You can both wall jump (Make sure to switch walls.) and ground-pound (Jump up and press down before you start falling too hard.).\nJust got the key working, Yay! Although, it doesn't really do anything yet. Press down to grab and throw it.   More down there ↴\n\nI plan on adding unlock-able hats! Press H to test them out. Comment different types you could get. So far I've thought of (Although not added most of these.) : Fez, Top hat, Sombrero, Bowler hat, Chef hat, Propeller Beanie, Mustachioed disguise, and Construction hat.\n

@Stage\n\n@Bob\n\nwhen flag clicked\nhide\nset [level v] to [1]\nset [drawing v] to [1]\nbroadcast (NewLevel v)\n\nwhen I receive [newlevel v]\nshow\ngo to x: (-228) y: (-85)\npoint in direction (90)\nwait until <(drawing) = [0]>\nset rotation style [left-right v]\nset [yvel v] to [0]\nset [xvel v] to [0]\nset [groundpound v] to [0]\nset [holding v] to []\nforever\n    broadcast (Loop v)\n    if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n        if <(groundPound) = [0]> then\n            change [xvel v] by (1.5)\n            point in direction (90)\n        end\n    end\n    if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n        if <(groundPound) = [0]> then\n            change [xvel v] by (-1.5)\n            point in direction (-90)\n        end\n    end\n    set [xvel v] to ((xVel) * (0.75))\n    change x by (xVel)\n    if <touching (ground v)?> then\n        change y by (1)\n        if <touching (ground v)?> then\n            change y by (1)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (1)\n                        if <touching (ground v)?> then\n                            change x by ((xVel) * (-1))\n                            change y by (-5)\n                            if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> and <([abs v] of ((x position) - (lastWallJump)) ) > [5]>> then\n                                set [xvel v] to (((xVel) / ([abs v] of (xVel) )) * (-5))\n                                set [yvel v] to [7]\n                                set [lastwalljump v] to (x position)\n                                change [walljumps v] by (1)\n                                if <not <[achievements v] contains [wall]?>> then\n                                    if <(wallJumps) = [2]> then\n                                        broadcast (Wall Jump v)\n                                        set [bonus v] to [200]\n                                        change [score v] by (bonus)\n                                        broadcast (Bonus v)\n                                        broadcast (NewScore v)\n                                    end\n                                end\n                            else\n                                set [xvel v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <(groundPound) = [0]> then\n        change [yvel v] by (-0.8)\n    end\n    change y by (yVel)\n    if <touching (ground v)?> then\n        Set Y\n        if <(yVel) < [-14]> then\n            broadcast (HardGroundImpact v)\n        end\n        set [yvel v] to [0]\n        set [groundpound v] to [0]\n    else\n    end\n    change y by (-1)\n    if <touching (ground v)?> then\n        set [lastwalljump v] to []\n        set [ground v] to [1]\n        set [groundpound v] to [0]\n        set [canpound v] to [1]\n        set [walljumps v] to [0]\n        if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n            set [yvel v] to [10]\n        end\n        if <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n            if <not <(holding) = []>> then\n                if <(ItemTouching) = [0]> then\n                    if <(canThrough) = [1]> then\n                        set [continue v] to [0]\n                        set [holding v] to []\n                        broadcast (ThroughItem v)\n                        wait until <(continue) = [1]>\n                    end\n                end\n            end\n        end\n    else\n        set [ground v] to [0]\n        if <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n            if <not <(holding) = []>> then\n                if <(ItemTouching) = [0]> then\n                    if <(canThrough) = [1]> then\n                        set [continue v] to [0]\n                        set [holding v] to []\n                        broadcast (ThroughItem v)\n                        wait until <(continue) = [1]>\n                    end\n                end\n            else\n                if <<(groundPound) = [0]> and <not <<key (w v) pressed?> or <key (up arrow v) pressed?>>>> then\n                    if <(canPound) = [1]> then\n                        if <(yVel) > [-3]> then\n                            set [xvel v] to [0]\n                            set [groundpound v] to [1]\n                            wait (0.3) seconds\n                            set [yvel v] to [-15]\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (1)\n    if <(y position) < [-167]> then\n        broadcast (Death v)\n    end\n    if <(round (x position)) = [240]> then\n        change [level v] by (1)\n        set [drawing v] to [1]\n        broadcast (NewLevel v)\n        stop [this script v]\n    end\nend\n\ndefine Set Y\nrepeat ([abs v] of (yVel) )\n    if <touching (ground v)?> then\n        change y by ((-1) * (([abs v] of (yVel) ) / (yVel)))\n    end\nend\n\nwhen I receive [death v]\ngo to x: (-228) y: (-85)\nset [xvel v] to [0]\nset [yvel v] to [0]\nset [groundpound v] to [0]\npoint in direction (90)\nset [holding v] to []\n\nwhen flag clicked\nforever\n    if <(groundPound) = [1]> then\n        switch costume to (ground-pound v)\n    else\n        if <(ground) = [0]> then\n            switch costume to (jumping v)\n        else\n            if <([abs v] of (xVel) ) < [2]> then\n                switch costume to (standing v)\n            else\n                switch costume to (((costume [number v]) mod (2)) + (1))\n                wait (0.05) seconds\n            end\n        end\n    end\nend\n\nwhen I receive [death v]\nset [score v] to [0]\nbroadcast (NewScore v)\n\nwhen I receive [jump v]\nset [yvel v] to [10]\nset [groundpound v] to [0]\nset [canpound v] to [0]\n\n@Health\n\nwhen flag clicked\nhide\nset [life v] to [99]\nset [digit v] to [0]\nrepeat (3)\n    create clone of (_myself_ v)\n    change [digit v] by (1)\nend\n\nwhen I start as a clone\nshow\nif <(digit) = [0]> then\n    switch costume to (life v)\n    go to x: (-235) y: (175)\nelse\n    go to x: ((((digit) - (1)) * (4)) - (199)) y: (165)\n    switch costume to (num9 v)\nend\n\nwhen I receive [loop v]\nif <(digit) > [0]> then\n    if <<(digit) = [1]> and <(life) < [10]>> then\n        switch costume to (num0 v)\n    else\n        if <<(digit) = [2]> and <(life) < [10]>> then\n            switch costume to (join [num] (life))\n        else\n            switch costume to (join [num] (letter (digit) of (life)))\n        end\n    end\nend\n\n@Ground\n\nwhen flag clicked\nset [currentclone v] to [0]\nset [ypos v] to [0]\nhide\n\nwhen I start as a clone\ngo to x: (((xPos) * (24)) - (264)) y: (((yPos) * (24)) - (180))\nshow\n\ndefine setCostume\nif <[1] = (letter (xPos) of (item ((((15) - (yPos)) + (1)) + (((level) - (1)) * (15))) of [leveldata v]))> then\n    switch costume to (top v)\nelse\n    if <[2] = (letter (xPos) of (item ((((15) - (yPos)) + (1)) + (((level) - (1)) * (15))) of [leveldata v]))> then\n        switch costume to (topright v)\n    else\n        if <[3] = (letter (xPos) of (item ((((15) - (yPos)) + (1)) + (((level) - (1)) * (15))) of [leveldata v]))> then\n            switch costume to (right v)\n        else\n            if <[4] = (letter (xPos) of (item ((((15) - (yPos)) + (1)) + (((level) - (1)) * (15))) of [leveldata v]))> then\n                switch costume to (bottomright v)\n            else\n                if <[5] = (letter (xPos) of (item ((((15) - (yPos)) + (1)) + (((level) - (1)) * (15))) of [leveldata v]))> then\n                    switch costume to (bottom v)\n                else\n                    if <[6] = (letter (xPos) of (item ((((15) - (yPos)) + (1)) + (((level) - (1)) * (15))) of [leveldata v]))> then\n                        switch costume to (bottomleft v)\n                    else\n                        if <[7] = (letter (xPos) of (item ((((15) - (yPos)) + (1)) + (((level) - (1)) * (15))) of [leveldata v]))> then\n                            switch costume to (left v)\n                        else\n                            if <[8] = (letter (xPos) of (item ((((15) - (yPos)) + (1)) + (((level) - (1)) * (15))) of [leveldata v]))> then\n                                switch costume to (topleft v)\n                            else\n                                if <[9] = (letter (xPos) of (item ((((15) - (yPos)) + (1)) + (((level) - (1)) * (15))) of [leveldata v]))> then\n                                    switch costume to (center v)\n                                else\n                                    switch costume to (error v)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine createClone\nset [ypos v] to [0]\nrepeat (15)\n    set [xpos v] to [0]\n    change [ypos v] by (1)\n    repeat (20)\n        change [xpos v] by (1)\n        if <[extras v] contains (letter (xPos) of (item ((((15) - (yPos)) + (1)) + (((level) - (1)) * (15))) of [leveldata v]))?> then\n            set [continue v] to [0]\n            set [holdx v] to (xPos)\n            set [holdy v] to (yPos)\n            change [currentclone v] by (1)\n            create clone of (extras v)\n            wait until <(continue) = [1]>\n        else\n            if <[enemies v] contains (letter (xPos) of (item ((((15) - (yPos)) + (1)) + (((level) - (1)) * (15))) of [leveldata v]))?> then\n                set [continue v] to [0]\n                set [holdx v] to (xPos)\n                set [holdy v] to (yPos)\n                create clone of (enemies v)\n                wait until <(continue) = [1]>\n            else\n                if <not <[0] = (letter (xPos) of (item ((((15) - (yPos)) + (1)) + (((level) - (1)) * (15))) of [leveldata v]))>> then\n                    setCostume\n                    create clone of (_myself_ v)\n                end\n            end\n        end\n    end\nend\nset [ypos v] to [0]\n\nwhen I receive [newlevel v]\ndelete this clone\n\nwhen I receive [newlevel v]\nif <(yPos) = [0]> then\n    createClone\n    set [drawing v] to [0]\nend\n\n@Dust\n\nwhen flag clicked\nset [ghost v] effect to (100)\nswitch costume to (dust1 v)\nset size to (100) %\nforever\n    if <(round ((0.01) + ([abs v] of ([xvel v] of [bob v]) ))) = [5]> then\n        if <(ground) = [1]> then\n            create clone of (_myself_ v)\n            wait (0.1) seconds\n        end\n    end\nend\n\nwhen I receive [hardgroundimpact v]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\ngo to [front v] layer\nset [ghost v] effect to (0)\ngo to (bob v)\nrepeat (4)\n    wait (0.1) seconds\n    next costume\n    change [ghost v] effect by (25)\n    change size by (10)\nend\ndelete this clone\n\n@Extras\n\nwhen flag clicked\nset [original v] to [1]\nset [xpos v] to [0]\nset [ypos v] to [0]\nset [xvel v] to [0]\nset [yvel v] to [0]\nhide\n\nwhen I receive [throughitem v]\nif <(xPos) > [0]> then\n    if <(costume [number v]) = [4]> then\n        set [xvel v] to (([xvel v] of [bob v]) * (2))\n        set [yvel v] to (([yvel v] of [bob v]) * (2))\n        set [continue v] to [1]\n        repeat until <(holding) = [key]>\n            set [xvel v] to ((xVel) * (0.9))\n            change x by (xVel)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (1)\n                        if <touching (ground v)?> then\n                            change y by (1)\n                            if <touching (ground v)?> then\n                                change y by (1)\n                                if <touching (ground v)?> then\n                                    set [xvel v] to ((xVel) * (-1))\n                                    change x by (xVel)\n                                    change y by (-5)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n            change [yvel v] by (-0.8)\n            change y by (yVel)\n            if <touching (ground v)?> then\n                Set Y\n                set [yvel v] to [0]\n            else\n            end\n            if <(y position) < [-167]> then\n                set [holdtype v] to [%]\n                set [holding v] to []\n                broadcast (Death v)\n                create clone of (_myself_ v)\n                delete this clone\n            end\n        end\n    end\nend\n\ndefine Clone Behavior\nset [continue v] to [1]\nset [brightness v] effect to (0)\nset [ghost v] effect to (0)\ngo to x: (((xPos) * (24)) - (264)) y: (((yPos) * (24)) - (180))\nshow\nif <[*] = (letter (xPos) of (item ((((15) - (yPos)) + (1)) + (((level) - (1)) * (15))) of [leveldata v]))> then\n    switch costume to (diamond v)\n    set [oldy v] to (y position)\n    repeat until <touching (bob v)?>\n        set y to ((((yPos) * (24)) - (180)) + (([sin v] of (((timer) * (300)) mod (360)) ) * (3)))\n    end\n    set [speed v] to [0]\n    change [score v] by (100)\n    set [bonus v] to [100]\n    broadcast (NewScore v)\n    broadcast (Bonus v)\n    repeat until <(y position) > [179]>\n        change [speed v] by (0.5)\n        change y by (speed)\n        change [brightness v] effect by (speed)\n        change [ghost v] effect by (speed)\n    end\n    hide\nend\nif <[%] = (letter (xPos) of (item ((((15) - (yPos)) + (1)) + (((level) - (1)) * (15))) of [leveldata v]))> then\n    switch costume to (key v)\n    repeat until <<touching (bob v)?> and <<key (s v) pressed?> or <key (down arrow v) pressed?>>>\n        set y to ((((yPos) * (24)) - (180)) + (([sin v] of (((timer) * (300)) mod (360)) ) * (3)))\n    end\n    if <(holding) = []> then\n        set [holding v] to [key]\n    end\n    set [canthrough v] to [0]\n    wait until <not <<key (s v) pressed?> or <key (down arrow v) pressed?>>>\n    set [canthrough v] to [1]\n    repeat until <<not <touching (ground v)?>> and <<key (s v) pressed?> or <key (down arrow v) pressed?>>>\n        go to x: (([x position v] of [bob v]) - (12)) y: (([y position v] of [bob v]) + (20))\n        set [cloneheld v] to (currentClone)\n        if <touching (ground v)?> then\n            set [itemtouching v] to [1]\n        else\n            set [itemtouching v] to [0]\n        end\n    end\n    forever\n        wait until <<not <touching (bob v)?>> and <not <<key (s v) pressed?> or <key (down arrow v) pressed?>>>>\n        wait until <<touching (bob v)?> and <<key (s v) pressed?> or <key (down arrow v) pressed?>>>\n        if <(holding) = []> then\n            set [holding v] to [key]\n        end\n        set [canthrough v] to [0]\n        wait until <not <<key (s v) pressed?> or <key (down arrow v) pressed?>>>\n        set [canthrough v] to [1]\n        repeat until <<not <touching (ground v)?>> and <<key (s v) pressed?> or <key (down arrow v) pressed?>>>\n            go to x: (([x position v] of [bob v]) - (12)) y: (([y position v] of [bob v]) + (20))\n            if <touching (ground v)?> then\n                set [itemtouching v] to [1]\n            else\n                set [itemtouching v] to [0]\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nif <(original) = [1]> then\n    set [xpos v] to (holdX)\n    set [ypos v] to (holdY)\n    set [clonenum v] to (currentClone)\nend\nset [original v] to [0]\nClone Behavior\n\nwhen I receive [death v]\nstop [other scripts in sprite v]\nif <(xPos) > [0]> then\n    Clone Behavior\nend\n\ndefine Set Y\nrepeat ([abs v] of (yVel) )\n    if <touching (ground v)?> then\n        change y by ((-1) * (([abs v] of (yVel) ) / (yVel)))\n    end\nend\n\nwhen I receive [newlevel v]\ndelete this clone\n\n@Hats\n\nwhen I receive [loop v]\nset rotation style [left-right v]\ngo to (bob v)\npoint in direction ([direction v] of [bob v])\nif <not <(costume [number v]) = ((hat) + (1))>> then\n    switch costume to ((hat) + (1))\nend\n\nwhen [h v] key pressed\nchange [hat v] by (1)\n\nwhen flag clicked\nhide\ngo to [front v] layer\ngo [backward v] (5) layers\nset [hat v] to [0]\nwait until <not <(hat) = [0]>>\nshow\n\n@Screen\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nset [ghostscreen v] to [100]\n\nwhen I receive [death v]\ngo to [front v] layer\nset [ghostscreen v] to [0]\nrepeat until <(round (ghostScreen)) = [100]>\n    change [ghostscreen v] by (((100) - (ghostScreen)) / (15))\n    set [ghost v] effect to (ghostScreen)\nend\n\nwhen I receive [item death v]\ngo to [front v] layer\nset [ghostscreen v] to [0]\nrepeat until <(round (ghostScreen)) = [100]>\n    change [ghostscreen v] by (((100) - (ghostScreen)) / (15))\n    set [ghost v] effect to (ghostScreen)\nend\n\n@Score\n\nwhen flag clicked\nhide\nset [score v] to [0]\nbroadcast (NewScore v)\n\nwhen I start as a clone\nshow\n\nwhen I receive [newscore v]\ndelete this clone\n\nwhen I receive [newscore v]\nSet Score\n\ndefine Set Score\nset [digit v] to [0]\nrepeat (length of (score))\n    change [digit v] by (1)\n    switch costume to (join [num] (letter (digit) of (score)))\n    go to x: ((((digit) - (1)) * (4)) - ((length of (score)) * (2))) y: (165)\n    create clone of (_myself_ v)\nend\n\n@Score Bonus\n\nwhen flag clicked\nhide\nset [ghost v] effect to (0)\nset size to (100) %\n\ndefine Set Score\nset [digit v] to [0]\nrepeat (length of (bonus))\n    change [digit v] by (1)\n    switch costume to (join [num] (letter (digit) of (bonus)))\n    go to x: (([x position v] of [bob v]) + ((((digit) - (1)) * (13)) - ((length of (bonus)) * (7.5)))) y: (([y position v] of [bob v]) + (4))\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nset [speed v] to [5]\nshow\nrepeat (50)\n    change [ghost v] effect by (2)\n    set [speed v] to ((speed) / (1.1))\n    change y by (speed)\nend\ndelete this clone\n\nwhen I receive [bonus v]\nif <(score) > [0]> then\n    Set Score\nend\ndelete this clone\n\n@Achievements\n\nwhen flag clicked\nset [enemy pound v] to [0]\ndelete (all) of [achievements v]\ngo to x: (-150) y: (220)\nshow\nset [achievement v] to [0]\n\nwhen I receive [wall jump v]\nwait until <(achievement) = [0]>\nset [achievement v] to [1]\nswitch costume to (wall v)\nadd [wall] to [achievements v]\nrepeat until <(round (y position)) = [172]>\n    change y by (((172) - (y position)) / (10))\nend\nwait (3) seconds\nrepeat until <(round (y position)) = [220]>\n    change y by (((220) - (y position)) / (10))\nend\nset [achievement v] to [0]\n\nwhen I receive [enemypound v]\nwait until <(achievement) = [0]>\nset [achievement v] to [1]\nswitch costume to (enemy v)\nadd [enemy] to [achievements v]\nrepeat until <(round (y position)) = [172]>\n    change y by (((172) - (y position)) / (10))\nend\nwait (3) seconds\nrepeat until <(round (y position)) = [220]>\n    change y by (((220) - (y position)) / (10))\nend\nset [achievement v] to [0]\n\n@Enemies\n\nwhen I receive [newlevel v]\ndelete this clone\n\nwhen I receive [death v]\nstop [other scripts in sprite v]\nif <(xPos) > [0]> then\n    Clone Behavior\nend\n\nwhen I start as a clone\nset [xpos v] to (holdX)\nset [ypos v] to (holdY)\nClone Behavior\n\nwhen I receive [death v]\nstop [other scripts in sprite v]\nif <(xPos) > [0]> then\n    Clone Behavior\nend\n\ndefine Clone Behavior\nset [continue v] to [1]\ngo to x: (((xPos) * (24)) - (274)) y: (((yPos) * (24)) - (180))\nshow\nif <[^] = (letter (xPos) of (item ((((15) - (yPos)) + (1)) + (((level) - (1)) * (15))) of [leveldata v]))> then\n    set [dir v] to [1]\n    point in direction ((dir) * (90))\n    forever\n        if <((round (((x position) - (12)) / (24))) * (24)) = ((x position) - (12))> then\n            set [side v] to (letter (((((x position) - (12)) + (264)) / (24)) + (dir)) of (item ((((15) - (yPos)) + (1)) + (((level) - (1)) * (15))) of [leveldata v]))\n            set [down v] to (letter (((((x position) - (12)) + (264)) / (24)) + (dir)) of (item ((((15) - (yPos)) + (2)) + (((level) - (1)) * (15))) of [leveldata v]))\n            if <<[0] = (down)> or <<[0] < (side)> and <not <[enemies v] contains (side)?>>>> then\n                set [dir v] to ((dir) * (-1))\n                point in direction ((dir) * (90))\n            end\n        else\n        end\n        change [i v] by (1)\n        change x by (dir)\n        if <((i) mod (10)) = [0]> then\n            switch costume to (((costume [number v]) mod (2)) + (1))\n        end\n        if <touching (bob v)?> then\n            if <([yvel v] of [bob v]) < [-5]> then\n                if <(groundPound) = [1]> then\n                    change [score v] by (200)\n                    set [bonus v] to [200]\n                    if <not <[achievements v] contains [enemy]?>> then\n                        if <(enemy pound) = [0]> then\n                            broadcast (enemyPound v)\n                        end\n                    end\n                else\n                    change [score v] by (100)\n                    set [bonus v] to [100]\n                end\n                broadcast (NewScore v)\n                broadcast (Bonus v)\n                switch costume to (zombiedeath v)\n                repeat (10)\n                    change y by (-10)\n                    change [ghost v] effect by (10)\n                    change [brightness v] effect by (10)\n                end\n                hide\n                set [ghost v] effect to (0)\n                set [brightness v] effect to (0)\n            else\n                broadcast (Death v)\n            end\n        end\n    end\nend\nif <[$] = (letter (xPos) of (item ((((15) - (yPos)) + (1)) + (((level) - (1)) * (15))) of [leveldata v]))> then\n    set [enemylife v] to [5]\n    set [dir v] to [1]\n    set [costume+ v] to [3]\n    set [costume # v] to [0]\n    point in direction ((dir) * (90))\n    forever\n        if <((round (((x position) - (12)) / (24))) * (24)) = ((x position) - (12))> then\n            set [side v] to (letter (((((x position) - (12)) + (264)) / (24)) + (dir)) of (item ((((15) - (yPos)) + (1)) + (((level) - (1)) * (15))) of [leveldata v]))\n            set [down v] to (letter (((((x position) - (12)) + (264)) / (24)) + (dir)) of (item ((((15) - (yPos)) + (2)) + (((level) - (1)) * (15))) of [leveldata v]))\n            if <<[0] = (down)> or <<[0] < (side)> and <not <[enemies v] contains (side)?>>>> then\n                set [dir v] to ((dir) * (-1))\n                point in direction ((dir) * (90))\n            end\n        else\n        end\n        change [i v] by (1)\n        change x by (dir)\n        if <((i) mod (10)) = [0]> then\n            set [costume # v] to (((costume #) mod (2)) + (1))\n            switch costume to ((costume #) + (Costume+))\n        end\n        if <touching (bob v)?> then\n            if <(touchingBob) = [0]> then\n                set [touchingbob v] to [1]\n                if <([yvel v] of [bob v]) < [-5]> then\n                    if <<([yvel v] of [bob v]) = [-15]> and <(enemyLife) > [1]>> then\n                        change [enemylife v] by (-2)\n                        change [costume+ v] by (4)\n                    else\n                        change [enemylife v] by (-1)\n                        change [costume+ v] by (2)\n                    end\n                    switch costume to ((costume #) + (Costume+))\n                    if <(enemyLife) = [0]> then\n                        if <(groundPound) = [1]> then\n                            change [score v] by (200)\n                            set [bonus v] to [200]\n                            if <not <[achievements v] contains [enemy]?>> then\n                                if <(enemy pound) = [0]> then\n                                    broadcast (enemyPound v)\n                                end\n                            end\n                        else\n                            change [score v] by (200)\n                            set [bonus v] to [200]\n                        end\n                        broadcast (NewScore v)\n                        broadcast (Bonus v)\n                        switch costume to (zombiedeath v)\n                        repeat (10)\n                            change y by (-10)\n                            change [ghost v] effect by (10)\n                            change [brightness v] effect by (10)\n                        end\n                        hide\n                        set [ghost v] effect to (0)\n                        set [brightness v] effect to (0)\n                    else\n                        change [score v] by (100)\n                        set [bonus v] to [100]\n                        broadcast (NewScore v)\n                        broadcast (Bonus v)\n                        broadcast (jump v)\n                        set [dir v] to ((dir) * (-1))\n                        point in direction ((dir) * (90))\n                        set [enemyx v] to (x position)\n                        set [enemyy v] to (y position)\n                        repeat (pick random (3) to (7))\n                            create clone of (armorparticles v)\n                        end\n                    end\n                else\n                    broadcast (Death v)\n                end\n            end\n        else\n            set [touchingbob v] to [0]\n        end\n    end\nend\n\nwhen flag clicked\nset [xpos v] to [0]\nset [ypos v] to [0]\nset rotation style [left-right v]\nhide\n\n@ArmorParticles\n\nwhen I start as a clone\nswitch costume to (pick random (1) to (3))\nshow\ngo to x: (enemyX) y: (enemyY)\nset [yvel v] to (pick random (1) to (5))\nset [xvel v] to (pick random (-3) to (3))\nrepeat (10)\n    change [yvel v] by (-1)\n    change x by (xVel)\n    change y by (yVel)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen flag clicked\nset [ghost v] effect to (0)\nhide\n\n