SMB Giant Bowser Boss Battle

Instructions: ARROW KEYS > Move\nZ                       > Run\nX or UP             > Jump\n\nKick the shells at Bowser five times.\nYou die even as Super Mario.\nIt may lag at the initial startup.

@Stage\n\nwhen I receive [mariostart v]\nset volume to (0) %\n\nwhen I receive [bowserdied v]\nstop [other scripts in stage v]\nswitch backdrop to (sky v)\n\nwhen I receive [bowserdierumble v]\nrepeat until <(bowserdieRumble) = [0]>\n    switch backdrop to (lightning1 v)\n    wait (0.1) seconds\n    switch backdrop to (sky v)\n    wait (0.1) seconds\nend\n\nwhen I receive [load v]\nset volume to (100) %\nswitch backdrop to (sky v)\nforever\n    wait (pick random (1) to (8)) seconds\n    start sound [thunder_firebreath v]\n    switch backdrop to (lightning1 v)\n    wait (0.3) seconds\n    switch backdrop to (lightning2 v)\n    wait (0.1) seconds\n    switch backdrop to (lightning3 v)\n    wait (0.1) seconds\n    switch backdrop to (sky v)\n    wait (0.1) seconds\nend\n\nwhen I receive [ending v]\nswitch backdrop to (blue1 v)\nwait (0.3) seconds\nswitch backdrop to (blue2 v)\nwait (0.3) seconds\nswitch backdrop to (blue3 v)\nwait (0.3) seconds\n\n@Floor\n\nwhen I receive [mariostart v]\ngo [backward v] (100) layers\n\nwhen I receive [rumble v]\nrepeat until <(rumble) = [0]>\n    change y by (4)\n    wait (0.1) seconds\n    change y by (-4)\nend\ngo to x: (0) y: (0)\n\nstart sound [Break v]\nwait (0.05) seconds\n\nwhen I receive [mariostart v]\nset [rumble v] to [0]\ngo to x: (0) y: (0)\n\nwhen I receive [bowserdierumble v]\nrepeat until <(bowserdieRumble) = [0]>\n    change y by (4)\n    wait (0.1) seconds\n    change y by (-4)\nend\ngo to x: (0) y: (0)\n\nwhen I receive [bowserdied v]\nstop [other scripts in sprite v]\ngo to x: (0) y: (0)\n\n@Mario\n\nwhen I receive [load v]\nshow\nset [canmove v] to [0]\nset [direction v] to [r]\nswitch costume to (r.skid/power v)\ngo to x: (0) y: (0)\nglide (0.6) secs to x: (0) y: (-150)\nswitch costume to (r.stand v)\nset [canmove v] to [1]\n\nwhen I receive [load v]\nforever\n    if <(canMove) = [1]> then\n        if <key (right arrow v) pressed?> then\n            repeat until <not <key (right arrow v) pressed?>>\n                set [direction v] to [r]\n                move (5) steps\n            end\n        end\n    end\nend\n\nwhen I receive [load v]\nforever\n    if <(canMove) = [1]> then\n        if <key (left arrow v) pressed?> then\n            repeat until <not <key (left arrow v) pressed?>>\n                set [direction v] to [l]\n                move (-5) steps\n            end\n        end\n    end\nend\n\nwhen I receive [load v]\nforever\n    if <(canMove) = [1]> then\n        if <<not <<key (left arrow v) pressed?> or <key (right arrow v) pressed?>>> and <touching (floor v)?>> then\n            if <(direction) = [l]> then\n                switch costume to (l.stand v)\n            end\n            if <(direction) = [r]> then\n                switch costume to (r.stand v)\n            end\n        end\n    end\nend\n\nif <touching (floor v)?> then\nelse\nend\nswitch costume to (r.walk1 v)\n\nwhen I receive [load v]\nforever\n    if <(canMove) = [1]> then\n        if <key (right arrow v) pressed?> then\n            if <touching (floor v)?> then\n                repeat until <not <key (right arrow v) pressed?>>\n                    wait (0.01) seconds\n                    switch costume to (r.walk1 v)\n                    wait (0.01) seconds\n                    switch costume to (r.walk2 v)\n                    wait (0.01) seconds\n                    switch costume to (r.walk3 v)\n                end\n            end\n        end\n        if <key (left arrow v) pressed?> then\n            if <touching (floor v)?> then\n                repeat until <not <key (left arrow v) pressed?>>\n                    wait (0.01) seconds\n                    switch costume to (l.walk1 v)\n                    wait (0.01) seconds\n                    switch costume to (l.walk2 v)\n                    wait (0.01) seconds\n                    switch costume to (l.walk3 v)\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [load v]\nforever\n    if <(canMove) = [1]> then\n        if <<key (x v) pressed?> or <key (up arrow v) pressed?>> then\n            broadcast (jump v)\n            start sound [jump2 v]\n            if <(direction) = [r]> then\n                set [jumping v] to [1]\n                switch costume to (r.jump v)\n                repeat (10)\n                    change y by (10)\n                end\n                change y by (7)\n                wait (0.01) seconds\n                change y by (5)\n                wait (0.01) seconds\n                change y by (3)\n                wait (0.1) seconds\n                change y by (-3)\n                wait (0.01) seconds\n                change y by (-5)\n                wait (0.01) seconds\n                change y by (-7)\n                repeat (10)\n                    change y by (-10)\n                end\n                set [jumping v] to [0]\n            else\n                if <(direction) = [l]> then\n                    set [jumping v] to [1]\n                    switch costume to (l.jump v)\n                    repeat (10)\n                        change y by (10)\n                    end\n                    change y by (7)\n                    wait (0.01) seconds\n                    change y by (5)\n                    wait (0.01) seconds\n                    change y by (3)\n                    wait (0.1) seconds\n                    change y by (-3)\n                    wait (0.01) seconds\n                    change y by (-5)\n                    wait (0.01) seconds\n                    change y by (-7)\n                    repeat (10)\n                        change y by (-10)\n                    end\n                    set [jumping v] to [0]\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [load v]\nforever\n    if <(canMove) = [1]> then\n        if <key (down arrow v) pressed?> then\n            if <touching (floor v)?> then\n                repeat until <not <key (down arrow v) pressed?>>\n                    set [canmove v] to [0]\n                    if <(direction) = [l]> then\n                        switch costume to (l.duck v)\n                    end\n                    if <(direction) = [r]> then\n                        switch costume to (r.duck v)\n                    end\n                end\n                set [canmove v] to [1]\n            end\n        end\n    end\nend\n\nwhen I receive [load v]\nset [candie v] to [1]\nforever\n    if <(canDie) = [1]> then\n        if <<<touching (bowser v)?> or <touching (firebeam v)?>> or <touching (podoboo v)?>> then\n            wait (0.1) seconds\n            set [candie v] to [0]\n            stop [other scripts in sprite v]\n            go to [front v] layer\n            broadcast (died v)\n            switch costume to (dead v)\n            start sound [Death v]\n            wait (0.6) seconds\n            repeat (10)\n                change y by (10)\n            end\n            wait (0.1) seconds\n            repeat until <(y position) < [-175]>\n                change y by (-10)\n            end\n            hide\n            wait (3) seconds\n            broadcast (MarioStart v)\n        end\n    end\nend\n\nwhen flag clicked\nbroadcast (MarioStart v)\n\nwhen I receive [load v]\nforever\n    if <(canMove) = [1]> then\n        if <<key (z v) pressed?> and <key (right arrow v) pressed?>> then\n            move (5) steps\n        end\n        if <<key (z v) pressed?> and <key (left arrow v) pressed?>> then\n            move (-5) steps\n        end\n    end\nend\n\nif  then\nend\n\nwhen I receive [jump v]\nrepeat until <(jumping) = [0]>\n    if <(direction) = [l]> then\n        switch costume to (l.jump v)\n    end\n    if <(direction) = [r]> then\n        switch costume to (r.jump v)\n    end\nend\n\nswitch costume to (l.duck v)\n\nwhen I receive [bowserdierumble v]\nrepeat until <(bowserdieRumble) = [0]>\n    change y by (4)\n    wait (0.1) seconds\n    change y by (-4)\nend\ngo to x: (-20) y: (-150)\n\nwhen I receive [startend v]\nswitch costume to (r.stand v)\n\nwhen I receive [bowserdied v]\nstop [other scripts in sprite v]\nwait (0.5) seconds\nset [canmove v] to [0]\nset [candie v] to [0]\nglide (1) secs to x: (x position) y: (-150)\nif <(direction) = [l]> then\n    switch costume to (l.stand v)\nelse\n    if <(direction) = [r]> then\n        switch costume to (r.stand v)\n    end\nend\n\nset [bowserhits v] to [1]\n\nset [bowserhits v] to [1]\n\n@Bowser\n\nwhen I receive [load v]\nhide\nwait (8) seconds\nshow\nswitch costume to (l.walk1 v)\ngo to x: (500) y: (-14)\nglide (0.3) secs to x: (444) y: (-14)\nwait (3) seconds\nglide (0.3) secs to x: (350) y: (-14)\nwait (0.3) seconds\nrepeat (3)\n    switch costume to (l.walk2 v)\n    wait (0.2) seconds\n    switch costume to (l.walk1 v)\n    wait (0.2) seconds\nend\nstart sound [Bullet v]\nglide (0.3) secs to x: (500) y: (-14)\nhide\nforever\n    set [bowserattack v] to (pick random (1) to (6))\n    if <(BowserAttack) = [1]> then\n        attack.slideR\n        wait (0.5) seconds\n    end\n    if <(BowserAttack) = [2]> then\n        attack.slideL\n        wait (0.5) seconds\n    end\n    if <(BowserAttack) = [3]> then\n        attack.podoboos\n        wait (0.5) seconds\n    end\n    if <(BowserAttack) = [4]> then\n        attack.rumble1\n        wait (0.5) seconds\n    end\n    if <(BowserAttack) = [5]> then\n        attack.rumble2\n        wait (0.5) seconds\n    end\n    if <(BowserAttack) = [6]> then\n        attack.firebeam\n        wait (0.5) seconds\n    end\nend\n\ndefine attack.podoboos\nshow\nswitch costume to (l.walk2 v)\ngo to x: (500) y: (-8)\nglide (0.3) secs to x: (385) y: (-8)\nstart sound [Bullet v]\nwait (0.4) seconds\nbroadcast (podoboos v)\nwait (4) seconds\nglide (0.3) secs to x: (500) y: (-8)\nhide\n\ndefine attack.rumble1\nbroadcast (rumble v)\nset [rumble v] to [1]\nwait (1) seconds\nshow\nswitch costume to (l.walk2 v)\ngo to x: (500) y: (-250)\nglide (1) secs to x: (-500) y: (-250)\nhide\nset [rumble v] to [0]\n\nwhen I receive [rumble v]\nrepeat until <(rumble) = [0]>\n    start sound [Destroy v]\n    wait (0.05) seconds\nend\nstart sound [Break v]\nwait (0.05) seconds\n\ndefine attack.rumble2\nbroadcast (rumble v)\nset [rumble v] to [1]\nwait (1) seconds\nshow\nswitch costume to (l.walk2 v)\ngo to x: (500) y: (-250)\nglide (0.5) secs to x: (200) y: (-250)\nglide (0.5) secs to x: (150) y: (-250)\nwait (0.3) seconds\nglide (0.5) secs to x: (150) y: (-250)\nglide (0.6) secs to x: (500) y: (-250)\nhide\nwait (0.8) seconds\nshow\ngo to x: (-500) y: (-250)\nglide (1) secs to x: (500) y: (-250)\nhide\nset [rumble v] to [0]\n\ndefine attack.firebeam\nshow\nswitch costume to (l.walk2 v)\ngo to x: (500) y: (-100)\nglide (0.3) secs to x: (385) y: (-100)\nstart sound [Bullet v]\nwait (0.4) seconds\nbroadcast (firebeam v)\nwait (2) seconds\nglide (0.3) secs to x: (500) y: (-100)\nhide\n\nwhen I receive [mariostart v]\nhide\nstop [other scripts in sprite v]\n\ndefine attack.slideL\nshow\nswitch costume to (l.walk2 v)\ngo to x: (500) y: (-100)\nglide (0.7) secs to x: (200) y: (-100)\nstart sound [Bullet v]\nwait (0.4) seconds\nglide (0.7) secs to x: (500) y: (-100)\nhide\n\nwhen I receive [load v]\nset [bowserhits v] to [5]\nforever\n    if <<touching (koopashell v)?> and <(MotionShell) = [1]>> then\n        change [bowserhits v] by (-1)\n        start sound [Fall2 v]\n        repeat (5)\n            wait (0.2) seconds\n            change [color v] effect by (25)\n        end\n        clear graphic effects\n    end\nend\n\ndefine attack.slideR\nshow\nswitch costume to (r.walk2 v)\ngo to x: (-500) y: (-100)\nglide (0.7) secs to x: (-200) y: (-100)\nstart sound [Bullet v]\nwait (0.4) seconds\nglide (0.7) secs to x: (-500) y: (-100)\nhide\n\nwhen I receive [load v]\nset [bowserdierumble v] to [0]\nset [bowserdied v] to [0]\nforever\n    if <(BowserHits) = [0]> then\n        if <(bowserDied) = [0]> then\n            set [bowserdied v] to [1]\n            stop [other scripts in sprite v]\n            broadcast (bowserDied v)\n        end\n    end\nend\n\nwhen I receive [bowserdied v]\nrepeat (10)\n    wait (0.2) seconds\n    change [color v] effect by (25)\nend\nclear graphic effects\nbroadcast (bowserdieRumble v)\nset [bowserdierumble v] to [1]\nwait (3) seconds\nset [bowserdierumble v] to [0]\nbroadcast (startEnd v)\nhide\n\nwhen I receive [bowserdierumble v]\nrepeat until <(bowserdieRumble) = [0]>\n    start sound [Destroy v]\n    wait (0.05) seconds\nend\nstart sound [Fall2 v]\n\nset [bowserhits v] to [4]\n\n@Music\n\nwhen I receive [load v]\nset volume to (100) %\nplay sound [BossIntro v] until done\nrepeat until <(canDie) = [0]>\n    play sound [BossMain v] until done\nend\n\nwhen I receive [died v]\nset volume to (0) %\n\nwhen I receive [mariostart v]\nstop all sounds\n\nwhen I receive [bowserdied v]\nstop [other scripts in sprite v]\n\nwhen I receive [startend v]\nwait (8) seconds\nbroadcast (ending v)\nset volume to (100) %\nplay sound [Peach Is Saved v] until done\n\n@MarioStart\n\nwhen I receive [mariostart v]\nset [ghost v] effect to (0)\nswitch costume to (mariostart v)\nshow\ngo to [front v] layer\nwait (3) seconds\nswitch costume to (fakenesthing v)\nwait (0.1) seconds\nbroadcast (load v)\nhide\n\nwhen I receive [startend v]\nshow\ngo to [front v] layer\nswitch costume to (costume1 v)\nwait (3) seconds\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (25)\n    wait (1) seconds\nend\nhide\n\nwhen I receive [ending v]\nwait (60) seconds\nclear graphic effects\nshow\ngo to [front v] layer\nswitch costume to (costume2 v)\n\n@Podoboo\n\nwhen I receive [mariostart v]\nhide\n\nwhen I receive [podoboos v]\nwait (0.5) seconds\nhide\nrepeat (7)\n    create clone of (_myself_ v)\n    wait (0.3) seconds\nend\n\nwhen I start as a clone\nshow\ngo to x: ([x position v] of [mario v]) y: (31)\nswitch costume to (podobooup v)\nglide (0.4) secs to x: (x position) y: (125)\nswitch costume to (podoboodown v)\nglide (0.7) secs to x: (x position) y: (-180)\nhide\ndelete this clone\n\nwhen I receive [bowserdied v]\nstop [other scripts in sprite v]\nhide\n\n@FireBeam\n\nwhen I receive [firebeam v]\nshow\ngo to x: (500) y: (-70)\nglide (0.2) secs to x: (-27) y: (-70)\nwait (1.2) seconds\nglide (0.2) secs to x: (500) y: (-70)\nhide\n\nwhen I receive [bowserdied v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [mariostart v]\nhide\nclear graphic effects\nforever\n    next costume\n    wait (0.1) seconds\nend\n\nwhen I receive [podoboos v]\nshow\ngo to x: (500) y: (8)\nglide (0.2) secs to x: (-27) y: (8)\nwait (3) seconds\nglide (0.2) secs to x: (500) y: (8)\nhide\n\n@Pipe\n\nwhen I receive [load v]\nshow\nforever\n    wait (15) seconds\n    broadcast (giveShell v)\nend\n\nwhen I receive [rumble v]\nrepeat until <(rumble) = [0]>\n    change y by (4)\n    wait (0.1) seconds\n    change y by (-4)\nend\ngo to x: (0) y: (148)\n\nwhen I receive [mariostart v]\nstop [other scripts in sprite v]\n\nwhen I receive [bowserdied v]\nstop [other scripts in sprite v]\n\nwhen I receive [bowserdierumble v]\nrepeat until <(bowserdieRumble) = [0]>\n    change y by (4)\n    wait (0.1) seconds\n    change y by (-4)\nend\nhide\n\n@KoopaShell\n\nwhen I receive [mariostart v]\nset volume to (0) %\nhide\n\nwhen I receive [giveshell v]\nset volume to (100) %\nshow\nswitch costume to (shell v)\nset [hitbowser v] to [0]\nset [kickable v] to [1]\ngo to x: (0) y: (129)\nstart sound [Grow v]\nglide (0.7) secs to x: (0) y: (100)\nrepeat until <(y position) < [-130]>\n    change y by (-10)\nend\nwait (6) seconds\nif <<(MotionShell) = [0]> and <(hitBowser) = [0]>> then\n    set [kickable v] to [0]\n    start sound [Disappear v]\n    switch costume to (poof1 v)\n    wait (0.1) seconds\n    switch costume to (poof2 v)\n    wait (0.1) seconds\n    switch costume to (poof3 v)\n    wait (0.1) seconds\n    hide\nend\n\nwhen I receive [load v]\nclear graphic effects\nset [motionshell v] to [0]\nforever\n    if <touching (mario v)?> then\n        if <(kickable) = [1]> then\n            start sound [Kick v]\n            set [motionshell v] to [1]\n            if <(direction) = [l]> then\n                repeat until <<touching (_edge_ v)?> or <touching (bowser v)?>>\n                    change x by (-15)\n                end\n                hide\n            else\n                if <(direction) = [r]> then\n                    repeat until <<touching (_edge_ v)?> or <touching (bowser v)?>>\n                        change x by (15)\n                    end\n                    hide\n                end\n            end\n            set [motionshell v] to [0]\n            set [hitbowser v] to [1]\n        end\n    end\nend\n\nwhen I receive [died v]\nset [motionshell v] to [0]\n\nset [motionshell v] to [0]\n\nwhen I receive [rumble v]\nif <touching (floor v)?> then\n    repeat until <(rumble) = [0]>\n        change y by (4)\n        wait (0.1) seconds\n        change y by (-4)\n    end\nend\n\nwhen I receive [died v]\nset [kickable v] to [0]\n\nwhen I receive [bowserdied v]\nstop [other scripts in sprite v]\nhide\n\n@Toadstool\n\nwhen I receive [mariostart v]\nhide\n\nwhen I receive [startend v]\nshow\ngo to x: (35) y: (180)\nglide (6) secs to x: (35) y: (-150)\n\n@thanks\n\nwhen I receive [ending v]\nwait (1) seconds\nshow\nswitch costume to (ending v)\nwait (1) seconds\nswitch costume to (ending2 v)\n\nwhen I receive [mariostart v]\nhide\n\n@thumbnail\n\nwhen flag clicked\nhide\n\n