Megaman Platformer (with enemies!) Cities/Highway engine#games #all
@Stage\n\n@Blank\n\n@Player\n\ndefine Fire Timing\nif <(Firing) = [1]> then\n    if <(Fire Duration) < [1]> then\n        set [fire duration v] to [0]\n        set [firing v] to [0]\n        set [@fire v] to [0]\n    else\n        change [fire duration v] by (-1)\n    end\nend\n\ndefine Damage Check\nif <(Invincible) = [1]> then\n    set [damage toggle v] to [0]\n    set [damage timer v] to [0]\nelse\n    if <(Damage Timer) > [1]> then\n        change [damage timer v] by (-1)\n    else\n        set [damage timer v] to [0]\n        set [damage toggle v] to [1]\n    end\nend\n\ndefine X-Buster Charging\nif <(Player: Weapon) = [0]> then\n    if <<(fire key) = [1]> and <(Take Damage) = [0]>> then\n        change [charging v] by (1)\n        if <(Charging) = [15]> then\n            start sound [X_Charge v]\n            set [x - buster charge lvl v] to [1]\n        end\n        if <(Charging) = [51]> then\n            set [x - buster charge lvl v] to [2]\n        end\n        if <(Charging) = [58]> then\n            start sound [X_Charge_Loop v]\n        end\n        if <(Upgrade: Arms) = [1]> then\n            if <(Charging) = [68]> then\n                start sound [X_Charge_Loop v]\n            end\n            if <(Charging) = [74]> then\n                start sound [X_Charge_Loop v]\n            end\n            if <(Charging) = [80]> then\n                start sound [X_Charge_Loop v]\n            end\n            if <(Charging) = [81]> then\n                set [x - buster charge lvl v] to [3]\n            end\n            if <(Charging) = [88]> then\n                start sound [X_Charge_Loop v]\n            end\n            if <(Charging) = [90]> then\n                set [charging v] to [87]\n            end\n        else\n            if <(Charging) = [60]> then\n                set [charging v] to [57]\n            end\n        end\n    end\nend\n\ndefine Gravity\nif <(Gravity Toggle) = [1]> then\n    if <<(speed y) < [4]> or <(Input: Jump) = [1]>> then\n        change [speed y v] by (-1)\n    else\n        change [speed y v] by (-2)\n    end\n    if <(speed y) < [-15]> then\n        set [speed y v] to [-15]\n    end\nend\nchange y by (speed y)\n\ndefine Movement (speed)\nif <(Wall Jump) > [0]> then\n    change [wall jump v] by (-1)\n    if <<(Moving Left) = [1]> and <not <(Moving Right) = [1]>>> then\n        if <(Dashing) = [2]> then\n            Walk [-90] ((speed) * (-2))\n        else\n            Walk [-90] ((speed) * (-1))\n        end\n    else\n        if <<(Moving Right) = [1]> and <not <(Moving Left) = [1]>>> then\n            if <(Dashing) = [2]> then\n                Walk [90] ((speed) * (2))\n            else\n                Walk [90] (speed)\n            end\n        end\n    end\nelse\n    if <(Dashing) = [1]> then\n        if <<(Moving Left) = [1]> and <not <(Moving Right) = [1]>>> then\n            Walk [-90] ((speed) * (-2))\n            if <(Input: Right) = [1]> then\n                set [dashing v] to [0]\n                set [@dash v] to [99]\n            end\n        else\n            if <<(Moving Right) = [1]> and <not <(Moving Left) = [1]>>> then\n                Walk [90] ((speed) * (2))\n                if <(Input: Left) = [1]> then\n                    set [dashing v] to [0]\n                    set [@dash v] to [99]\n                end\n            end\n        end\n    else\n        set [moving left v] to [0]\n        set [moving right v] to [0]\n        if <<(Input: Left) = [1]> and <<(Take Damage) = [0]> and <<(Climbing) = [0]> and <<(End Climbing) = [0]> and <(Playable) = [1]>>>>> then\n            set [landing animation v] to [0]\n            if <<(Wall Slide) = [1]> and <(direction) = [90]>> then\n                set [wall slide v] to [0]\n                set [gravity toggle v] to [1]\n                set [falling? v] to [6]\n            end\n            if <(Dashing) = [2]> then\n                Walk [-90] ((speed) * (-2))\n            else\n                Walk [-90] ((speed) * (-1))\n            end\n        else\n            if <<(Input: Right) = [1]> and <<(Take Damage) = [0]> and <<(Climbing) = [0]> and <<(End Climbing) = [0]> and <(Playable) = [1]>>>>> then\n                set [landing animation v] to [0]\n                if <<(Wall Slide) = [1]> and <(direction) = [-90]>> then\n                    set [wall slide v] to [0]\n                    set [gravity toggle v] to [1]\n                    set [falling? v] to [6]\n                end\n                if <(Dashing) = [2]> then\n                    Walk [90] ((speed) * (2))\n                else\n                    Walk [90] (speed)\n                end\n            else\n                if <(Wall Slide) = [1]> then\n                    set [wall slide v] to [0]\n                    set [gravity toggle v] to [1]\n                    set [falling? v] to [6]\n                end\n                if <(Playable) = [1]> then\n                    set [animation state v] to [0]\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset size to (200) %\nhide\nbroadcast (Pause v)\nbroadcast (Transition In v) and wait\nbroadcast (Clear v)\nbroadcast (Setup v) and wait\nbroadcast (Level Loop v)\nbroadcast (Play v)\nbroadcast (Transition Out v) and wait\nbroadcast (Play BG Music v)\nbroadcast (Ready Message v) and wait\nbroadcast (Player Intro v)\n\nwhen I receive [setup v]\nReset Player\n\ndefine Reset Player\nshow\nset size to (200) %\nset [ghost v] effect to (100)\nCheck Level\nset rotation style [left-right v]\npoint in direction (90)\nset [player: weapon v] to [0]\nset [speed y v] to [0]\nset [falling? v] to [10]\nset [wall slide v] to [0]\nset [wall jump v] to [0]\nset [gravity toggle v] to [1]\nset [moving left v] to [0]\nset [moving right v] to [0]\nset [in ladder? v] to [0]\nset [climbing v] to [0]\nset [climb animation v] to [0]\nset [climb fire direction v] to [0]\nset [end climbing v] to [0]\nset [landing animation v] to [0]\nset [global x costume no. v] to [1]\nset [x sprite off x v] to [0]\nset [x sprite off y v] to [360]\nset [take damage v] to [0]\nset [damage timer v] to [0]\nset [damage toggle v] to [0]\nset [low on health v] to [0]\nset [invincible v] to [0]\nset [ching animation v] to [0]\nset [clear v] to [0]\nset [wall jump animation v] to [0]\nset [animation state v] to [0]\nset [dashing v] to [0]\nset [crouch v] to [0]\nset [firing v] to [0]\nset [fire duration v] to [0]\nset [charging v] to [0]\nset [dead v] to [0]\nset [@idle v] to [0]\nset [@run v] to [0]\nset [@fire v] to [0]\nset [@dash v] to [0]\nset [@jump v] to [0]\nset [@fall v] to [0]\nset [@land v] to [0]\nset [@wall cling v] to [0]\nset [@wall jump v] to [0]\nset [@climb v] to [0]\nset [@climbend v] to [0]\nset [@idlelowhp v] to [0]\nset [@damage v] to [0]\nset [@armordamage v] to [0]\nset [@die v] to [0]\nset [@ching v] to [0]\nset [@exit v] to [0]\nhide\n\ndefine Check Level\nif <(Level NO.) = [1]> then\n    set [scroll x v] to [0]\n    set [scroll y v] to [285]\n    set [scroll x min v] to [0]\n    set [scroll y min v] to [220]\n    set [scroll x max v] to [14880]\n    set [scroll y max v] to [360]\n    go to x: (0) y: (0)\nend\n\nwhen I receive [player intro v]\nshow\nset [global x costume no. v] to [1]\nstart sound [X_TeleportDown v]\nset [x sprite off y v] to [360]\nrepeat until <(X Sprite Off Y) < [1]>\n    change [x sprite off y v] by (-20)\nend\nset [x sprite off y v] to [0]\nbroadcast (Player Intro Land v)\n\nwhen I receive [player intro land v]\nrepeat (6)\n    change [global x costume no. v] by (1)\n    wait (0.05) seconds\nend\nset [global x costume no. v] to [8]\nbroadcast (Go Player v)\n\nwhen I receive [go player v]\nBroadcast Boss Warning\nforever\n    if <(Pause) = [0]> then\n        Platforming Engine [5]\n    end\nend\n\ndefine Platforming Engine (speed)\nCheck HitBox Size\nif <(HP) < [7]> then\n    set [low on health v] to [1]\nelse\n    set [low on health v] to [0]\nend\nFire Timing\nDamage Check\nX-Buster Charging\nGravity\nTouch Ground <(speed y) > [0]>\nif <(Dashing) = [1]> then\n    set [crouch v] to [1]\nelse\n    set [crouch v] to [0]\nend\nif <<touching (level_ladder v)?> or <touching (level_ladder_top v)?>> then\n    set [in ladder? v] to [1]\nelse\n    set [in ladder? v] to [0]\nend\nMovement (speed)\nLadder Check\nClimb Action (speed)\nJumping\nif <(Upgrade: Legs) = [1]> then\n    Dash Movement\nend\nCurrent Weapon\nCheck Hazard\nif <<(y position) < [-180]> and <(Dead) = [0]>> then\n    start sound [X_Damage v]\n    set [take damage v] to [1]\n    set [charging v] to [0]\n    set [hp v] to [0]\n    Die\nend\nAnimation\nScrolling Blocks\n\ndefine Check HitBox Size\nif <(Crouch) = [1]> then\n    switch costume to (hitbox_crouch v)\nelse\n    switch costume to (hitbox v)\nend\n\ndefine Touch Ground <up?>\nif <(Gravity Toggle) = [1]> then\n    change [falling? v] by (1)\nend\nrepeat until <not <touching (level_collision v)?>>\n    if <up?> then\n        change y by (-1)\n    else\n        change y by (1)\n        if <(Wall Slide) = [1]> then\n            set [wall slide v] to [0]\n            set [gravity toggle v] to [1]\n        end\n        if <(Dashing) > [1]> then\n            set [dashing v] to [0]\n        end\n        if <(speed y) < [-6]> then\n            start sound [X_Land v]\n            if <<not <(Input: Left) = [1]>> and <not <(Input: Right) = [1]>>> then\n                set [landing animation v] to [1]\n                set [@land v] to [0]\n            else\n                set [landing animation v] to [0]\n                set [@land v] to [0]\n            end\n        end\n        set [falling? v] to [0]\n        set [wall jump animation v] to [0]\n    end\n    set [speed y v] to [0]\nend\n\ndefine Walk (direction) (speed)\npoint in direction (direction)\nchange x by (speed)\nset [slope v] to [0]\nrepeat until <<(slope) = [8]> or <not <touching (level_collision v)?>>>\n    change y by (1)\n    change [slope v] by (1)\nend\nif <(slope) = [8]> then\n    change x by ((0) - (speed))\n    change y by ((0) - (slope))\n    if <<<(falling?) > [10]> and <(Wall Jump) = [0]>> and <<not <(Moving Left) = [1]>> and <not <(Moving Right) = [1]>>>> then\n        set [wall slide v] to [1]\n        set [speed y v] to [0]\n        set [gravity toggle v] to [0]\n        set [falling? v] to [0]\n        set [wall jump animation v] to [0]\n        set [dashing v] to [0]\n        start sound [X_Land v]\n    end\n    if <<(Wall Slide) = [1]> and <(Wall Jump) = [0]>> then\n        if <(@Wall Cling) > [3]> then\n            set [speed y v] to [-2]\n        end\n        if <<(Input: Jump) = [1]> and <<(Wall Jump) = [0]> and <<(Moving Left) = [0]> and <(Moving Right) = [0]>>>> then\n            if <(direction) = [90]> then\n                point in direction (-90)\n                set [moving left v] to [1]\n                set [moving right v] to [0]\n            else\n                if <(direction) = [-90]> then\n                    point in direction (90)\n                    set [moving left v] to [0]\n                    set [moving right v] to [1]\n                end\n            end\n            if <<(Input: Dash) = [1]> and <(Upgrade: Legs) = [1]>> then\n                set [dashing v] to [2]\n            end\n            set [speed y v] to [13]\n            set [wall slide v] to [0]\n            set [gravity toggle v] to [1]\n            set [falling? v] to [6]\n            set [wall jump v] to [8]\n            set [wall jump animation v] to [1]\n            set [@wall jump v] to [0]\n            start sound [X_Jump v]\n        end\n    end\n    if <(Dashing) = [1]> then\n        set [dashing v] to [0]\n        set [@dash v] to [0]\n    end\nend\nif <<(Wall Slide) = [1]> and <(slope) = [0]>> then\n    set [wall slide v] to [0]\n    set [gravity toggle v] to [1]\n    set [falling? v] to [6]\nend\nif <(Wall Slide) = [1]> then\n    set [animation state v] to [9]\nelse\n    if <(Dashing) = [1]> then\n        set [animation state v] to [2]\n        if <(falling?) > [5]> then\n            set [dashing v] to [2]\n        end\n    else\n        set [animation state v] to [1]\n    end\nend\n\ndefine Ladder Check\nif <<(In Ladder?) = [1]> and <<(Climbing) = [0]> and <<(Wall Slide) = [0]> and <<(Dead) = [0]> and <(End Climbing) = [0]>>>>> then\n    if <<(Input: Up) = [1]> and <(Playable) = [1]>> then\n        set [climbing v] to [5]\n        set [animation state v] to [10]\n        set [end climbing v] to [0]\n        set [gravity toggle v] to [0]\n        set [speed y v] to [0]\n        set [falling? v] to [0]\n        set [moving left v] to [0]\n        set [moving right v] to [0]\n        set [dashing v] to [0]\n        set [take damage v] to [0]\n        set [@climb v] to [1]\n    else\n        if <<(Input: Down) = [1]> and <<(Climbing) = [0]> and <<(falling?) > [1]> and <(Playable) = [1]>>>> then\n            set [climbing v] to [5]\n            set [animation state v] to [10]\n            set [end climbing v] to [0]\n            set [gravity toggle v] to [0]\n            set [speed y v] to [0]\n            set [falling? v] to [0]\n            set [moving left v] to [0]\n            set [moving right v] to [0]\n            set [dashing v] to [0]\n            set [take damage v] to [0]\n            set [@climb v] to [1]\n        end\n    end\nend\n\ndefine Climb (speed)\nchange y by (speed)\nif <touching (level_collision v)?> then\n    change y by ((0) - (speed))\nend\n\ndefine Climb Action (speed)\nif <(Climbing) = [1]> then\n    set [animation state v] to [3]\n    if <<(Input: Up) = [1]> and <<not <(Input: Down) = [1]>> and <<(Dead) = [0]> and <<(Firing) = [0]> and <<(End Climbing) = [0]> and <(Playable) = [1]>>>>>> then\n        Climb (speed)\n        set [climb animation v] to [1]\n    else\n        if <<(Input: Down) = [1]> and <<not <(Input: Up) = [1]>> and <<(Dead) = [0]> and <<(Firing) = [0]> and <<(End Climbing) = [0]> and <(Playable) = [1]>>>>>> then\n            Climb ((speed) * (-1))\n            set [climb animation v] to [1]\n        else\n            set [climb animation v] to [0]\n        end\n    end\n    if <<(Input: Dash) = [1]> and <(Playable) = [1]>> then\n        set [gravity toggle v] to [1]\n        set [climbing v] to [0]\n        set [end climbing v] to [0]\n        set [climb animation v] to [0]\n        set [falling? v] to [6]\n        set [speed y v] to [0]\n        set [@climb v] to [0]\n        set [@climbend v] to [0]\n        set [climb fire direction v] to [0]\n    end\n    if <touching (level_ladder_top v)?> then\n        if <<(Input: Up) = [1]> and <<not <(Input: Down) = [1]>> and <<(Dead) = [0]> and <<(End Climbing) = [0]> and <(Playable) = [1]>>>>> then\n            set [end climbing v] to [1]\n            set [climbing v] to [0]\n            set [animation state v] to [0]\n            set [gravity toggle v] to [0]\n            set [climb animation v] to [0]\n            set [falling? v] to [6]\n            set [speed y v] to [0]\n            set [climb fire direction v] to [0]\n        end\n    else\n        if <(In Ladder?) = [0]> then\n            set [gravity toggle v] to [1]\n            set [climbing v] to [0]\n            set [end climbing v] to [0]\n            set [climb animation v] to [0]\n            set [animation state v] to [0]\n            set [falling? v] to [6]\n            set [speed y v] to [0]\n            set [@climb v] to [0]\n            set [@climbend v] to [0]\n            set [climb fire direction v] to [0]\n        end\n    end\nend\n\ndefine Jumping\nif <<(Input: Jump) = [1]> and <<(Take Damage) = [0]> and <<(End Climbing) = [0]> and <(Playable) = [1]>>>> then\n    if <<(jump key) = [0]> and <(falling?) < [3]>> then\n        if <(Climbing) = [1]> then\n            set [climbing v] to [0]\n            set [end climbing v] to [0]\n            set [climb animation v] to [0]\n            set [gravity toggle v] to [1]\n            set [@climb v] to [0]\n            set [@climbend v] to [0]\n        end\n        start sound [X_Jump v]\n        set [speed y v] to [15]\n        set [falling? v] to [6]\n        set [jump key v] to [1]\n        if <(Dashing) = [1]> then\n            set [dashing v] to [2]\n        end\n    end\nelse\n    set [jump key v] to [0]\nend\n\ndefine Dash Movement\nif <<(Input: Dash) = [1]> and <<(Take Damage) = [0]> and <<(Climbing) = [0]> and <<(End Climbing) = [0]> and <(Playable) = [1]>>>>> then\n    if <<(dash key) = [0]> and <<(falling?) = [0]> and <<(Dashing) = [0]> and <(Wall Slide) = [0]>>>> then\n        start sound [X_Dash v]\n        if <(direction) = [-90]> then\n            set [moving left v] to [1]\n            set [moving right v] to [0]\n        else\n            if <(direction) = [90]> then\n                set [moving left v] to [0]\n                set [moving right v] to [1]\n            end\n        end\n        set [dashing v] to [1]\n        set [dash key v] to [1]\n    end\nelse\n    set [dash key v] to [0]\nend\n\ndefine X - Buster\nif <(Player: Weapon) = [0]> then\n    if <<(Input: Shot) = [1]> and <<(Take Damage) = [0]> and <<(End Climbing) = [0]> and <(Playable) = [1]>>>> then\n        if <<(fire key) = [0]> and <(Climb Animation) = [0]>> then\n            if <(Climbing) = [1]> then\n                if <(Input: Left) = [1]> then\n                    set [climb fire direction v] to [L]\n                end\n                if <(Input: Right) = [1]> then\n                    set [climb fire direction v] to [R]\n                end\n            end\n            start sound [X_Buster v]\n            set [@fire v] to [0]\n            set [firing v] to [1]\n            set [fire duration v] to [10]\n            set [fire key v] to [1]\n            set [x - buster charge lvl v] to [0]\n            create clone of (buster_lv0 v)\n        end\n    else\n        set [fire key v] to [0]\n        if <(Charging) > [80]> then\n            if <(Climbing) = [1]> then\n                if <(Input: Left) = [1]> then\n                    set [climb fire direction v] to [L]\n                end\n                if <(Input: Right) = [1]> then\n                    set [climb fire direction v] to [R]\n                end\n            end\n            start sound [X_Buster_LV3 v]\n            set [@fire v] to [0]\n            set [firing v] to [1]\n            set [fire duration v] to [10]\n            set [charging v] to [0]\n            set [x - buster charge lvl v] to [0]\n            create clone of (buster_lv3_flash v)\n            create clone of (buster_lv3 v)\n        else\n            if <(Charging) > [50]> then\n                if <(Climbing) = [1]> then\n                    if <(Input: Left) = [1]> then\n                        set [climb fire direction v] to [L]\n                    end\n                    if <(Input: Right) = [1]> then\n                        set [climb fire direction v] to [R]\n                    end\n                end\n                start sound [X_Buster_LV2 v]\n                set [@fire v] to [0]\n                set [firing v] to [1]\n                set [fire duration v] to [10]\n                set [charging v] to [0]\n                set [x - buster charge lvl v] to [0]\n                create clone of (buster_lv2 v)\n            else\n                if <(Charging) > [15]> then\n                    if <(Climbing) = [1]> then\n                        if <(Input: Left) = [1]> then\n                            set [climb fire direction v] to [L]\n                        end\n                        if <(Input: Right) = [1]> then\n                            set [climb fire direction v] to [R]\n                        end\n                    end\n                    start sound [X_Buster_LV1 v]\n                    set [@fire v] to [0]\n                    set [firing v] to [1]\n                    set [fire duration v] to [10]\n                    set [charging v] to [0]\n                    set [x - buster charge lvl v] to [0]\n                    create clone of (buster_lv1 v)\n                else\n                    set [charging v] to [0]\n                    set [x - buster charge lvl v] to [0]\n                end\n            end\n        end\n    end\nend\n\ndefine Check Hazard\nif <<(Take Damage) = [0]> and <(Damage Toggle) = [1]>> then\n    if <touching (level_hazard v)?> then\n        if <(Upgrade: Armor) = [1]> then\n            change [hp v] by ((-2) * (0.5))\n        else\n            change [hp v] by (-2)\n        end\n        start sound [X_Damage v]\n        set [take damage v] to [1]\n        set [charging v] to [0]\n        if <(HP) < [1]> then\n            set [hp v] to [0]\n            Die\n        else\n            Take Damage\n        end\n    end\nend\n\ndefine Take Damage\nset [x - buster charge lvl v] to [0]\nset [landing animation v] to [0]\nif <(Upgrade: Armor) = [1]> then\n    set [@armordamage v] to [16]\nelse\n    set [@damage v] to [16]\nend\nset [@climbend v] to [0]\nset [speed y v] to [6]\nset [damage toggle v] to [0]\nset [damage timer v] to [50]\nif <(direction) = [90]> then\n    Move [-20]\nend\nif <(direction) = [-90]> then\n    Move [20]\nend\nset [wall jump v] to [0]\nset [wall jump animation v] to [0]\nset [wall slide v] to [0]\nset [gravity toggle v] to [1]\nset [firing v] to [0]\nset [animation state v] to [0]\nset [climbing v] to [0]\nset [climb animation v] to [0]\nset [dashing v] to [0]\nset [end climbing v] to [0]\nset [fire duration v] to [0]\nset [firing v] to [0]\n\ndefine Die\nset [x - buster charge lvl v] to [0]\nset [landing animation v] to [0]\nset [dead v] to [1]\nset [@die v] to [0]\nset [@climbend v] to [0]\nset [speed y v] to [0]\nset [wall jump v] to [0]\nset [wall jump animation v] to [0]\nset [wall slide v] to [0]\nset [gravity toggle v] to [0]\nset [firing v] to [0]\nset [animation state v] to [0]\nset [climbing v] to [0]\nset [climb animation v] to [0]\nset [dashing v] to [0]\nset [end climbing v] to [0]\nset [fire duration v] to [0]\nset [firing v] to [0]\n\ndefine Move (speed)\nchange x by (speed)\nif <touching (level_collision v)?> then\n    change x by ((0) - (speed))\nend\n\ndefine Animation\nif <(Take Damage) = [1]> then\n    Animation: Damage and Death\nelse\n    if <(falling?) < [6]> then\n        if <<(Animation State) = [1]> and <<(Wall Slide) = [0]> and <<(Take Damage) = [0]> and <(End Climbing) = [0]>>>> then\n            Animation: Run Cycle\n        else\n            if <<(Animation State) = [2]> and <<(Take Damage) = [0]> and <(End Climbing) = [0]>>> then\n                Animation: Dashing\n            else\n                if <<(Animation State) = [3]> and <<(Wall Slide) = [0]> and <<(Climbing) = [1]> and <(End Climbing) = [0]>>>> then\n                    Animation: Climbing\n                else\n                    if <<(End Climbing) = [1]> and <(Wall Slide) = [0]>> then\n                        Animation: Climb on Top\n                    else\n                        if <<(Animation State) = [9]> and <<(Wall Slide) = [1]> and <<(Take Damage) = [0]> and <(End Climbing) = [0]>>>> then\n                            Animation: Wall Cling\n                        else\n                            if <<(Animation State) = [10]> and <<(Wall Slide) = [0]> and <<(Climbing) = [1]> and <(End Climbing) = [0]>>>> then\n                                Animation: Climb Start\n                            else\n                                if <<(Clear) = [1]> and <<(Wall Slide) = [0]> and <<(Take Damage) = [0]> and <(End Climbing) = [0]>>>> then\n                                    Animation: CHING!\n                                else\n                                    Animation: Idle\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    else\n        if <<(Wall Jump Animation) = [1]> and <(Take Damage) = [0]>> then\n            Animation: Wall Kicking\n        else\n            if <<(speed y) > [0]> and <(Take Damage) = [0]>> then\n                Animation: Jumping\n            else\n                Animation: Falling\n            end\n        end\n    end\nend\n\ndefine Scrolling Blocks\nchange [scroll x v] by (x position)\nif <(Scroll X) < (Scroll X Min)> then\n    set [scroll x v] to (Scroll X Min)\nelse\n    if <(Scroll X) > (Scroll X Max)> then\n        set [scroll x v] to (Scroll X Max)\n    else\n        set x to (0)\n    end\nend\nchange [scroll y v] by (y position)\nif <(Scroll Y) < (Scroll Y Min)> then\n    set [scroll y v] to (Scroll Y Min)\nelse\n    if <(Scroll Y) > (Scroll Y Max)> then\n        set [scroll y v] to (Scroll Y Max)\n    else\n        set y to (0)\n    end\nend\n\ndefine Animation: Damage and Death\nif <(Dead) = [1]> then\n    set [@armordamage v] to [0]\n    set [@ching v] to [0]\n    set [@climb v] to [0]\n    set [@climbend v] to [0]\n    set [@damage v] to [0]\n    set [@dash v] to [0]\n    set [@exit v] to [0]\n    set [@fall v] to [0]\n    set [@fire v] to [0]\n    set [@idle v] to [0]\n    set [@idlelowhp v] to [0]\n    set [@jump v] to [0]\n    set [@land v] to [0]\n    set [@run v] to [0]\n    set [@wall cling v] to [0]\n    set [@wall jump v] to [0]\n    change [@die v] by (1)\n    if <(@Die) > [0]> then\n        set [global x costume no. v] to [82]\n    end\n    if <(@Die) > [1]> then\n        set [global x costume no. v] to [92]\n    end\n    if <(@Die) > [3]> then\n        set [global x costume no. v] to [93]\n    end\n    if <(@Die) > [5]> then\n        set [global x costume no. v] to [82]\n    end\n    if <(@Die) > [10]> then\n        set [global x costume no. v] to [94]\n    end\n    if <(@Die) = [13]> then\n        start sound [X_LoseLife v]\n        broadcast (Life Lost v)\n    end\n    if <(@Die) > [13]> then\n        set [global x costume no. v] to [107]\n    end\n    if <(@Die) = [100]> then\n        broadcast (Stop Loop v)\n        broadcast (Respawn v)\n    end\nelse\n    if <(Upgrade: Armor) = [1]> then\n        set [@damage v] to [0]\n        set [@ching v] to [0]\n        set [@climb v] to [0]\n        set [@climbend v] to [0]\n        set [@die v] to [0]\n        set [@dash v] to [0]\n        set [@exit v] to [0]\n        set [@fall v] to [0]\n        set [@fire v] to [0]\n        set [@idle v] to [0]\n        set [@idlelowhp v] to [0]\n        set [@jump v] to [0]\n        set [@land v] to [0]\n        set [@run v] to [0]\n        set [@wall cling v] to [0]\n        set [@wall jump v] to [0]\n        change [@armordamage v] by (-1)\n        if <(@ArmorDamage) < [17]> then\n            set [global x costume no. v] to [95]\n        end\n        if <(@ArmorDamage) < [15]> then\n            set [global x costume no. v] to [96]\n        end\n        if <(@ArmorDamage) < [14]> then\n            set [global x costume no. v] to [97]\n        end\n        if <(@ArmorDamage) < [13]> then\n            set [global x costume no. v] to [98]\n        end\n        if <(@ArmorDamage) < [12]> then\n            set [global x costume no. v] to [99]\n        end\n        if <(@ArmorDamage) < [11]> then\n            set [global x costume no. v] to [100]\n        end\n        if <(@ArmorDamage) < [10]> then\n            set [global x costume no. v] to [101]\n        end\n        if <(@ArmorDamage) < [9]> then\n            set [global x costume no. v] to [102]\n        end\n        if <(@ArmorDamage) < [8]> then\n            set [global x costume no. v] to [103]\n        end\n        if <(@ArmorDamage) < [2]> then\n            set [global x costume no. v] to [95]\n        end\n        if <(@ArmorDamage) < [5]> then\n            set [global x costume no. v] to [8]\n            set [take damage v] to [0]\n            set [@armordamage v] to [0]\n        end\n    else\n        set [@armordamage v] to [0]\n        set [@ching v] to [0]\n        set [@climb v] to [0]\n        set [@climbend v] to [0]\n        set [@die v] to [0]\n        set [@dash v] to [0]\n        set [@exit v] to [0]\n        set [@fall v] to [0]\n        set [@fire v] to [0]\n        set [@idle v] to [0]\n        set [@idlelowhp v] to [0]\n        set [@jump v] to [0]\n        set [@land v] to [0]\n        set [@run v] to [0]\n        set [@wall cling v] to [0]\n        set [@wall jump v] to [0]\n        change [@damage v] by (-1)\n        if <(@Damage) < [17]> then\n            set [global x costume no. v] to [82]\n        end\n        if <(@Damage) < [15]> then\n            set [global x costume no. v] to [83]\n        end\n        if <(@Damage) < [14]> then\n            set [global x costume no. v] to [84]\n        end\n        if <(@Damage) < [13]> then\n            set [global x costume no. v] to [85]\n        end\n        if <(@Damage) < [12]> then\n            set [global x costume no. v] to [86]\n        end\n        if <(@Damage) < [11]> then\n            set [global x costume no. v] to [87]\n        end\n        if <(@Damage) < [10]> then\n            set [global x costume no. v] to [88]\n        end\n        if <(@Damage) < [9]> then\n            set [global x costume no. v] to [89]\n        end\n        if <(@Damage) < [8]> then\n            set [global x costume no. v] to [90]\n        end\n        if <(@Damage) < [7]> then\n            set [global x costume no. v] to [91]\n        end\n        if <(@Damage) < [6]> then\n            set [global x costume no. v] to [83]\n        end\n        if <(@Damage) < [2]> then\n            set [global x costume no. v] to [82]\n        end\n        if <(@Damage) < [0]> then\n            set [global x costume no. v] to [8]\n            set [take damage v] to [0]\n            set [@damage v] to [0]\n        end\n    end\nend\n\ndefine Animation: Run Cycle\nset [@armordamage v] to [0]\nset [@ching v] to [0]\nset [@climb v] to [0]\nset [@climbend v] to [0]\nset [@damage v] to [0]\nset [@dash v] to [0]\nset [@die v] to [0]\nset [@exit v] to [0]\nset [@fall v] to [0]\nset [@fire v] to [0]\nset [@idle v] to [0]\nset [@idlelowhp v] to [0]\nset [@jump v] to [0]\nset [@land v] to [0]\nset [@wall cling v] to [0]\nset [@wall jump v] to [0]\nchange [@run v] by (1)\nif <(Firing) = [1]> then\n    if <(@Run) > [0]> then\n        set [global x costume no. v] to [24]\n    end\n    if <(@Run) > [1]> then\n        set [global x costume no. v] to [25]\n    end\n    if <(@Run) > [2]> then\n        set [global x costume no. v] to [26]\n    end\n    if <(@Run) > [4]> then\n        set [global x costume no. v] to [27]\n    end\n    if <(@Run) > [5]> then\n        set [global x costume no. v] to [28]\n    end\n    if <(@Run) > [7]> then\n        set [global x costume no. v] to [29]\n    end\n    if <(@Run) > [8]> then\n        set [global x costume no. v] to [30]\n    end\n    if <(@Run) > [9]> then\n        set [global x costume no. v] to [31]\n    end\n    if <(@Run) > [11]> then\n        set [global x costume no. v] to [32]\n    end\n    if <(@Run) > [12]> then\n        set [global x costume no. v] to [33]\n    end\n    if <(@Run) > [14]> then\n        set [global x costume no. v] to [24]\n        set [@run v] to [1]\n    end\nelse\n    if <(@Run) > [0]> then\n        set [global x costume no. v] to [13]\n    end\n    if <(@Run) > [1]> then\n        set [global x costume no. v] to [14]\n    end\n    if <(@Run) > [2]> then\n        set [global x costume no. v] to [15]\n    end\n    if <(@Run) > [3]> then\n        set [global x costume no. v] to [16]\n    end\n    if <(@Run) > [5]> then\n        set [global x costume no. v] to [17]\n    end\n    if <(@Run) > [6]> then\n        set [global x costume no. v] to [18]\n    end\n    if <(@Run) > [8]> then\n        set [global x costume no. v] to [19]\n    end\n    if <(@Run) > [9]> then\n        set [global x costume no. v] to [20]\n    end\n    if <(@Run) > [10]> then\n        set [global x costume no. v] to [21]\n    end\n    if <(@Run) > [12]> then\n        set [global x costume no. v] to [22]\n    end\n    if <(@Run) > [13]> then\n        set [global x costume no. v] to [23]\n    end\n    if <(@Run) > [15]> then\n        set [global x costume no. v] to [14]\n        set [@run v] to [2]\n    end\nend\n\ndefine Animation: Dashing\nset [@armordamage v] to [0]\nset [@ching v] to [0]\nset [@climb v] to [0]\nset [@climbend v] to [0]\nset [@damage v] to [0]\nset [@die v] to [0]\nset [@exit v] to [0]\nset [@fall v] to [0]\nset [@fire v] to [0]\nset [@idle v] to [0]\nset [@idlelowhp v] to [0]\nset [@jump v] to [0]\nset [@land v] to [0]\nset [@run v] to [0]\nset [@wall cling v] to [0]\nset [@wall jump v] to [0]\nchange [@dash v] by (1)\nif <(Firing) = [1]> then\n    if <(@Dash) > [0]> then\n        set [global x costume no. v] to [75]\n    end\n    if <(@Dash) > [3]> then\n        set [global x costume no. v] to [76]\n    end\n    if <(@Dash) > [15]> then\n        set [global x costume no. v] to [75]\n    end\n    if <(@Dash) > [18]> then\n        set [global x costume no. v] to [11]\n        set [dashing v] to [0]\n    end\nelse\n    if <(@Dash) > [0]> then\n        set [global x costume no. v] to [73]\n    end\n    if <(@Dash) > [3]> then\n        set [global x costume no. v] to [74]\n    end\n    if <(@Dash) > [15]> then\n        set [global x costume no. v] to [73]\n    end\n    if <(@Dash) > [18]> then\n        set [global x costume no. v] to [8]\n        set [dashing v] to [0]\n    end\nend\nif <(@Dash) = [1]> then\n    create clone of (dash_effect v)\nend\nif <(@Dash) = [2]> then\n    create clone of (smoke_effect v)\nend\nif <(@Dash) = [6]> then\n    create clone of (smoke_effect v)\nend\nif <(@Dash) = [10]> then\n    create clone of (smoke_effect v)\nend\nif <(@Dash) = [14]> then\n    create clone of (smoke_effect v)\nend\n\ndefine Animation: Climbing\nset [@armordamage v] to [0]\nset [@ching v] to [0]\nset [@climbend v] to [0]\nset [@damage v] to [0]\nset [@dash v] to [0]\nset [@die v] to [0]\nset [@exit v] to [0]\nset [@fall v] to [0]\nset [@fire v] to [0]\nset [@idle v] to [0]\nset [@idlelowhp v] to [0]\nset [@jump v] to [0]\nset [@land v] to [0]\nset [@run v] to [0]\nset [@wall cling v] to [0]\nset [@wall jump v] to [0]\nif <(Firing) = [1]> then\n    if <(Climb Fire Direction) = [L]> then\n        set [global x costume no. v] to [64]\n    end\n    if <(Climb Fire Direction) = [R]> then\n        set [global x costume no. v] to [63]\n    end\nelse\n    if <(Climb Animation) = [1]> then\n        change [@climb v] by (1)\n    end\n    if <(@Climb) > [0]> then\n        set [global x costume no. v] to [59]\n    end\n    if <(@Climb) > [5]> then\n        set [global x costume no. v] to [60]\n    end\n    if <(@Climb) > [6]> then\n        set [global x costume no. v] to [61]\n    end\n    if <(@Climb) > [7]> then\n        set [global x costume no. v] to [62]\n    end\n    if <(@Climb) > [12]> then\n        set [global x costume no. v] to [61]\n    end\n    if <(@Climb) > [13]> then\n        set [global x costume no. v] to [60]\n    end\n    if <(@Climb) > [14]> then\n        set [global x costume no. v] to [59]\n        set [@climb v] to [1]\n    end\nend\n\ndefine Animation: Climb on Top\nset [@armordamage v] to [0]\nset [@ching v] to [0]\nset [@climb v] to [0]\nset [@damage v] to [0]\nset [@dash v] to [0]\nset [@die v] to [0]\nset [@exit v] to [0]\nset [@fall v] to [0]\nset [@fire v] to [0]\nset [@idle v] to [0]\nset [@idlelowhp v] to [0]\nset [@jump v] to [0]\nset [@land v] to [0]\nset [@run v] to [0]\nset [@wall cling v] to [0]\nset [@wall jump v] to [0]\nchange [@climbend v] by (1)\nif <(@ClimbEnd) > [0]> then\n    set [global x costume no. v] to [65]\nend\nif <(@ClimbEnd) > [3]> then\n    set [global x costume no. v] to [66]\nend\nif <(@ClimbEnd) > [6]> then\n    set [global x costume no. v] to [8]\n    set [climbing v] to [0]\n    set [climb animation v] to [0]\n    set [end climbing v] to [0]\n    set [gravity toggle v] to [1]\n    set [speed y v] to [0]\n    set [falling? v] to [0]\n    set [@climb v] to [0]\n    set [@climbend v] to [0]\nend\n\ndefine Animation: Wall Cling\nset [@armordamage v] to [0]\nset [@ching v] to [0]\nset [@climb v] to [0]\nset [@climbend v] to [0]\nset [@damage v] to [0]\nset [@dash v] to [0]\nset [@die v] to [0]\nset [@exit v] to [0]\nset [@fall v] to [0]\nset [@fire v] to [0]\nset [@idle v] to [0]\nset [@idlelowhp v] to [0]\nset [@jump v] to [0]\nset [@land v] to [0]\nset [@run v] to [0]\nset [@wall jump v] to [0]\nchange [@wall cling v] by (1)\nif <(Firing) = [1]> then\n    if <(@Wall Cling) > [0]> then\n        set [global x costume no. v] to [53]\n    end\n    if <(@Wall Cling) > [2]> then\n        set [global x costume no. v] to [54]\n    end\n    if <(@Wall Cling) > [4]> then\n        set [global x costume no. v] to [55]\n    end\n    if <(@Wall Cling) > [14]> then\n        set [@wall cling v] to [5]\n    end\nelse\n    if <(@Wall Cling) > [0]> then\n        set [global x costume no. v] to [48]\n    end\n    if <(@Wall Cling) > [2]> then\n        set [global x costume no. v] to [49]\n    end\n    if <(@Wall Cling) > [4]> then\n        set [global x costume no. v] to [50]\n    end\n    if <(@Wall Cling) > [14]> then\n        set [@wall cling v] to [5]\n    end\nend\nif <(@Wall Cling) = [3]> then\n    create clone of (smoke_effect v)\nend\nif <(@Wall Cling) = [6]> then\n    create clone of (smoke_effect v)\nend\nif <(@Wall Cling) = [9]> then\n    create clone of (smoke_effect v)\nend\nif <(@Wall Cling) = [12]> then\n    create clone of (smoke_effect v)\nend\n\ndefine Animation: Idle\nset [@armordamage v] to [0]\nset [@ching v] to [0]\nset [@climb v] to [0]\nset [@climbend v] to [0]\nset [@damage v] to [0]\nset [@dash v] to [0]\nset [@die v] to [0]\nset [@exit v] to [0]\nset [@fall v] to [0]\nset [@jump v] to [0]\nset [@run v] to [0]\nset [@wall cling v] to [0]\nset [@wall jump v] to [0]\nif <(Landing Animation) = [1]> then\n    set [@fire v] to [0]\n    set [@idle v] to [0]\n    set [@idlelowhp v] to [0]\n    change [@land v] by (1)\n    if <(Firing) = [1]> then\n        if <(@Land) > [0]> then\n            set [global x costume no. v] to [46]\n        end\n        if <(@Land) > [2]> then\n            set [global x costume no. v] to [47]\n        end\n        if <(@Land) > [4]> then\n            set [global x costume no. v] to [11]\n            set [landing animation v] to [0]\n        end\n    else\n        if <(@Land) > [0]> then\n            set [global x costume no. v] to [39]\n        end\n        if <(@Land) > [2]> then\n            set [global x costume no. v] to [40]\n        end\n        if <(@Land) > [4]> then\n            set [global x costume no. v] to [8]\n            set [landing animation v] to [0]\n        end\n    end\nelse\n    if <<(Firing) = [1]> and <(Take Damage) = [0]>> then\n        set [@idle v] to [0]\n        set [@land v] to [0]\n        set [@idlelowhp v] to [0]\n        change [@fire v] by (1)\n        if <(@Fire) > [0]> then\n            set [global x costume no. v] to [11]\n        end\n        if <(@Fire) > [1]> then\n            set [global x costume no. v] to [12]\n        end\n        if <(@Fire) > [4]> then\n            set [global x costume no. v] to [11]\n        end\n    else\n        if <<(Low on Health) = [1]> and <(Landing Animation) = [0]>> then\n            set [@fire v] to [0]\n            set [@land v] to [0]\n            set [@idle v] to [0]\n            change [@idlelowhp v] by (1)\n            if <(@IdleLowHP) > [0]> then\n                set [global x costume no. v] to [8]\n            end\n            if <(@IdleLowHP) > [5]> then\n                set [global x costume no. v] to [77]\n            end\n            if <(@IdleLowHP) > [10]> then\n                set [global x costume no. v] to [8]\n            end\n            if <(@IdleLowHP) > [15]> then\n                set [global x costume no. v] to [78]\n            end\n            if <(@IdleLowHP) > [20]> then\n                set [global x costume no. v] to [8]\n                set [@idlelowhp v] to [1]\n            end\n        else\n            set [@fire v] to [0]\n            set [@land v] to [0]\n            set [@idlelowhp v] to [0]\n            change [@idle v] by (1)\n            if <(@Idle) > [0]> then\n                set [global x costume no. v] to [8]\n            end\n            if <(@Idle) > [70]> then\n                set [global x costume no. v] to [9]\n            end\n            if <(@Idle) > [72]> then\n                set [global x costume no. v] to [10]\n            end\n            if <(@Idle) > [74]> then\n                set [global x costume no. v] to [9]\n            end\n            if <(@Idle) > [76]> then\n                set [global x costume no. v] to [8]\n                set [@idle v] to [1]\n            end\n        end\n    end\nend\n\ndefine Animation: Climb Start\nset [@armordamage v] to [0]\nset [@ching v] to [0]\nset [@climbend v] to [0]\nset [@damage v] to [0]\nset [@dash v] to [0]\nset [@die v] to [0]\nset [@exit v] to [0]\nset [@fall v] to [0]\nset [@fire v] to [0]\nset [@idle v] to [0]\nset [@idlelowhp v] to [0]\nset [@jump v] to [0]\nset [@land v] to [0]\nset [@run v] to [0]\nset [@wall cling v] to [0]\nset [@wall jump v] to [0]\nchange [@climb v] by (1)\nif <(@Climb) > [0]> then\n    set [global x costume no. v] to [58]\nend\nif <(@Climb) = [4]> then\n    set [global x costume no. v] to [59]\n    set [climbing v] to [1]\n    set [animation state v] to [3]\nend\n\ndefine Animation: Wall Kicking\nset [@armordamage v] to [0]\nset [@ching v] to [0]\nset [@climb v] to [0]\nset [@climbend v] to [0]\nset [@damage v] to [0]\nset [@dash v] to [0]\nset [@die v] to [0]\nset [@exit v] to [0]\nset [@fall v] to [0]\nset [@fire v] to [0]\nset [@idle v] to [0]\nset [@idlelowhp v] to [0]\nset [@jump v] to [0]\nset [@land v] to [0]\nset [@run v] to [0]\nset [@wall cling v] to [0]\nchange [@wall jump v] by (1)\nif <(Firing) = [1]> then\n    if <(@Wall Jump) > [0]> then\n        set [global x costume no. v] to [56]\n    end\n    if <(@Wall Jump) > [3]> then\n        set [global x costume no. v] to [57]\n    end\n    if <(@Wall Jump) > [9]> then\n        set [global x costume no. v] to [43]\n        set [wall jump animation v] to [0]\n        set [@wall jump v] to [0]\n        set [@jump v] to [5]\n    end\nelse\n    if <(@Wall Jump) > [0]> then\n        set [global x costume no. v] to [51]\n    end\n    if <(@Wall Jump) > [3]> then\n        set [global x costume no. v] to [52]\n    end\n    if <(@Wall Jump) > [9]> then\n        set [global x costume no. v] to [36]\n        set [wall jump animation v] to [0]\n        set [@wall jump v] to [0]\n        set [@jump v] to [5]\n    end\nend\nif <(@Wall Jump) = [1]> then\n    create clone of (wall_kick_effect v)\nend\n\ndefine Animation: Jumping\nset [@armordamage v] to [0]\nset [@ching v] to [0]\nset [@climb v] to [0]\nset [@climbend v] to [0]\nset [@damage v] to [0]\nset [@dash v] to [0]\nset [@die v] to [0]\nset [@exit v] to [0]\nset [@fall v] to [0]\nset [@fire v] to [0]\nset [@idle v] to [0]\nset [@idlelowhp v] to [0]\nset [@land v] to [0]\nset [@run v] to [0]\nset [@wall cling v] to [0]\nset [@wall jump v] to [0]\nchange [@jump v] by (1)\nif <(Firing) = [1]> then\n    if <(@Jump) > [0]> then\n        set [global x costume no. v] to [41]\n    end\n    if <(@Jump) > [2]> then\n        set [global x costume no. v] to [42]\n    end\n    if <(@Jump) > [4]> then\n        set [global x costume no. v] to [43]\n    end\nelse\n    if <(@Jump) > [0]> then\n        set [global x costume no. v] to [34]\n    end\n    if <(@Jump) > [2]> then\n        set [global x costume no. v] to [35]\n    end\n    if <(@Jump) > [4]> then\n        set [global x costume no. v] to [36]\n    end\nend\n\ndefine Animation: Falling\nset [@armordamage v] to [0]\nset [@ching v] to [0]\nset [@climb v] to [0]\nset [@climbend v] to [0]\nset [@damage v] to [0]\nset [@dash v] to [0]\nset [@die v] to [0]\nset [@exit v] to [0]\nset [@fire v] to [0]\nset [@idle v] to [0]\nset [@idlelowhp v] to [0]\nset [@jump v] to [0]\nset [@land v] to [0]\nset [@run v] to [0]\nset [@wall cling v] to [0]\nset [@wall jump v] to [0]\nchange [@fall v] by (1)\nif <(Firing) = [1]> then\n    if <(@Fall) > [0]> then\n        set [global x costume no. v] to [43]\n    end\n    if <(@Fall) > [1]> then\n        set [global x costume no. v] to [44]\n    end\n    if <(@Fall) > [3]> then\n        set [global x costume no. v] to [45]\n    end\nelse\n    if <(@Fall) > [0]> then\n        set [global x costume no. v] to [36]\n    end\n    if <(@Fall) > [1]> then\n        set [global x costume no. v] to [37]\n    end\n    if <(@Fall) > [3]> then\n        set [global x costume no. v] to [38]\n    end\nend\n\nwhen I receive [capsule event v]\nset [animation state v] to [0]\nset [invincible v] to [1]\n\nwhen I receive [snap x into the capsule v]\nset x to (Particle X)\nset y to (Particle Y)\n\nwhen I receive [start upgrading v]\nset [animation state v] to [0]\nset [invincible v] to [1]\n\nwhen I receive [respawn v]\nstop [other scripts in sprite v]\nbroadcast (Pause v)\nbroadcast (Transition In v) and wait\nbroadcast (Clear v)\nbroadcast (Setup v) and wait\nbroadcast (Level Loop v)\nbroadcast (Play v)\nbroadcast (Transition Out v) and wait\nif <not <(Level NO.) = (join [Boss] (Boss NO.))>> then\n    broadcast (Play BG Music v)\n    broadcast (Ready Message v) and wait\nend\nbroadcast (Player Intro v)\n\nwhen I receive [ching! v]\nset [clear v] to [1]\nset [@armordamage v] to [0]\nset [@climb v] to [0]\nset [@climbend v] to [0]\nset [@damage v] to [0]\nset [@dash v] to [0]\nset [@die v] to [0]\nset [@exit v] to [0]\nset [@fall v] to [0]\nset [@fire v] to [0]\nset [@idle v] to [0]\nset [@idlelowhp v] to [0]\nset [@jump v] to [0]\nset [@land v] to [0]\nset [@run v] to [0]\nset [@wall cling v] to [0]\nset [@wall jump v] to [0]\n\nwhen I receive [continue playing v]\nset [invincible v] to [0]\n\ndefine Animation: CHING!\nset [@armordamage v] to [0]\nset [@fall v] to [0]\nset [@climb v] to [0]\nset [@climbend v] to [0]\nset [@damage v] to [0]\nset [@dash v] to [0]\nset [@die v] to [0]\nset [@exit v] to [0]\nset [@fire v] to [0]\nset [@idle v] to [0]\nset [@idlelowhp v] to [0]\nset [@jump v] to [0]\nset [@land v] to [0]\nset [@run v] to [0]\nset [@wall cling v] to [0]\nset [@wall jump v] to [0]\nchange [@ching v] by (1)\nif <(@Ching) > [0]> then\n    set [global x costume no. v] to [67]\nend\nif <(@Ching) = [5]> then\n    start sound [X_Ching v]\nend\nif <(@Ching) > [5]> then\n    set [global x costume no. v] to [68]\nend\nif <(@Ching) > [6]> then\n    set [global x costume no. v] to [69]\nend\nif <(@Ching) > [7]> then\n    set [global x costume no. v] to [70]\nend\nif <(@Ching) > [8]> then\n    set [global x costume no. v] to [71]\nend\nif <(@Ching) > [9]> then\n    set [global x costume no. v] to [67]\nend\nif <(@Ching) = [20]> then\n    set [global x costume no. v] to [8]\n    set [clear v] to [0]\n    set [@ching v] to [0]\n    set [playable v] to [1]\n    set [invincible v] to [0]\nend\n\nwhen I receive [contact player v]\nif <<(Take Damage) = [0]> and <(Damage Toggle) = [1]>> then\n    if <(Upgrade: Armor) = [1]> then\n        change [hp v] by ((Contact Damage) * (-0.5))\n    else\n        change [hp v] by ((Contact Damage) * (-1))\n    end\n    start sound [X_Damage v]\n    set [take damage v] to [1]\n    set [charging v] to [0]\n    if <(HP) < [1]> then\n        set [hp v] to [0]\n        Die\n    else\n        Take Damage\n    end\nend\n\nwhen I receive [stage clear v]\nstop [other scripts in sprite v]\nset [global x costume no. v] to [8]\nwait (6.5) seconds\nset [global x costume no. v] to [67]\nwait (0.1) seconds\nstart sound [X_Ching v]\nrepeat (4)\n    change [global x costume no. v] by (1)\n    wait (0.01) seconds\nend\nset [global x costume no. v] to [67]\nwait (0.75) seconds\nset [global x costume no. v] to [8]\nwait (0.05) seconds\nstart sound [X_TeleportUp v]\nset [global x costume no. v] to [7]\nwait (0.05) seconds\nset [global x costume no. v] to [2]\nwait (0.05) seconds\nset [global x costume no. v] to [1]\nrepeat until <(X Sprite Off Y) > [359]>\n    change [x sprite off y v] by (20)\nend\nset [x sprite off y v] to [360]\nwait (0.5) seconds\nhide\nbroadcast (Pause v)\nbroadcast (Stop Loop v)\nbroadcast (Transition In v) and wait\nbroadcast (Clear v)\nwait (2) seconds\nbroadcast (Weapon Get Background v)\nbroadcast (Transition Out v) and wait\nbroadcast (Get a new Weapon v)\n\nwhen I receive [enter boss menu v]\nstop [other scripts in sprite v]\nhide\nbroadcast (Pause v)\nbroadcast (Stop Loop v)\nbroadcast (Stop Music v)\nbroadcast (Transition In v) and wait\nbroadcast (Clear v)\nwait (2) seconds\nbroadcast (Boss Menu Background v)\nbroadcast (Transition Out v) and wait\nbroadcast (Boss Menu Select v)\n\nwhen I receive [clear v]\nset [speed y v] to [0]\nset [falling? v] to [10]\nset [wall slide v] to [0]\nset [wall jump v] to [0]\nset [gravity toggle v] to [1]\nset [moving left v] to [0]\nset [moving right v] to [0]\nset [in ladder? v] to [0]\nset [climbing v] to [0]\nset [climb animation v] to [0]\nset [climb fire direction v] to [0]\nset [end climbing v] to [0]\nset [landing animation v] to [0]\nset [global x costume no. v] to [1]\nset [x sprite off x v] to [0]\nset [x sprite off y v] to [360]\nset [take damage v] to [0]\nset [damage timer v] to [0]\nset [damage toggle v] to [0]\nset [low on health v] to [0]\nset [invincible v] to [0]\nset [ching animation v] to [0]\nset [clear v] to [0]\nset [wall jump animation v] to [0]\nset [animation state v] to [0]\nset [dashing v] to [0]\nset [crouch v] to [0]\nset [firing v] to [0]\nset [fire duration v] to [0]\nset [charging v] to [0]\nset [dead v] to [0]\nset [@idle v] to [0]\nset [@run v] to [0]\nset [@fire v] to [0]\nset [@dash v] to [0]\nset [@jump v] to [0]\nset [@fall v] to [0]\nset [@land v] to [0]\nset [@wall cling v] to [0]\nset [@wall jump v] to [0]\nset [@climb v] to [0]\nset [@climbend v] to [0]\nset [@idlelowhp v] to [0]\nset [@damage v] to [0]\nset [@armordamage v] to [0]\nset [@die v] to [0]\nset [@ching v] to [0]\nset [@exit v] to [0]\nhide\n\nwhen I receive [boss start v]\nset [playable v] to [1]\n\ndefine Current Weapon\nif <(Player: Weapon) = [1]> then\n    Homing Torpedo\nelse\n    if <(Player: Weapon) = [2]> then\n        Shotgun Ice\n    else\n        if <(Player: Weapon) = [3]> then\n            Fire Wave\n        else\n            if <(Player: Weapon) = [4]> then\n                Boomerang Cutter\n            else\n                if <(Player: Weapon) = [5]> then\n                    Chameleon Sting\n                else\n                    if <(Player: Weapon) = [6]> then\n                        Electric Spark\n                    else\n                        if <(Player: Weapon) = [7]> then\n                            Storm Tornado\n                        else\n                            if <(Player: Weapon) = [8]> then\n                                Rolling Shield\n                            else\n                                X - Buster\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [warning message v]\nset [animation state v] to [0]\n\ndefine Homing Torpedo\nif <(Player: Weapon) = [1]> then\n\ndefine Fire Wave\nif <(Player: Weapon) = [2]> then\n\ndefine Shotgun Ice\nif <(Player: Weapon) = [2]> then\n\ndefine Boomerang Cutter\nif <(Player: Weapon) = [4]> then\n\nwhen I receive [return fire v]\nset [fire key v] to [0]\n\ndefine Broadcast Boss Warning\nif <<(Level NO.) = [Boss1]> or <<(Level NO.) = [Boss2]> or <<(Level NO.) = [Boss3]> or <(Level NO.) = [Boss4]>>>> then\n    broadcast (Warning Message v)\nend\n\ndefine Chameleon Sting\nif <(Player: Weapon) = [5]> then\n\ndefine Electric Spark\nif <(Player: Weapon) = [6]> then\n\ndefine Storm Tornado\nif <(Player: Weapon) = [7]> then\n\ndefine Rolling Shield\nif <(Player: Weapon) = [8]> then\n\n@X - Base\n\ndefine Switch Costume (#costume)\nif <not <(costume [number v]) = (#costume)>> then\n    switch costume to (#costume)\nend\n\nwhen I receive [level loop v]\nforever\n    if <(Upgrade: Helmet) = [0]> then\n        show\n        go to (player v)\n        set x to (([x position v] of [player v]) + (X Sprite Off X))\n        set y to (([y position v] of [player v]) + (X Sprite Off Y))\n        point in direction ([direction v] of [player v])\n        if <([abs v] of (x position) ) > [230]> then\n            hide\n        else\n            if <([abs v] of (y position) ) > [160]> then\n                hide\n            else\n                show\n            end\n        end\n        Switch Costume (Global X Costume NO.)\n    else\n        hide\n    end\nend\n\nwhen I receive [setup v]\nset rotation style [left-right v]\nhide\nset [brightness v] effect to (0)\n\nwhen I receive [upgrade flash v]\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nwait (1) seconds\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nset [brightness v] effect to (0)\nwait (0.5) seconds\nrepeat (5)\n    change [brightness v] effect by (10)\nend\nrepeat (5)\n    change [brightness v] effect by (-10)\nend\nset [brightness v] effect to (0)\nbroadcast (CHING! v)\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\nwhen I receive [clear v]\nhide\n\n@X1 - Legs\n\ndefine Switch Costume (#costume)\nif <not <(costume [number v]) = (#costume)>> then\n    switch costume to (#costume)\nend\n\nwhen I receive [setup v]\nset rotation style [left-right v]\nhide\nset [brightness v] effect to (0)\n\nwhen I receive [level loop v]\nforever\n    if <(Upgrade: Legs) = [1]> then\n        show\n        go to (player v)\n        set x to (([x position v] of [player v]) + (X Sprite Off X))\n        set y to (([y position v] of [player v]) + (X Sprite Off Y))\n        point in direction ([direction v] of [player v])\n        if <([abs v] of (x position) ) > [230]> then\n            hide\n        else\n            if <([abs v] of (y position) ) > [160]> then\n                hide\n            else\n                show\n            end\n        end\n        Switch Costume (Global X Costume NO.)\n    else\n        hide\n    end\nend\n\nwhen I receive [upgrade flash v]\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nwait (1) seconds\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nset [brightness v] effect to (0)\nwait (0.5) seconds\nrepeat (5)\n    change [brightness v] effect by (10)\nend\nrepeat (5)\n    change [brightness v] effect by (-10)\nend\nset [brightness v] effect to (0)\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\nwhen I receive [clear v]\nhide\n\n@X1 - Armor\n\ndefine Switch Costume (#costume)\nif <not <(costume [number v]) = (#costume)>> then\n    switch costume to (#costume)\nend\n\nwhen I receive [setup v]\nset rotation style [left-right v]\nhide\nset [brightness v] effect to (0)\n\nwhen I receive [level loop v]\nforever\n    if <(Upgrade: Armor) = [1]> then\n        show\n        go to (player v)\n        set x to (([x position v] of [player v]) + (X Sprite Off X))\n        set y to (([y position v] of [player v]) + (X Sprite Off Y))\n        point in direction ([direction v] of [player v])\n        if <([abs v] of (x position) ) > [230]> then\n            hide\n        else\n            if <([abs v] of (y position) ) > [160]> then\n                hide\n            else\n                show\n            end\n        end\n        Switch Costume (Global X Costume NO.)\n    else\n        hide\n    end\nend\n\nwhen I receive [upgrade flash v]\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nwait (1) seconds\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nset [brightness v] effect to (0)\nwait (0.5) seconds\nrepeat (5)\n    change [brightness v] effect by (10)\nend\nrepeat (5)\n    change [brightness v] effect by (-10)\nend\nset [brightness v] effect to (0)\n\nwhen I receive [clear v]\nhide\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\n@X1 - Arms\n\ndefine Switch Costume (#costume)\nif <not <(costume [number v]) = (#costume)>> then\n    switch costume to (#costume)\nend\n\nwhen I receive [setup v]\nset rotation style [left-right v]\nhide\nset [brightness v] effect to (0)\n\nwhen I receive [level loop v]\nforever\n    if <(Upgrade: Arms) = [1]> then\n        show\n        go to (player v)\n        set x to (([x position v] of [player v]) + (X Sprite Off X))\n        set y to (([y position v] of [player v]) + (X Sprite Off Y))\n        point in direction ([direction v] of [player v])\n        if <([abs v] of (x position) ) > [230]> then\n            hide\n        else\n            if <([abs v] of (y position) ) > [160]> then\n                hide\n            else\n                show\n            end\n        end\n        Switch Costume (Global X Costume NO.)\n    else\n        hide\n    end\nend\n\nwhen I receive [upgrade flash v]\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nwait (1) seconds\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nset [brightness v] effect to (0)\nwait (0.5) seconds\nrepeat (5)\n    change [brightness v] effect by (10)\nend\nrepeat (5)\n    change [brightness v] effect by (-10)\nend\nset [brightness v] effect to (0)\n\nwhen I receive [clear v]\nhide\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\n@X1 - Helmet\n\ndefine Switch Costume (#costume)\nif <not <(costume [number v]) = (#costume)>> then\n    switch costume to (#costume)\nend\n\nwhen I receive [setup v]\nset rotation style [left-right v]\nhide\nset [brightness v] effect to (0)\n\nwhen I receive [level loop v]\nforever\n    if <(Upgrade: Helmet) = [1]> then\n        show\n        go to (player v)\n        set x to (([x position v] of [player v]) + (X Sprite Off X))\n        set y to (([y position v] of [player v]) + (X Sprite Off Y))\n        point in direction ([direction v] of [player v])\n        if <([abs v] of (x position) ) > [230]> then\n            hide\n        else\n            if <([abs v] of (y position) ) > [160]> then\n                hide\n            else\n                show\n            end\n        end\n        Switch Costume (Global X Costume NO.)\n    else\n        hide\n    end\nend\n\nwhen I receive [upgrade flash v]\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nwait (1) seconds\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nset [brightness v] effect to (0)\nwait (0.5) seconds\nrepeat (5)\n    change [brightness v] effect by (10)\nend\nrepeat (5)\n    change [brightness v] effect by (-10)\nend\nset [brightness v] effect to (0)\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\nwhen I receive [clear v]\nhide\n\n@Highway_Level\n\nwhen I receive [setup v]\nif <(Level NO.) = [1]> then\n    show\n    clear graphic effects\n    go to x: (0) y: (0)\n    set [level_x v] to [0]\n    set [level_y v] to [0]\n    switch costume to (hwy_0_0 v)\n    Create\n    hide\nend\n\ndefine Create\nif <(Level NO.) = [1]> then\n    repeat (32)\n        create clone of (_myself_ v)\n        change [level_x v] by (480)\n        next costume\n    end\n    set [level_x v] to [0]\n    set [level_y v] to [360]\n    repeat (32)\n        create clone of (_myself_ v)\n        change [level_x v] by (480)\n        next costume\n    end\n    switch costume to (null v)\nend\n\nwhen I receive [level loop v]\nif <(Level NO.) = [1]> then\n    forever\n        if <(Pause) = [0]> then\n            set x to ((Level_X) - (Scroll X))\n            set y to ((Level_Y) - (Scroll Y))\n            if <([abs v] of ((Level_X) - (Scroll X)) ) > [480]> then\n                hide\n            else\n                if <([abs v] of ((Level_Y) - (Scroll Y)) ) > [360]> then\n                    hide\n                else\n                    show\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [clear v]\nhide\nset [level_x v] to [0]\nset [level_y v] to [0]\ngo to x: (0) y: (0)\ndelete this clone\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\n@Highway_Level_Foreground\n\nwhen I receive [setup v]\nif <(Level NO.) = [1]> then\n    show\n    clear graphic effects\n    go to x: (0) y: (0)\n    set [level_x v] to [12480]\n    set [level_y v] to [0]\n    switch costume to (hwy_26_0 v)\n    Create\n    hide\nend\n\ndefine Create\nif <(Level NO.) = [1]> then\n    create clone of (_myself_ v)\n    change [level_x v] by (480)\n    switch costume to (hwy_27_0 v)\n    create clone of (_myself_ v)\n    set [level_x v] to [960]\n    set [level_y v] to [360]\n    switch costume to (hwy_2_1 v)\n    repeat (8)\n        create clone of (_myself_ v)\n        change [level_x v] by (480)\n        next costume\n    end\n    change [level_x v] by (960)\n    create clone of (_myself_ v)\n    change [level_x v] by (960)\n    next costume\n    create clone of (_myself_ v)\n    change [level_x v] by (960)\n    next costume\n    create clone of (_myself_ v)\n    change [level_x v] by (480)\n    next costume\n    create clone of (_myself_ v)\n    change [level_x v] by (1920)\n    next costume\n    create clone of (_myself_ v)\n    change [level_x v] by (960)\n    next costume\n    repeat (5)\n        create clone of (_myself_ v)\n        change [level_x v] by (480)\n        next costume\n    end\n    switch costume to (null v)\nend\n\nwhen I receive [level loop v]\nif <(Level NO.) = [1]> then\n    forever\n        if <(Pause) = [0]> then\n            set x to ((Level_X) - (Scroll X))\n            set y to ((Level_Y) - (Scroll Y))\n            if <([abs v] of ((Level_X) - (Scroll X)) ) > [480]> then\n                hide\n            else\n                if <([abs v] of ((Level_Y) - (Scroll Y)) ) > [360]> then\n                    hide\n                else\n                    show\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [clear v]\nhide\nset [level_x v] to [0]\nset [level_y v] to [0]\ngo to x: (0) y: (0)\ndelete this clone\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\n@Level_Collision\n\ndefine Create\nwait (1) seconds\nCheck Level\n\nwhen I receive [setup v]\nshow\nclear graphic effects\ngo to x: (0) y: (0)\nset [level_x v] to [0]\nset [level_y v] to [0]\nCreate\nhide\n\ndefine Check Level\nif <(Level NO.) = [1]> then\n    Level: Intro Stage\nend\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\nwhen I receive [level loop v]\nforever\n    if <(Pause) = [0]> then\n        set x to ((Level_X) - (Scroll X))\n        set y to ((Level_Y) - (Scroll Y))\n        if <([abs v] of ((Level_X) - (Scroll X)) ) > [480]> then\n            hide\n        else\n            if <([abs v] of ((Level_Y) - (Scroll Y)) ) > [360]> then\n                hide\n            else\n                show\n            end\n        end\n        set [ghost v] effect to (100)\n    end\nend\n\ndefine Level: Intro Stage\nswitch costume to (hwy_hit_1 v)\nset [level_x v] to [12480]\nset [level_y v] to [0]\nrepeat (6)\n    create clone of (_myself_ v)\n    change [level_x v] by (480)\nend\nswitch costume to (hwy_hit_2 v)\nset [level_x v] to [0]\nset [level_y v] to [360]\nrepeat (3)\n    create clone of (_myself_ v)\n    change [level_x v] by (480)\nend\nswitch costume to (hwy_hit_3 v)\ncreate clone of (_myself_ v)\nchange [level_x v] by (480)\nswitch costume to (hwy_hit_4 v)\ncreate clone of (_myself_ v)\nchange [level_x v] by (480)\nswitch costume to (hwy_hit_5 v)\ncreate clone of (_myself_ v)\nchange [level_x v] by (480)\nswitch costume to (hwy_hit_6 v)\nrepeat (3)\n    create clone of (_myself_ v)\n    change [level_x v] by (480)\nend\nswitch costume to (hwy_hit_7 v)\ncreate clone of (_myself_ v)\nchange [level_x v] by (480)\nswitch costume to (hwy_hit_6 v)\nrepeat (2)\n    create clone of (_myself_ v)\n    change [level_x v] by (480)\nend\nswitch costume to (hwy_hit_8 v)\ncreate clone of (_myself_ v)\nchange [level_x v] by (480)\nswitch costume to (hwy_hit_9 v)\nrepeat (2)\n    create clone of (_myself_ v)\n    change [level_x v] by (480)\nend\nswitch costume to (hwy_hit_10 v)\ncreate clone of (_myself_ v)\nchange [level_x v] by (480)\nswitch costume to (hwy_hit_11 v)\ncreate clone of (_myself_ v)\nchange [level_x v] by (480)\nswitch costume to (hwy_hit_12 v)\ncreate clone of (_myself_ v)\nchange [level_x v] by (480)\nswitch costume to (hwy_hit_13 v)\ncreate clone of (_myself_ v)\nchange [level_x v] by (480)\nswitch costume to (hwy_hit_14 v)\ncreate clone of (_myself_ v)\nchange [level_x v] by (480)\nswitch costume to (hwy_hit_15 v)\ncreate clone of (_myself_ v)\nchange [level_x v] by (480)\nswitch costume to (hwy_hit_9 v)\ncreate clone of (_myself_ v)\nchange [level_x v] by (480)\nswitch costume to (hwy_hit_16 v)\ncreate clone of (_myself_ v)\nchange [level_x v] by (480)\nswitch costume to (hwy_hit_17 v)\ncreate clone of (_myself_ v)\nchange [level_x v] by (480)\nswitch costume to (hwy_hit_9 v)\ncreate clone of (_myself_ v)\nchange [level_x v] by (480)\nswitch costume to (hwy_hit_18 v)\ncreate clone of (_myself_ v)\nchange [level_x v] by (480)\nswitch costume to (null v)\n\nwhen I receive [clear v]\nhide\nset [level_x v] to [0]\nset [level_y v] to [0]\ngo to x: (0) y: (0)\ndelete this clone\n\n@Level_Hazard\n\n@Transition\n\nwhen I receive [transition in v]\ngo to [front v] layer\nswitch costume to (sphere0001 v)\nhide\nshow\nstart sound [Disconnect v]\nrepeat (16)\n    next costume\nend\n\nwhen I receive [transition out v]\ngo to [front v] layer\nswitch costume to (sphere0017 v)\nstart sound [Connect v]\nrepeat (16)\n    switch costume to ((costume [number v]) - (1))\nend\nhide\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\n@HP_Bar\n\nwhen flag clicked\nset [hp max v] to [16]\nset [fill amount v] to [0]\ngo to x: (-200) y: (-4)\nhide\n\nwhen I receive [level loop v]\nforever\n    if <(Pause) = [0]> then\n        switch costume to (join [HP_] (HP))\n    end\nend\n\nwhen I receive [play v]\nshow\n\nwhen I receive [setup v]\nset [hp v] to (HP Max)\nswitch costume to (join [HP_] (HP))\nstop [other scripts in sprite v]\n\nwhen I receive [clear v]\nhide\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\nwhen I receive [item: get 2 hp v]\nset [fill amount v] to [2]\nset [pause v] to [1]\nrepeat until <<(Fill Amount) < [1]> or <(HP) = (HP Max)>>\n    start sound [Energy_Fill v]\n    change [hp v] by (1)\n    switch costume to (join [HP_] (HP))\n    if <(HP) > (HP Max)> then\n        set [hp v] to (HP Max)\n        switch costume to (join [HP_] (HP))\n    end\n    change [fill amount v] by (-1)\n    wait (0.1) seconds\nend\nset [fill amount v] to [0]\nset [pause v] to [0]\n\nwhen I receive [item: get 10 hp v]\nset [fill amount v] to [10]\nset [pause v] to [1]\nrepeat until <<(Fill Amount) < [1]> or <(HP) = (HP Max)>>\n    start sound [Energy_Fill v]\n    change [hp v] by (1)\n    switch costume to (join [HP_] (HP))\n    if <(HP) > (HP Max)> then\n        set [hp v] to (HP Max)\n        switch costume to (join [HP_] (HP))\n    end\n    change [fill amount v] by (-1)\n    wait (0.1) seconds\nend\nset [fill amount v] to [0]\nset [pause v] to [0]\n\nwhen I receive [heart tank collected v]\nchange [hp max v] by (2)\nchange [heart tanks v] by (1)\nset [fill amount v] to [2]\nset [pause v] to [1]\nwait (2) seconds\nbroadcast (Heart Tank: Increase Limit v)\nrepeat until <<(Fill Amount) < [1]> or <(HP) = (HP Max)>>\n    start sound [Energy_Fill v]\n    change [hp v] by (1)\n    switch costume to (join [HP_] (HP))\n    if <(HP) > (HP Max)> then\n        set [hp v] to (HP Max)\n        switch costume to (join [HP_] (HP))\n    end\n    change [fill amount v] by (-1)\n    wait (0.1) seconds\nend\nset [fill amount v] to [0]\nset [pause v] to [0]\n\n@HP_Bar_Limit\n\nwhen flag clicked\ngo to x: (-200) y: (-4)\nhide\n\nwhen I receive [play v]\nshow\n\nwhen I receive [level loop v]\nforever\n    if <(Pause) = [0]> then\n        Check Limit\n    end\nend\n\ndefine Check Limit\nif <(Heart Tanks) = [0]> then\n    Switch Costume [1]\nend\nif <(Heart Tanks) = [1]> then\n    Switch Costume [2]\nend\nif <(Heart Tanks) = [2]> then\n    Switch Costume [3]\nend\nif <(Heart Tanks) = [3]> then\n    Switch Costume [4]\nend\nif <(Heart Tanks) = [4]> then\n    Switch Costume [5]\nend\nif <(Heart Tanks) = [5]> then\n    Switch Costume [6]\nend\nif <(Heart Tanks) = [6]> then\n    Switch Costume [7]\nend\nif <(Heart Tanks) = [7]> then\n    Switch Costume [8]\nend\nif <(Heart Tanks) = [8]> then\n    Switch Costume [9]\nend\n\ndefine Switch Costume (#costume)\nif <not <(costume [number v]) = (#costume)>> then\n    switch costume to (#costume)\nend\n\nwhen I receive [setup v]\nCheck Limit\nstop [other scripts in sprite v]\n\nwhen I receive [clear v]\nhide\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\nwhen I receive [heart tank: increase limit v]\nif <(Heart Tanks) = [0]> then\n    Switch Costume [1]\nend\nif <(Heart Tanks) = [1]> then\n    Switch Costume [2]\nend\nif <(Heart Tanks) = [2]> then\n    Switch Costume [3]\nend\nif <(Heart Tanks) = [3]> then\n    Switch Costume [4]\nend\nif <(Heart Tanks) = [4]> then\n    Switch Costume [5]\nend\nif <(Heart Tanks) = [5]> then\n    Switch Costume [6]\nend\nif <(Heart Tanks) = [6]> then\n    Switch Costume [7]\nend\nif <(Heart Tanks) = [7]> then\n    Switch Costume [8]\nend\nif <(Heart Tanks) = [8]> then\n    Switch Costume [9]\nend\n\n@Game\n\ndefine Input\nif <key (up arrow v) pressed?> then\n    set [input: up v] to [1]\nelse\n    set [input: up v] to [0]\nend\nif <key (down arrow v) pressed?> then\n    set [input: down v] to [1]\nelse\n    set [input: down v] to [0]\nend\nif <key (left arrow v) pressed?> then\n    if <(Input: Left) = [0]> then\n        if <([direction v] of [player v]) > [0]> then\n            set [tap count v] to [0]\n        end\n        change [tap count v] by (1)\n        set [double tap timer v] to [10]\n        if <(Tap Count) > [1]> then\n            set [input: dash v] to [1]\n            set [double tap timer v] to [0]\n        end\n    end\n    set [input: left v] to [1]\nelse\n    set [input: left v] to [0]\nend\nif <key (right arrow v) pressed?> then\n    if <(Input: Right) = [0]> then\n        if <([direction v] of [player v]) < [0]> then\n            set [tap count v] to [0]\n        end\n        change [tap count v] by (1)\n        set [double tap timer v] to [10]\n        if <(Tap Count) > [1]> then\n            set [input: dash v] to [1]\n            set [double tap timer v] to [0]\n        end\n    end\n    set [input: right v] to [1]\nelse\n    set [input: right v] to [0]\nend\nif <key (z v) pressed?> then\n    set [input: shot v] to [1]\nelse\n    set [input: shot v] to [0]\nend\nif <key (x v) pressed?> then\n    set [input: jump v] to [1]\nelse\n    set [input: jump v] to [0]\nend\nif <<key (c v) pressed?> or <(Tap Count) > [1]>> then\n    set [input: dash v] to [1]\nelse\n    set [input: dash v] to [0]\nend\nif <key (a v) pressed?> then\n    set [input: select_l v] to [1]\nelse\n    set [input: select_l v] to [0]\nend\nif <key (d v) pressed?> then\n    set [input: select_r v] to [1]\nelse\n    set [input: select_r v] to [0]\nend\nif <key (space v) pressed?> then\n    set [input: menu v] to [1]\nelse\n    set [input: menu v] to [0]\nend\nif <(Tap Count) > [0]> then\n    change [double tap timer v] by (-1)\n    if <<(Double Tap Timer) < [1]> or <(Input: Dash) = [1]>> then\n        set [double tap timer v] to [0]\n        set [tap count v] to [0]\n    end\nend\n\nwhen flag clicked\nset rotation style [don't rotate v]\nset [level no. v] to [1]\nset [pause v] to [1]\nset [playable v] to [0]\nset [particle x v] to [0]\nset [particle y v] to [0]\nset [particle direction v] to [0]\nset [enemy item x v] to [0]\nset [enemy item y v] to [0]\nset [enemy direction v] to [0]\nset [upgrade: armor v] to [0]\nset [upgrade: arms v] to [0]\nset [upgrade: helmet v] to [0]\nset [upgrade: legs v] to [0]\nset [heart tanks v] to [0]\nset [got weapon 1 v] to [0]\nset [got weapon 2 v] to [0]\nset [got weapon 3 v] to [0]\nset [got weapon 4 v] to [0]\nset [weapon: ammo 1 v] to [0]\nset [weapon: ammo 2 v] to [0]\nset [weapon: ammo 3 v] to [0]\nset [weapon: ammo 4 v] to [0]\nset [bullet amount v] to [0]\nset [double tap timer v] to [0]\nset [tap count v] to [0]\nhide\n\nwhen I receive [play v]\nset [pause v] to [0]\n\nwhen I receive [pause v]\nset [pause v] to [1]\n\nwhen I receive [go player v]\nset [playable v] to [1]\nbroadcast (Initialize Input v)\nforever\n    Level Event\nend\n\nwhen I receive [initialize input v]\nset [input: up v] to [0]\nset [input: down v] to [0]\nset [input: left v] to [0]\nset [input: right v] to [0]\nset [input: shot v] to [0]\nset [input: jump v] to [0]\nset [input: dash v] to [0]\nset [input: select_l v] to [0]\nset [input: select_r v] to [0]\nset [input: menu v] to [0]\nset [double tap timer v] to [0]\nset [tap count v] to [0]\nforever\n    if <(Playable) = [1]> then\n        Input\n    end\nend\n\ndefine Level Event\nif <<(Level NO.) = [1]> and <(Pause) = [0]>> then\nend\n\nwhen I receive [capsule event v]\nset [playable v] to [0]\nset [input: up v] to [0]\nset [input: down v] to [0]\nset [input: left v] to [0]\nset [input: right v] to [0]\nset [input: shot v] to [0]\nset [input: jump v] to [0]\nset [input: dash v] to [0]\nset [input: select_l v] to [0]\nset [input: select_r v] to [0]\nset [input: menu v] to [0]\nset [double tap timer v] to [0]\nset [tap count v] to [0]\n\nwhen I receive [continue playing v]\nset [playable v] to [1]\n\nwhen I receive [get a new weapon v]\nif <(Level NO.) = [Boss1]> then\n    set [got weapon 1 v] to [1]\nend\nif <(Level NO.) = [Boss2]> then\n    set [got weapon 2 v] to [1]\nend\nif <(Level NO.) = [Boss3]> then\n    set [got weapon 3 v] to [1]\nend\nif <(Level NO.) = [Boss4]> then\n    set [got weapon 4 v] to [1]\nend\nwait until <key (space v) pressed?>\nbroadcast (Stop Music v) and wait\nbroadcast (Transition In v) and wait\nwait (1) seconds\nif <<(Got Weapon 1) = [1]> and <<(Got Weapon 2) = [1]> and <<(Got Weapon 3) = [1]> and <(Got Weapon 4) = [1]>>>> then\n    broadcast (End of Demo Background v)\n    wait (0.5) seconds\n    broadcast (Transition Out v) and wait\n    broadcast (Thank you v)\nelse\n    broadcast (Boss Menu Background v)\n    broadcast (Transition Out v) and wait\n    broadcast (Boss Menu Select v)\nend\n\nset [level no. v] to [1]\nbroadcast (Clear v)\nbroadcast (Setup v) and wait\nbroadcast (Level Loop v)\nbroadcast (Play v)\nbroadcast (Transition Out v) and wait\nbroadcast (Play BG Music v)\nbroadcast (Ready Message v) and wait\nbroadcast (Player Intro v)\n\nwhen I receive [initialize input v]\nforever\n    if <(Playable) = [1]> then\n        if <key (q v) pressed?> then\n            start sound [Menu_Cursor v]\n            set [player: weapon v] to [0]\n            wait until <not <key (q v) pressed?>>\n        end\n        if <key (w v) pressed?> then\n            if <(Got Weapon 1) = [1]> then\n                start sound [Menu_Cursor v]\n                set [player: weapon v] to [1]\n            else\n                start sound [Buzzer v]\n            end\n            wait until <not <key (w v) pressed?>>\n        end\n    end\nend\n\nwhen I receive [setup v]\nif <(Got Weapon 1) = [1]> then\n    set [weapon: ammo 1 v] to [28]\nend\nif <(Got Weapon 2) = [1]> then\n    set [weapon: ammo 2 v] to [28]\nend\nif <(Got Weapon 3) = [1]> then\n    set [weapon: ammo 3 v] to [28]\nend\nif <(Got Weapon 4) = [1]> then\n    set [weapon: ammo 4 v] to [28]\nend\n\nwhen I receive [stop loop v]\nset [input: up v] to [0]\nset [input: down v] to [0]\nset [input: left v] to [0]\nset [input: right v] to [0]\nset [input: shot v] to [0]\nset [input: jump v] to [0]\nset [input: dash v] to [0]\nset [input: select_l v] to [0]\nset [input: select_r v] to [0]\nset [input: menu v] to [0]\nset [double tap timer v] to [0]\nset [tap count v] to [0]\nstop [other scripts in sprite v]\n\n@Music\n\nwhen I receive [play bg music v]\nset volume to (100) %\nforever\n    if <(Level NO.) = [1]> then\n        play sound [MMX1_Highway v] until done\n    end\nend\n\nwhen I receive [stop music v]\nstop all sounds\nstop [other scripts in sprite v]\n\nwhen I receive [dr. light's theme v]\nset volume to (100) %\nforever\n    play sound [MMX_DrLight v] until done\nend\n\nwhen I receive [respawn v]\nstop all sounds\nstop [other scripts in sprite v]\n\nwhen I receive [fade out music v]\nrepeat (25)\n    change volume by (-4)\nend\nstop all sounds\nstop [other scripts in sprite v]\n\nwhen I receive [boss intro fanfare v]\nclear sound effects\nset volume to (100) %\nplay sound [MMX_StageChosen v] until done\n\nwhen I receive [boss appear v]\nset volume to (100) %\nforever\n    play sound [MMX_BossIntro v] until done\nend\n\nwhen I receive [boss start v]\nset volume to (100) %\nforever\n    play sound [MMX_BossBattle v] until done\nend\n\nwhen I receive [boss defeated v]\nrepeat (25)\n    change volume by (-4)\nend\nstop all sounds\nstop [other scripts in sprite v]\n\nwhen I receive [stage clear v]\nclear sound effects\nset volume to (100) %\nplay sound [MMX_StageClear v] until done\n\nwhen I receive [get a new weapon v]\nset volume to (100) %\nforever\n    play sound [MMX_WeaponGet v] until done\nend\n\nwhen I receive [thank you v]\nset volume to (100) %\nforever\n    play sound [MMX_Credits v] until done\nend\n\n@Ready\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset size to (200) %\nswitch costume to (ready0 v)\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [ready message v]\nshow\nset [ghost v] effect to (0)\nswitch costume to (ready0 v)\ngo to [front v] layer\nwait (0.02) seconds\nrepeat (12)\n    next costume\n    wait (0.02) seconds\nend\nrepeat (5)\n    set [ghost v] effect to (0)\n    wait (0.1) seconds\n    set [ghost v] effect to (100)\n    wait (0.1) seconds\nend\nset [ghost v] effect to (0)\nrepeat (12)\n    switch costume to ((costume [number v]) - (1))\n    wait (0.02) seconds\nend\nset [ghost v] effect to (100)\nhide\n\n@X - Death Bubbles\n\ndefine Reset Clone\nclear graphic effects\nset size to (200) %\n\nwhen I start as a clone\nReset Clone\nset rotation style [don't rotate v]\ngo to (player v)\nchange y by (32)\nshow\nrepeat until <touching (_edge_ v)?>\n    move (5) steps\n    next costume\nend\nrepeat (4)\n    move (5) steps\n    change size by (1)\n    change [ghost v] effect by (25)\nend\nhide\ndelete this clone\n\nwhen flag clicked\nReset Clone\n\nwhen I receive [life lost v]\npoint in direction (90)\ncreate clone of (_myself_ v)\npoint in direction (45)\ncreate clone of (_myself_ v)\npoint in direction (0)\ncreate clone of (_myself_ v)\npoint in direction (-45)\ncreate clone of (_myself_ v)\npoint in direction (-90)\ncreate clone of (_myself_ v)\npoint in direction (-135)\ncreate clone of (_myself_ v)\npoint in direction (180)\ncreate clone of (_myself_ v)\npoint in direction (135)\ncreate clone of (_myself_ v)\n\n@Charge Effect\n\nwhen flag clicked\nset [x - buster charge lvl v] to [0]\nset rotation style [don't rotate v]\nswitch costume to (charge_lv1_1 v)\nhide\n\ndefine Switch Costume (#costume)\nif <not <(costume [number v]) = (#costume)>> then\n    switch costume to (#costume)\nend\n\nwhen I receive [go player v]\nif <(Pause) = [0]> then\n    forever\n        go to (player v)\n        change y by (32)\n        if <(Player: Weapon) = [0]> then\n            if <(X - Buster Charge LVL) = [1]> then\n                show\n                change [@anim v] by (1)\n                if <(@Anim) > [0]> then\n                    Switch Costume [1]\n                end\n                if <(@Anim) > [3]> then\n                    Switch Costume [2]\n                end\n                if <(@Anim) > [6]> then\n                    Switch Costume [3]\n                end\n                if <(@Anim) > [9]> then\n                    Switch Costume [1]\n                    set [@anim v] to [1]\n                end\n            else\n                if <(X - Buster Charge LVL) = [2]> then\n                    show\n                    change [@anim v] by (1)\n                    if <(@Anim) > [0]> then\n                        Switch Costume [4]\n                    end\n                    if <(@Anim) > [3]> then\n                        Switch Costume [5]\n                    end\n                    if <(@Anim) > [6]> then\n                        Switch Costume [6]\n                    end\n                    if <(@Anim) > [9]> then\n                        Switch Costume [4]\n                        set [@anim v] to [1]\n                    end\n                else\n                    if <(X - Buster Charge LVL) = [3]> then\n                        show\n                        change [@anim v] by (1)\n                        if <(@Anim) > [0]> then\n                            Switch Costume [7]\n                        end\n                        if <(@Anim) > [3]> then\n                            Switch Costume [8]\n                        end\n                        if <(@Anim) > [6]> then\n                            Switch Costume [9]\n                        end\n                        if <(@Anim) > [9]> then\n                            Switch Costume [7]\n                            set [@anim v] to [1]\n                        end\n                    else\n                        hide\n                        set [@anim v] to [0]\n                    end\n                end\n            end\n        else\n            hide\n            set [@anim v] to [0]\n        end\n    end\nend\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\nwhen I receive [clear v]\nhide\n\n@Buster_LV0\n\nwhen flag clicked\nset [@hit v] to [0]\nset [hit v] to [0]\nset [life v] to [4]\nset [x v] to [0]\nset [y v] to [0]\npoint in direction (90)\nset rotation style [left-right v]\ngo to x: (0) y: (0)\nswitch costume to (buster_lv0 v)\nset size to (200) %\nhide\n\nwhen I start as a clone\nset [@hit v] to [0]\nset [hit v] to [0]\nset [life v] to [4]\npoint in direction ([direction v] of [player v])\nif <([wall slide v] of [player v]) = [1]> then\n    if <([direction v] of [player v]) > [0]> then\n        set [x v] to ((Scroll X) + (([x position v] of [player v]) - (32)))\n        set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n        point in direction (-90)\n    end\n    if <([direction v] of [player v]) < [0]> then\n        set [x v] to ((Scroll X) + (([x position v] of [player v]) + (32)))\n        set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n        point in direction (90)\n    end\nelse\n    if <([wall jump v] of [player v]) > [0]> then\n        if <([direction v] of [player v]) > [0]> then\n            set [x v] to ((Scroll X) + (([x position v] of [player v]) - (32)))\n            set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n            point in direction (-90)\n        end\n        if <([direction v] of [player v]) < [0]> then\n            set [x v] to ((Scroll X) + (([x position v] of [player v]) + (32)))\n            set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n            point in direction (90)\n        end\n    else\n        if <([climbing v] of [player v]) = [1]> then\n            if <([climb fire direction v] of [player v]) = [R]> then\n                set [x v] to ((Scroll X) + (([x position v] of [player v]) + (32)))\n                set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n                point in direction (90)\n            end\n            if <([climb fire direction v] of [player v]) = [L]> then\n                set [x v] to ((Scroll X) + (([x position v] of [player v]) - (32)))\n                set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n                point in direction (-90)\n            end\n        else\n            if <([direction v] of [player v]) > [0]> then\n                set [x v] to ((Scroll X) + (([x position v] of [player v]) + (32)))\n                set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n                point in direction (90)\n            end\n            if <([direction v] of [player v]) < [0]> then\n                set [x v] to ((Scroll X) + (([x position v] of [player v]) - (32)))\n                set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n                point in direction (-90)\n            end\n        end\n    end\nend\nshow\nforever\n    if <(Pause) = [0]> then\n        change [x v] by (([sin v] of (direction) ) * (16))\n        change [y v] by (([cos v] of (direction) ) * (16))\n        if <(Hit) = [1]> then\n            change [@hit v] by (1)\n            change [life v] by (-1)\n            if <(@Hit) > [0]> then\n                Switch Costume [2]\n            end\n            if <(@Hit) > [1]> then\n                Switch Costume [3]\n            end\n            if <(@Hit) > [2]> then\n                Switch Costume [4]\n            end\n            if <(Life) < [1]> then\n                delete this clone\n            end\n        else\n            Switch Costume [1]\n            set [@hit v] to [0]\n        end\n        if <touching (enemies v)?> then\n            if <(Hit) = [0]> then\n                set [hit v] to [1]\n            end\n            change [x v] by (([sin v] of (direction) ) * (-16))\n            change [y v] by (([cos v] of (direction) ) * (-16))\n        end\n        if <touching (flame mammoth v)?> then\n            if <(Hit) = [0]> then\n                set [hit v] to [1]\n            end\n            change [x v] by (([sin v] of (direction) ) * (-16))\n            change [y v] by (([cos v] of (direction) ) * (-16))\n        end\n        if <touching (armored armadillo v)?> then\n            if <(Hit) = [0]> then\n                set [hit v] to [1]\n            end\n            change [x v] by (([sin v] of (direction) ) * (-16))\n            change [y v] by (([cos v] of (direction) ) * (-16))\n        end\n        if <touching (sonic boss v)?> then\n            if <(Hit) = [0]> then\n                set [hit v] to [1]\n            end\n            change [x v] by (([sin v] of (direction) ) * (-16))\n            change [y v] by (([cos v] of (direction) ) * (-16))\n        end\n        if <touching (shadow boss v)?> then\n            if <(Hit) = [0]> then\n                set [hit v] to [1]\n            end\n            change [x v] by (([sin v] of (direction) ) * (-16))\n            change [y v] by (([cos v] of (direction) ) * (-16))\n        end\n        if <touching (_edge_ v)?> then\n            delete this clone\n        end\n        go to x: ((X) - (Scroll X)) y: ((Y) - (Scroll Y))\n    end\nend\n\nwhen I receive [clear v]\nhide\ndelete this clone\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\ndefine Switch Costume (#costume)\nif <not <(costume [number v]) = (#costume)>> then\n    switch costume to (#costume)\nend\n\n@Buster_LV1\n\ndefine Switch Costume (#costume)\nif <not <(costume [number v]) = (#costume)>> then\n    switch costume to (#costume)\nend\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\nwhen I receive [clear v]\nhide\ndelete this clone\n\nwhen flag clicked\nset [@fire v] to [0]\nset [@hit v] to [0]\nset [life v] to [6]\nset [hit v] to [0]\nset [x v] to [0]\nset [y v] to [0]\npoint in direction (90)\nset rotation style [left-right v]\ngo to x: (0) y: (0)\nswitch costume to (buster_lv1_fire1 v)\nset size to (200) %\nhide\n\nwhen I start as a clone\nset [@fire v] to [0]\nset [@hit v] to [0]\nset [hit v] to [0]\nset [life v] to [6]\npoint in direction ([direction v] of [player v])\nif <([wall slide v] of [player v]) = [1]> then\n    if <([direction v] of [player v]) > [0]> then\n        set [x v] to ((Scroll X) + (([x position v] of [player v]) - (32)))\n        set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n        point in direction (-90)\n    end\n    if <([direction v] of [player v]) < [0]> then\n        set [x v] to ((Scroll X) + (([x position v] of [player v]) + (32)))\n        set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n        point in direction (90)\n    end\nelse\n    if <([wall jump v] of [player v]) > [0]> then\n        if <([direction v] of [player v]) > [0]> then\n            set [x v] to ((Scroll X) + (([x position v] of [player v]) - (32)))\n            set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n            point in direction (-90)\n        end\n        if <([direction v] of [player v]) < [0]> then\n            set [x v] to ((Scroll X) + (([x position v] of [player v]) + (32)))\n            set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n            point in direction (90)\n        end\n    else\n        if <([climbing v] of [player v]) = [1]> then\n            if <([climb fire direction v] of [player v]) = [R]> then\n                set [x v] to ((Scroll X) + (([x position v] of [player v]) + (32)))\n                set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n                point in direction (90)\n            end\n            if <([climb fire direction v] of [player v]) = [L]> then\n                set [x v] to ((Scroll X) + (([x position v] of [player v]) - (32)))\n                set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n                point in direction (-90)\n            end\n        else\n            if <([direction v] of [player v]) > [0]> then\n                set [x v] to ((Scroll X) + (([x position v] of [player v]) + (32)))\n                set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n                point in direction (90)\n            end\n            if <([direction v] of [player v]) < [0]> then\n                set [x v] to ((Scroll X) + (([x position v] of [player v]) - (32)))\n                set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n                point in direction (-90)\n            end\n        end\n    end\nend\nshow\nforever\n    if <(Pause) = [0]> then\n        if <(Hit) = [1]> then\n            set [@fire v] to [0]\n            change [@hit v] by (1)\n            if <(@Hit) > [0]> then\n                Switch Costume [1]\n            end\n            if <(@Hit) > [2]> then\n                Switch Costume [2]\n            end\n            if <(@Hit) > [6]> then\n                Switch Costume [2]\n                delete this clone\n            end\n        else\n            set [@hit v] to [0]\n            change [@fire v] by (1)\n            if <(@Fire) > [0]> then\n                Switch Costume [1]\n            end\n            if <(@Fire) > [2]> then\n                Switch Costume [2]\n            end\n            if <(@Fire) > [4]> then\n                Switch Costume [3]\n                change [x v] by (([sin v] of (direction) ) * (18))\n                change [y v] by (([cos v] of (direction) ) * (18))\n            end\n            if <(@Fire) > [5]> then\n                Switch Costume [4]\n            end\n            if <(@Fire) > [6]> then\n                Switch Costume [5]\n            end\n            if <(@Fire) > [7]> then\n                Switch Costume [6]\n            end\n            if <(@Fire) > [8]> then\n                Switch Costume [7]\n            end\n            if <(@Fire) > [9]> then\n                Switch Costume [8]\n            end\n            if <(@Fire) > [10]> then\n                Switch Costume [3]\n                set [@fire v] to [5]\n            end\n        end\n        if <touching (enemies v)?> then\n            change [life v] by (-1)\n            if <<(Life) < [1]> and <(Hit) = [0]>> then\n                set [hit v] to [1]\n            end\n        end\n        if <touching (flame mammoth v)?> then\n            change [life v] by (-4)\n            if <<(Life) < [1]> and <(Hit) = [0]>> then\n                set [hit v] to [1]\n            end\n        end\n        if <touching (armored armadillo v)?> then\n            change [life v] by (-4)\n            if <<(Life) < [1]> and <(Hit) = [0]>> then\n                set [hit v] to [1]\n            end\n        end\n        if <touching (sonic boss v)?> then\n            change [life v] by (-4)\n            if <<(Life) < [1]> and <(Hit) = [0]>> then\n                set [hit v] to [1]\n            end\n        end\n        if <touching (shadow boss v)?> then\n            change [life v] by (-4)\n            if <<(Life) < [1]> and <(Hit) = [0]>> then\n                set [hit v] to [1]\n            end\n        end\n        if <touching (_edge_ v)?> then\n            delete this clone\n        end\n        go to x: ((X) - (Scroll X)) y: ((Y) - (Scroll Y))\n    end\nend\n\n@Buster_LV2\n\ndefine Switch Costume (#costume)\nif <not <(costume [number v]) = (#costume)>> then\n    switch costume to (#costume)\nend\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\nwhen I receive [clear v]\nhide\ndelete this clone\n\nwhen flag clicked\nset [@fire v] to [0]\nset [@hit v] to [0]\nset [life v] to [6]\nset [hit v] to [0]\nset [x v] to [0]\nset [y v] to [0]\npoint in direction (90)\nset rotation style [left-right v]\ngo to x: (0) y: (0)\nswitch costume to (buster_lv2_fire1 v)\nset size to (200) %\nhide\n\nwhen I start as a clone\nset [@fire v] to [0]\nset [@hit v] to [0]\nset [hit v] to [0]\nset [life v] to [12]\npoint in direction ([direction v] of [player v])\nif <([wall slide v] of [player v]) = [1]> then\n    if <([direction v] of [player v]) > [0]> then\n        set [x v] to ((Scroll X) + (([x position v] of [player v]) - (32)))\n        set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n        point in direction (-90)\n    end\n    if <([direction v] of [player v]) < [0]> then\n        set [x v] to ((Scroll X) + (([x position v] of [player v]) + (32)))\n        set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n        point in direction (90)\n    end\nelse\n    if <([wall jump v] of [player v]) > [0]> then\n        if <([direction v] of [player v]) > [0]> then\n            set [x v] to ((Scroll X) + (([x position v] of [player v]) - (32)))\n            set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n            point in direction (-90)\n        end\n        if <([direction v] of [player v]) < [0]> then\n            set [x v] to ((Scroll X) + (([x position v] of [player v]) + (32)))\n            set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n            point in direction (90)\n        end\n    else\n        if <([climbing v] of [player v]) = [1]> then\n            if <([climb fire direction v] of [player v]) = [R]> then\n                set [x v] to ((Scroll X) + (([x position v] of [player v]) + (32)))\n                set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n                point in direction (90)\n            end\n            if <([climb fire direction v] of [player v]) = [L]> then\n                set [x v] to ((Scroll X) + (([x position v] of [player v]) - (32)))\n                set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n                point in direction (-90)\n            end\n        else\n            if <([direction v] of [player v]) > [0]> then\n                set [x v] to ((Scroll X) + (([x position v] of [player v]) + (32)))\n                set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n                point in direction (90)\n            end\n            if <([direction v] of [player v]) < [0]> then\n                set [x v] to ((Scroll X) + (([x position v] of [player v]) - (32)))\n                set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (38)))\n                point in direction (-90)\n            end\n        end\n    end\nend\nshow\nforever\n    if <(Pause) = [0]> then\n        if <(Hit) = [1]> then\n            set [@fire v] to [0]\n            change [@hit v] by (1)\n            if <(@Hit) > [0]> then\n                Switch Costume [6]\n            end\n            if <(@Hit) > [3]> then\n                Switch Costume [7]\n            end\n            if <(@Hit) > [6]> then\n                Switch Costume [7]\n                delete this clone\n            end\n        else\n            set [@hit v] to [0]\n            change [@fire v] by (1)\n            if <(@Fire) > [0]> then\n                Switch Costume [1]\n            end\n            if <(@Fire) > [2]> then\n                Switch Costume [2]\n            end\n            if <(@Fire) > [4]> then\n                Switch Costume [3]\n                change [x v] by (([sin v] of (direction) ) * (20))\n                change [y v] by (([cos v] of (direction) ) * (20))\n            end\n            if <(@Fire) > [5]> then\n                Switch Costume [4]\n            end\n            if <(@Fire) > [6]> then\n                Switch Costume [5]\n            end\n            if <(@Fire) > [7]> then\n                Switch Costume [3]\n                set [@fire v] to [5]\n            end\n        end\n        if <touching (enemies v)?> then\n            change [life v] by (-1)\n            if <<(Life) < [1]> and <(Hit) = [0]>> then\n                set [hit v] to [1]\n            end\n        end\n        if <touching (flame mammoth v)?> then\n            change [life v] by (-6)\n            if <<(Life) < [1]> and <(Hit) = [0]>> then\n                set [hit v] to [1]\n            end\n        end\n        if <touching (armored armadillo v)?> then\n            change [life v] by (-6)\n            if <<(Life) < [1]> and <(Hit) = [0]>> then\n                set [hit v] to [1]\n            end\n        end\n        if <touching (sonic boss v)?> then\n            change [life v] by (-6)\n            if <<(Life) < [1]> and <(Hit) = [0]>> then\n                set [hit v] to [1]\n            end\n        end\n        if <touching (shadow boss v)?> then\n            change [life v] by (-6)\n            if <<(Life) < [1]> and <(Hit) = [0]>> then\n                set [hit v] to [1]\n            end\n        end\n        if <touching (_edge_ v)?> then\n            delete this clone\n        end\n        go to x: ((X) - (Scroll X)) y: ((Y) - (Scroll Y))\n    end\nend\n\n@Smoke_Effect\n\ndefine Switch Costume (#costume)\nif <not <(costume [number v]) = (#costume)>> then\n    switch costume to (#costume)\nend\n\nwhen flag clicked\nset [@effect v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nset rotation style [don't rotate v]\ngo to x: (0) y: (0)\nswitch costume to (smoke1 v)\nset size to (200) %\nhide\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\nwhen I receive [clear v]\nhide\ndelete this clone\n\nwhen I start as a clone\nset [@effect v] to [0]\nif <([dashing v] of [player v]) = [1]> then\n    if <([direction v] of [player v]) > [0]> then\n        set [x v] to ((Scroll X) + (([x position v] of [player v]) - (28)))\n        set [y v] to ((Scroll Y) + ([y position v] of [player v]))\n    end\n    if <([direction v] of [player v]) < [0]> then\n        set [x v] to ((Scroll X) + (([x position v] of [player v]) + (28)))\n        set [y v] to ((Scroll Y) + ([y position v] of [player v]))\n    end\nelse\n    if <([wall slide v] of [player v]) = [1]> then\n        if <([direction v] of [player v]) > [0]> then\n            set [x v] to ((Scroll X) + (([x position v] of [player v]) + (28)))\n            set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (32)))\n        end\n        if <([direction v] of [player v]) < [0]> then\n            set [x v] to ((Scroll X) + (([x position v] of [player v]) - (28)))\n            set [y v] to ((Scroll Y) + (([y position v] of [player v]) + (32)))\n        end\n    end\nend\nshow\nforever\n    if <(Pause) = [0]> then\n        change [@effect v] by (1)\n        change [y v] by (2)\n        if <(@Effect) > [0]> then\n            Switch Costume [1]\n        end\n        if <(@Effect) > [2]> then\n            Switch Costume [2]\n        end\n        if <(@Effect) > [4]> then\n            Switch Costume [3]\n        end\n        if <(@Effect) > [6]> then\n            Switch Costume [4]\n        end\n        if <(@Effect) > [8]> then\n            Switch Costume [5]\n        end\n        if <(@Effect) > [10]> then\n            Switch Costume [6]\n        end\n        if <(@Effect) > [12]> then\n            Switch Costume [6]\n            delete this clone\n        end\n        go to x: ((X) - (Scroll X)) y: ((Y) - (Scroll Y))\n    end\nend\n\n@Wall_Kick_Effect\n\ndefine Switch Costume (#costume)\nif <not <(costume [number v]) = (#costume)>> then\n    switch costume to (#costume)\nend\n\nwhen flag clicked\nset [@effect v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nset rotation style [don't rotate v]\ngo to x: (0) y: (0)\nswitch costume to (buster_lv0_hit1 v)\nset size to (200) %\nhide\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\nwhen I receive [clear v]\nhide\ndelete this clone\n\nwhen I start as a clone\nset [@effect v] to [0]\nif <([wall jump v] of [player v]) > [0]> then\n    if <([direction v] of [player v]) > [0]> then\n        set [x v] to ((Scroll X) + (([x position v] of [player v]) - (28)))\n        set [y v] to ((Scroll Y) + ([y position v] of [player v]))\n    end\n    if <([direction v] of [player v]) < [0]> then\n        set [x v] to ((Scroll X) + (([x position v] of [player v]) + (28)))\n        set [y v] to ((Scroll Y) + ([y position v] of [player v]))\n    end\nend\nshow\nforever\n    if <(Pause) = [0]> then\n        change [@effect v] by (1)\n        if <(@Effect) > [0]> then\n            Switch Costume [1]\n        end\n        if <(@Effect) > [2]> then\n            Switch Costume [1]\n            delete this clone\n        end\n        go to x: ((X) - (Scroll X)) y: ((Y) - (Scroll Y))\n    end\nend\n\n@Enemy Explosion\n\ndefine Switch Costume (#costume)\nif <not <(costume [number v]) = (#costume)>> then\n    switch costume to (#costume)\nend\n\nwhen flag clicked\nset [@effect v] to [0]\nset [x v] to [0]\nset [y v] to [0]\npoint in direction (90)\nset rotation style [don't rotate v]\ngo to x: (0) y: (0)\nswitch costume to (explosion1 v)\nset size to (200) %\nhide\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\nwhen I receive [clear v]\nhide\ndelete this clone\n\nwhen I start as a clone\nset [@effect v] to [0]\nset [x v] to (Particle X)\nset [y v] to (Particle Y)\nshow\nforever\n    if <(Pause) = [0]> then\n        change [@effect v] by (1)\n        if <(@Effect) > [0]> then\n            Switch Costume [1]\n        end\n        if <(@Effect) > [2]> then\n            Switch Costume [2]\n        end\n        if <(@Effect) > [4]> then\n            Switch Costume [3]\n        end\n        if <(@Effect) > [6]> then\n            Switch Costume [4]\n        end\n        if <(@Effect) > [8]> then\n            Switch Costume [5]\n        end\n        if <(@Effect) > [10]> then\n            Switch Costume [6]\n        end\n        if <(@Effect) > [12]> then\n            Switch Costume [7]\n        end\n        if <(@Effect) > [14]> then\n            Switch Costume [7]\n            delete this clone\n        end\n        go to x: ((X) - (Scroll X)) y: ((Y) - (Scroll Y))\n    end\nend\n\nwhen I receive [create explosion v]\nset [x v] to (Particle X)\nset [y v] to (Particle Y)\ncreate clone of (_myself_ v)\n\n@Enemies\n\ndefine Create Enemy (x) (y) (dir) (hp) (type) (damage)\nhide\nset [x v] to (x)\nset [y v] to (y)\npoint in direction (dir)\nset [health v] to (hp)\nset [type v] to (type)\nset [contact power v] to (damage)\nset [anim v] to [0]\nset [timer v] to [0]\nif <(direction) > [0]> then\n    set [movement v] to [1]\nelse\n    if <(direction) < [0]> then\n        set [movement v] to [2]\n    end\nend\ncreate clone of (_myself_ v)\n\ndefine Switch Costume (#costume)\nif <not <(costume [number v]) = (#costume)>> then\n    switch costume to (#costume)\nend\n\nwhen I receive [setup v]\nset [enemies max v] to [0]\nset [enemy killed v] to [0]\nif <(Level NO.) = [1]> then\n    Create Enemy [600] [285] [-90] [4] [1] [2]\n    Create Enemy [1000] [285] [-90] [8] [1] [2]\n    Create Enemy [1920] [350] [-90] [4] [1] [2]\n    Create Enemy [2020] [350] [-90] [4] [1] [2]\n    Create Enemy [2660] [320] [-90] [4] [1] [2]\n    Create Enemy [3000] [320] [-90] [4] [1] [2]\n    Create Enemy [3500] [320] [-90] [8] [1] [2]\n    Create Enemy [4000] [320] [-90] [8] [1] [2]\n    Create Enemy [5000] [320] [-90] [4] [1] [2]\n    Create Enemy [5100] [320] [-90] [4] [1] [2]\n    Create Enemy [5200] [320] [-90] [4] [1] [2]\n    Create Enemy [5800] [250] [-90] [4] [1] [2]\n    Create Enemy [6200] [250] [-90] [4] [1] [2]\n    Create Enemy [6300] [250] [-90] [4] [1] [2]\n    Create Enemy [6400] [250] [-90] [4] [1] [2]\n    Create Enemy [7600] [320] [-90] [4] [1] [2]\n    Create Enemy [8000] [320] [-90] [4] [1] [2]\n    Create Enemy [8600] [370] [-90] [4] [1] [2]\n    Create Enemy [9000] [370] [-90] [4] [1] [2]\n    Create Enemy [10200] [260] [-90] [4] [1] [2]\n    Create Enemy [11000] [320] [-90] [4] [1] [2]\n    Create Enemy [11800] [260] [-90] [4] [1] [2]\n    Create Enemy [12600] [150] [-90] [4] [1] [2]\n    Create Enemy [15000] [150] [-90] [4] [1] [2]\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset rotation style [left-right v]\nset size to (200) %\nswitch costume to (null v)\nset [brightness v] effect to (0)\nset [ghost v] effect to (0)\nset [contact damage v] to [0]\nset [anim v] to [0]\nset [timer v] to [0]\nset [movement v] to [0]\nset [state v] to [0]\nset [hit timer v] to [0]\nset [enemies max v] to [0]\nset [enemy killed v] to [0]\nset [drop x v] to [0]\nset [drop y v] to [0]\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\nwhen I receive [clear v]\nhide\nset [enemies max v] to [0]\nset [enemy killed v] to [0]\ndelete this clone\n\nwhen I start as a clone\nchange [enemies max v] by (1)\nif <(Type) = [1]> then\n    forever\n        if <(Pause) = [0]> then\n            Enemy: Reploid Foe\n        end\n    end\nend\n\ndefine Enemy: Reploid Foe\ngo to x: ((X) - (Scroll X)) y: ((Y) - (Scroll Y))\nif <([abs v] of ((X) - (Scroll X)) ) > [280]> then\n    hide\n    set [hit timer v] to [1]\nelse\n    if <([abs v] of ((Y) - (Scroll Y)) ) > [307]> then\n        hide\n        set [hit timer v] to [1]\n    else\n        show\n        if <(state) = [1]> then\n            change [anim v] by (1)\n            if <(anim) > [0]> then\n                Switch Costume [2]\n            end\n            if <(anim) > [2]> then\n                Switch Costume [3]\n            end\n            if <(anim) > [4]> then\n                Switch Costume [4]\n            end\n            if <(anim) = [5]> then\n                start sound [Enemy_Fire v]\n                set [enemy direction v] to (direction)\n                if <(direction) > [0]> then\n                    set [enemy item x v] to ((x position) + ((Scroll X) + (32)))\n                end\n                if <(direction) < [0]> then\n                    set [enemy item x v] to ((x position) + ((Scroll X) - (32)))\n                end\n                set [enemy item y v] to ((y position) + ((Scroll Y) + (40)))\n                create clone of (reploid enemy shot v)\n            end\n            if <(anim) > [6]> then\n                Switch Costume [5]\n            end\n            if <(anim) > [8]> then\n                Switch Costume [4]\n            end\n            if <(anim) > [10]> then\n                Switch Costume [3]\n            end\n            if <(anim) > [12]> then\n                Switch Costume [2]\n            end\n            if <(anim) > [30]> then\n                Switch Costume [2]\n                set [state v] to [0]\n            end\n        else\n            set [anim v] to [0]\n            Switch Costume [2]\n            point towards (player v)\n            if <<(distance to [player v]) < [200]> and <(state) = [0]>> then\n                set [state v] to [1]\n            end\n        end\n    end\nend\nif <(Hit Timer) < [1]> then\n    set [hit timer v] to [0]\nelse\n    change [hit timer v] by (-1)\nend\nif <touching (player v)?> then\n    set [contact damage v] to (Contact Power)\n    broadcast (Contact Player v)\nend\nif <<touching (buster_lv0 v)?> and <(Hit Timer) = [0]>> then\n    change [health v] by (-1)\n    set [hit timer v] to [10]\n    if <(Health) < [1]> then\n        start sound [Enemy_Explode v]\n        change [enemy killed v] by (1)\n        set [health v] to [0]\n        set [particle x v] to ((x position) + (Scroll X))\n        set [particle y v] to ((y position) + ((Scroll Y) + (28)))\n        create clone of (enemy explosion v)\n        set [item drop v] to (pick random (0) to (1))\n        if <(Item Drop) = [1]> then\n            set [drop x v] to ((x position) + (Scroll X))\n            set [drop y v] to ((y position) + (Scroll Y))\n            create clone of (dropped items v)\n        end\n        delete this clone\n    else\n        start sound [Buster_Hit v]\n    end\nend\nif <<touching (buster_lv1 v)?> and <(Hit Timer) = [0]>> then\n    change [health v] by (-2)\n    set [hit timer v] to [10]\n    if <(Health) < [1]> then\n        start sound [Enemy_Explode v]\n        change [enemy killed v] by (1)\n        set [health v] to [0]\n        set [particle x v] to ((x position) + (Scroll X))\n        set [particle y v] to ((y position) + ((Scroll Y) + (28)))\n        create clone of (enemy explosion v)\n        set [item drop v] to (pick random (0) to (1))\n        if <(Item Drop) = [1]> then\n            set [drop x v] to ((x position) + (Scroll X))\n            set [drop y v] to ((y position) + (Scroll Y))\n            create clone of (dropped items v)\n        end\n        delete this clone\n    else\n        start sound [Buster_Hit v]\n    end\nend\nif <<touching (buster_lv2 v)?> and <(Hit Timer) = [0]>> then\n    change [health v] by (-3)\n    set [hit timer v] to [10]\n    if <(Health) < [1]> then\n        start sound [Enemy_Explode v]\n        change [enemy killed v] by (1)\n        set [health v] to [0]\n        set [particle x v] to ((x position) + (Scroll X))\n        set [particle y v] to ((y position) + ((Scroll Y) + (28)))\n        create clone of (enemy explosion v)\n        set [item drop v] to (pick random (0) to (1))\n        if <(Item Drop) = [1]> then\n            set [drop x v] to ((x position) + (Scroll X))\n            set [drop y v] to ((y position) + (Scroll Y))\n            create clone of (dropped items v)\n        end\n        delete this clone\n    else\n        start sound [Buster_Hit v]\n    end\nend\n\n@Items\n\nwhen flag clicked\nswitch costume to (null v)\nset size to (200) %\ngo to x: (0) y: (0)\nset rotation style [left-right v]\npoint in direction (90)\nset [anim v] to [0]\n\ndefine Switch Costume (#costume)\nif <not <(costume [number v]) = (#costume)>> then\n    switch costume to (#costume)\nend\n\ndefine Create Item (x) (y) (type)\nhide\nset [x v] to (x)\nset [y v] to (y)\nset [type v] to (type)\nset [anim v] to [0]\ncreate clone of (_myself_ v)\n\nwhen I receive [setup v]\nif <(Level NO.) = [1]> then\nend\n\nwhen I start as a clone\nforever\n    if <(Pause) = [0]> then\n        go to x: ((X) - (Scroll X)) y: ((Y) - (Scroll Y))\n        if <([abs v] of ((X) - (Scroll X)) ) > [240]> then\n            hide\n        else\n            if <([abs v] of ((Y) - (Scroll Y)) ) > [200]> then\n                hide\n            else\n                show\n                if <(Type) = [1]> then\n                    Item: HP 2\n                end\n                if <(Type) = [2]> then\n                    Item: HP 10\n                end\n                if <(Type) = [3]> then\n                    Item: Ammo 2\n                end\n                if <(Type) = [4]> then\n                    Item: Ammo 10\n                end\n                if <(Type) = [5]> then\n                    Item: 1 UP\n                end\n            end\n        end\n        if <touching (player v)?> then\n            if <(Type) = [1]> then\n                if <(HP) = (HP Max)> then\n                    start sound [Subtank_Fill v]\n                else\n                    broadcast (Item: Get 2 HP v)\n                end\n            end\n            if <(Type) = [2]> then\n                if <(HP) = (HP Max)> then\n                    start sound [Subtank_Full v]\n                else\n                    broadcast (Item: Get 10 HP v)\n                end\n            end\n            if <(Type) = [3]> then\n                if <(Player: Weapon) > [0]> then\n                    if <(Player: Weapon) = [1]> then\n                        if <(Weapon: Ammo 1) = [28]> then\n                            start sound [Subtank_Fill v]\n                        else\n                            broadcast (Item: Get 2 Ammo v)\n                        end\n                    end\n                    if <(Player: Weapon) = [2]> then\n                        if <(Weapon: Ammo 2) = [28]> then\n                            start sound [Subtank_Fill v]\n                        else\n                            broadcast (Item: Get 2 Ammo v)\n                        end\n                    end\n                    if <(Player: Weapon) = [3]> then\n                        if <(Weapon: Ammo 3) = [28]> then\n                            start sound [Subtank_Fill v]\n                        else\n                            broadcast (Item: Get 2 Ammo v)\n                        end\n                    end\n                    if <(Player: Weapon) = [4]> then\n                        if <(Weapon: Ammo 4) = [28]> then\n                            start sound [Subtank_Fill v]\n                        else\n                            broadcast (Item: Get 2 Ammo v)\n                        end\n                    end\n                else\n                    start sound [Subtank_Fill v]\n                    change [weapon: ammo 1 v] by (2)\n                    change [weapon: ammo 2 v] by (2)\n                    if <(Weapon: Ammo 1) > [28]> then\n                        set [weapon: ammo 1 v] to [28]\n                    end\n                    if <(Weapon: Ammo 2) > [28]> then\n                        set [weapon: ammo 2 v] to [28]\n                    end\n                end\n            end\n            if <(Type) = [4]> then\n                if <(Player: Weapon) > [0]> then\n                    if <(Player: Weapon) = [1]> then\n                        if <(Weapon: Ammo 1) = [28]> then\n                            start sound [Subtank_Full v]\n                        else\n                            broadcast (Item: Get 10 Ammo v)\n                        end\n                    end\n                    if <(Player: Weapon) = [2]> then\n                        if <(Weapon: Ammo 2) = [28]> then\n                            start sound [Subtank_Full v]\n                        else\n                            broadcast (Item: Get 10 Ammo v)\n                        end\n                    end\n                    if <(Player: Weapon) = [3]> then\n                        if <(Weapon: Ammo 3) = [28]> then\n                            start sound [Subtank_Full v]\n                        else\n                            broadcast (Item: Get 10 Ammo v)\n                        end\n                    end\n                    if <(Player: Weapon) = [4]> then\n                        if <(Weapon: Ammo 4) = [28]> then\n                            start sound [Subtank_Full v]\n                        else\n                            broadcast (Item: Get 10 Ammo v)\n                        end\n                    end\n                else\n                    start sound [Subtank_Full v]\n                    change [weapon: ammo 1 v] by (10)\n                    change [weapon: ammo 2 v] by (10)\n                    if <(Weapon: Ammo 1) > [28]> then\n                        set [weapon: ammo 1 v] to [28]\n                    end\n                    if <(Weapon: Ammo 2) > [28]> then\n                        set [weapon: ammo 2 v] to [28]\n                    end\n                end\n            end\n            if <(Type) = [5]> then\n                start sound [1_Up v]\n            end\n            delete this clone\n        end\n    end\nend\n\ndefine Item: HP 2\nchange [anim v] by (1)\nif <(anim) > [0]> then\n    Switch Costume [2]\nend\nif <(anim) > [2]> then\n    Switch Costume [3]\nend\nif <(anim) > [4]> then\n    Switch Costume [4]\nend\nif <(anim) > [6]> then\n    Switch Costume [3]\nend\nif <(anim) > [8]> then\n    Switch Costume [2]\n    set [anim v] to [0]\nend\n\ndefine Item: HP 10\nchange [anim v] by (1)\nif <(anim) > [0]> then\n    Switch Costume [5]\nend\nif <(anim) > [2]> then\n    Switch Costume [6]\nend\nif <(anim) > [4]> then\n    Switch Costume [7]\nend\nif <(anim) > [6]> then\n    Switch Costume [6]\nend\nif <(anim) > [8]> then\n    Switch Costume [5]\n    set [anim v] to [0]\nend\n\ndefine Item: Ammo 2\nchange [anim v] by (1)\nif <(anim) > [0]> then\n    Switch Costume [8]\nend\nif <(anim) > [2]> then\n    Switch Costume [9]\nend\nif <(anim) > [4]> then\n    Switch Costume [10]\nend\nif <(anim) > [6]> then\n    Switch Costume [9]\nend\nif <(anim) > [8]> then\n    Switch Costume [8]\n    set [anim v] to [0]\nend\n\ndefine Item: Ammo 10\nchange [anim v] by (1)\nif <(anim) > [0]> then\n    Switch Costume [11]\nend\nif <(anim) > [2]> then\n    Switch Costume [12]\nend\nif <(anim) > [4]> then\n    Switch Costume [13]\nend\nif <(anim) > [6]> then\n    Switch Costume [12]\nend\nif <(anim) > [8]> then\n    Switch Costume [11]\n    set [anim v] to [0]\nend\n\ndefine Item: 1 UP\nchange [anim v] by (1)\nif <(anim) > [0]> then\n    Switch Costume [14]\nend\nif <(anim) > [3]> then\n    Switch Costume [15]\nend\nif <(anim) > [6]> then\n    Switch Costume [14]\n    set [anim v] to [0]\nend\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\nwhen I receive [clear v]\nhide\ndelete this clone\n\n@Dropped Items\n\nwhen flag clicked\nswitch costume to (null v)\nset size to (200) %\ngo to x: (0) y: (0)\nset rotation style [left-right v]\npoint in direction (90)\nset [anim v] to [0]\n\ndefine Switch Costume (#costume)\nif <not <(costume [number v]) = (#costume)>> then\n    switch costume to (#costume)\nend\n\ndefine Create Item (x) (y) (type)\nhide\nset [x v] to (x)\nset [y v] to (y)\nset [type v] to (type)\nset [anim v] to [0]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset [x v] to (Drop X)\nset [y v] to (Drop Y)\nset [drop id v] to (pick random (1) to (5))\nset [type v] to (Drop ID)\nset [anim v] to [0]\nforever\n    if <(Pause) = [0]> then\n        go to x: ((X) - (Scroll X)) y: ((Y) - (Scroll Y))\n        if <([abs v] of ((X) - (Scroll X)) ) > [240]> then\n            hide\n        else\n            if <([abs v] of ((Y) - (Scroll Y)) ) > [200]> then\n                hide\n            else\n                show\n                if <(Type) = [1]> then\n                    Item: HP 2\n                end\n                if <(Type) = [2]> then\n                    Item: HP 10\n                end\n                if <(Type) = [3]> then\n                    Item: Ammo 2\n                end\n                if <(Type) = [4]> then\n                    Item: Ammo 10\n                end\n                if <(Type) = [5]> then\n                    Item: 1 UP\n                end\n            end\n        end\n        if <touching (player v)?> then\n            if <(Type) = [1]> then\n                if <(HP) = (HP Max)> then\n                    start sound [Subtank_Fill v]\n                else\n                    broadcast (Item: Get 2 HP v)\n                end\n            end\n            if <(Type) = [2]> then\n                if <(HP) = (HP Max)> then\n                    start sound [Subtank_Full v]\n                else\n                    broadcast (Item: Get 10 HP v)\n                end\n            end\n            if <(Type) = [3]> then\n                if <(Player: Weapon) > [0]> then\n                    if <(Player: Weapon) = [1]> then\n                        if <(Weapon: Ammo 1) = [28]> then\n                            start sound [Subtank_Fill v]\n                        else\n                            broadcast (Item: Get 2 Ammo v)\n                        end\n                    end\n                    if <(Player: Weapon) = [2]> then\n                        if <(Weapon: Ammo 2) = [28]> then\n                            start sound [Subtank_Fill v]\n                        else\n                            broadcast (Item: Get 2 Ammo v)\n                        end\n                    end\n                    if <(Player: Weapon) = [3]> then\n                        if <(Weapon: Ammo 3) = [28]> then\n                            start sound [Subtank_Fill v]\n                        else\n                            broadcast (Item: Get 2 Ammo v)\n                        end\n                    end\n                    if <(Player: Weapon) = [4]> then\n                        if <(Weapon: Ammo 4) = [28]> then\n                            start sound [Subtank_Fill v]\n                        else\n                            broadcast (Item: Get 2 Ammo v)\n                        end\n                    end\n                else\n                    start sound [Subtank_Fill v]\n                    change [weapon: ammo 1 v] by (2)\n                    change [weapon: ammo 2 v] by (2)\n                    if <(Weapon: Ammo 1) > [28]> then\n                        set [weapon: ammo 1 v] to [28]\n                    end\n                    if <(Weapon: Ammo 2) > [28]> then\n                        set [weapon: ammo 2 v] to [28]\n                    end\n                end\n            end\n            if <(Type) = [4]> then\n                if <(Player: Weapon) > [0]> then\n                    if <(Player: Weapon) = [1]> then\n                        if <(Weapon: Ammo 1) = [28]> then\n                            start sound [Subtank_Full v]\n                        else\n                            broadcast (Item: Get 10 Ammo v)\n                        end\n                    end\n                    if <(Player: Weapon) = [2]> then\n                        if <(Weapon: Ammo 2) = [28]> then\n                            start sound [Subtank_Full v]\n                        else\n                            broadcast (Item: Get 10 Ammo v)\n                        end\n                    end\n                    if <(Player: Weapon) = [3]> then\n                        if <(Weapon: Ammo 3) = [28]> then\n                            start sound [Subtank_Full v]\n                        else\n                            broadcast (Item: Get 10 Ammo v)\n                        end\n                    end\n                    if <(Player: Weapon) = [4]> then\n                        if <(Weapon: Ammo 4) = [28]> then\n                            start sound [Subtank_Full v]\n                        else\n                            broadcast (Item: Get 10 Ammo v)\n                        end\n                    end\n                else\n                    start sound [Subtank_Full v]\n                    change [weapon: ammo 1 v] by (10)\n                    change [weapon: ammo 2 v] by (10)\n                    if <(Weapon: Ammo 1) > [28]> then\n                        set [weapon: ammo 1 v] to [28]\n                    end\n                    if <(Weapon: Ammo 2) > [28]> then\n                        set [weapon: ammo 2 v] to [28]\n                    end\n                end\n            end\n            if <(Type) = [5]> then\n                start sound [1_Up v]\n            end\n            delete this clone\n        end\n    end\nend\n\ndefine Item: HP 2\nchange [anim v] by (1)\nif <(anim) > [0]> then\n    Switch Costume [2]\nend\nif <(anim) > [2]> then\n    Switch Costume [3]\nend\nif <(anim) > [4]> then\n    Switch Costume [4]\nend\nif <(anim) > [6]> then\n    Switch Costume [3]\nend\nif <(anim) > [8]> then\n    Switch Costume [2]\n    set [anim v] to [0]\nend\n\ndefine Item: HP 10\nchange [anim v] by (1)\nif <(anim) > [0]> then\n    Switch Costume [5]\nend\nif <(anim) > [2]> then\n    Switch Costume [6]\nend\nif <(anim) > [4]> then\n    Switch Costume [7]\nend\nif <(anim) > [6]> then\n    Switch Costume [6]\nend\nif <(anim) > [8]> then\n    Switch Costume [5]\n    set [anim v] to [0]\nend\n\ndefine Item: Ammo 2\nchange [anim v] by (1)\nif <(anim) > [0]> then\n    Switch Costume [8]\nend\nif <(anim) > [2]> then\n    Switch Costume [9]\nend\nif <(anim) > [4]> then\n    Switch Costume [10]\nend\nif <(anim) > [6]> then\n    Switch Costume [9]\nend\nif <(anim) > [8]> then\n    Switch Costume [8]\n    set [anim v] to [0]\nend\n\ndefine Item: Ammo 10\nchange [anim v] by (1)\nif <(anim) > [0]> then\n    Switch Costume [11]\nend\nif <(anim) > [2]> then\n    Switch Costume [12]\nend\nif <(anim) > [4]> then\n    Switch Costume [13]\nend\nif <(anim) > [6]> then\n    Switch Costume [12]\nend\nif <(anim) > [8]> then\n    Switch Costume [11]\n    set [anim v] to [0]\nend\n\ndefine Item: 1 UP\nchange [anim v] by (1)\nif <(anim) > [0]> then\n    Switch Costume [14]\nend\nif <(anim) > [3]> then\n    Switch Costume [15]\nend\nif <(anim) > [6]> then\n    Switch Costume [14]\n    set [anim v] to [0]\nend\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\nwhen I receive [clear v]\nhide\ndelete this clone\n\n@Reploid Enemy Shot\n\ndefine Switch Costume (#costume)\nif <not <(costume [number v]) = (#costume)>> then\n    switch costume to (#costume)\nend\n\nwhen flag clicked\nset [@fire v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nset rotation style [don't rotate v]\ngo to x: (0) y: (0)\nswitch costume to (reploid_shot v)\nset size to (200) %\nhide\n\nwhen I receive [stop loop v]\nstop [other scripts in sprite v]\n\nwhen I receive [clear v]\nhide\ndelete this clone\n\nwhen I start as a clone\nset [@fire v] to [0]\nset [x v] to (Enemy Item X)\nset [y v] to (Enemy Item Y)\nset [can contact? v] to [no]\npoint in direction (Enemy Direction)\nif <(direction) > [0]> then\n    point in direction (90)\nend\nif <(direction) < [0]> then\n    point in direction (-90)\nend\nshow\nforever\n    if <(Pause) = [0]> then\n        change [@fire v] by (1)\n        if <(@Fire) > [2]> then\n            set [can contact? v] to [yes]\n        end\n        if <(@Fire) > [10]> then\n            set [@fire v] to [7]\n        end\n        change [x v] by (([sin v] of (direction) ) * (8))\n        change [y v] by (([cos v] of (direction) ) * (8))\n        Switch Costume [1]\n        if <<touching (player v)?> and <(Can Contact?) = [yes]>> then\n            set [@fire v] to [0]\n            set [contact damage v] to [2]\n            broadcast (Contact Player v)\n            delete this clone\n        end\n        if <touching (_edge_ v)?> then\n            set [@fire v] to [0]\n            delete this clone\n        end\n        go to x: ((X) - (Scroll X)) y: ((Y) - (Scroll Y))\n    end\nend\n\n@Border\n\n@Sprite1\n\nwhen flag clicked\nhide\n\n
Left and Right key - Move\nZ Key - Fire X-Buster (Hold Z to charge for bigger shot)\nX Key - Jump (Wall jump when wall clinging)\nThe game will end at 24 kills