Operation Gobo 5

Instructions: My speedrun is 3:03\n\nEdit 5/27/2023:\nWorld Record: @fruitberriesREAL 2:31\n\nPrevious World Records: @fruitberriesREAL 2:43\n@tagggz 3:03\n\nOperation Gobo 6: https://scratch.mit.edu/projects/73637388/\n\nWelcome to Operation Gobo 5! Use the arrow keys to move!\nPress Space to shoot while you have the gun powerup.\n\nI worked very hard on this so please love and favorite!\n\nTop Loved 5/26/15 thank you for the support!\nTop Remixed 5/30!\n\n10/3/18: Edited to be more respectful

@Stage\n\nwhen flag clicked\nforever\n    play sound [Harder, Better, Faster, Stronger \(NES remake\).mp3 v] until done\nend\n\n@Gobo\n\nwhen flag clicked\npoint in direction (90)\nset [reset v] to [0]\nset [powerup v] to [none]\nset [world v] to [0]\nset [inlevel v] to [yes]\nswitch backdrop to (boss4cutscene v)\nswitch costume to (gobo-a v)\nshow\nset size to (30) %\nset [x v] to [0]\nset [y v] to [0]\nforever\n    show\n    go to x: (-203) y: (-107)\n    forever\n        change [y v] by (-1)\n        if <key (left arrow v) pressed?> then\n            set [direction v] to [left]\n            change [x v] by (-1)\n            point in direction (-90)\n        end\n        if <key (right arrow v) pressed?> then\n            set [direction v] to [right]\n            change [x v] by (1)\n            point in direction (90)\n        end\n        set [x v] to ((x) * (0.9))\n        change x by (x)\n        if <<<<touching color (#00cc44)?> or <touching color (#ffffcc)?>> or <touching color (#666666)?>> or <touching color (#660000)?>> then\n            change y by (1)\n        end\n        if <<<<touching color (#00cc44)?> or <touching color (#ffffcc)?>> or <touching color (#666666)?>> or <touching color (#660000)?>> then\n            change y by (1)\n        end\n        if <<<<touching color (#00cc44)?> or <touching color (#ffffcc)?>> or <touching color (#666666)?>> or <touching color (#660000)?>> then\n            change y by (1)\n        end\n        if <<<<touching color (#00cc44)?> or <touching color (#ffffcc)?>> or <touching color (#666666)?>> or <touching color (#660000)?>> then\n            change y by (1)\n        end\n        if <<<<touching color (#00cc44)?> or <touching color (#ffffcc)?>> or <touching color (#666666)?>> or <touching color (#660000)?>> then\n            change y by (-4)\n            change x by ((x) * (-1))\n            if <key (up arrow v) pressed?> then\n                set [y v] to [15]\n                if <([abs v] of (x) ) = (x)> then\n                    set [x v] to [-10]\n                else\n                    set [x v] to [10]\n                end\n            else\n                set [x v] to [0]\n            end\n        end\n        change y by (y)\n        if <<<<touching color (#00cc44)?> or <touching color (#ffffcc)?>> or <touching color (#666666)?>> or <touching color (#660000)?>> then\n            change y by ((y) - ((y) * (2)))\n            set [y v] to [0]\n        end\n        change y by (-1)\n        if <<key (up arrow v) pressed?> and <<<<touching color (#00cc44)?> or <touching color (#ffffcc)?>> or <touching color (#666666)?>> or <touching color (#660000)?>>> then\n            set [y v] to [15]\n        end\n        change y by (1)\n        if <<touching color (#ff0000)?> or <touching color (#006622)?>> then\n            if <not <<(PowerUp) = [fire]> or <<(backdrop [name v]) = [boss2]> and <(x position) > (boss2x)>>>> then\n                go to x: (-203) y: (-107)\n            end\n            if <<<<(backdrop [name v]) = [9]> or <(backdrop [name v]) = [2-5]>> or <(backdrop [name v]) = [3-4]>> and <not <(PowerUp) = [fire]>>> then\n                set [reset v] to [1]\n                wait (0.1) seconds\n                set [reset v] to [0]\n            end\n        end\n        if <(x position) > [222]> then\n            switch backdrop to (next backdrop v)\n            go to x: (-203) y: (-107)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    switch costume to (PowerUp)\n    set [trackery v] to (y position)\n    set [trackerx v] to (x position)\nend\n\nwhen flag clicked\nwait until <(backdrop [name v]) = [4-16]>\ngo to x: (-208) y: (167)\n\n@PowerUp\n\nwhen flag clicked\nhide\nforever\n    if <(backdrop [name v]) = [1-7]> then\n        switch costume to (fire v)\n        go to x: (-24) y: (-118)\n        show\n        wait until <touching (gobo v)?>\n        hide\n        set [powerup v] to [fire]\n        repeat (50)\n            wait (0.01) seconds\n            if <not <(backdrop [name v]) = [1-7]>> then\n                set [powerup v] to [none]\n            end\n        end\n        set [powerup v] to [none]\n        wait until <<not <(backdrop [name v]) = [1-7]>> or <(reset) = [1]>>\n    end\n    if <(reset) = [1]> then\n        show\n    end\n    if <(backdrop [name v]) = [2-7]> then\n        switch costume to (fire v)\n        go to x: (81) y: (6)\n        show\n        wait until <touching (gobo v)?>\n        hide\n        set [powerup v] to [fire]\n        repeat (50)\n            wait (0.01) seconds\n            if <not <(backdrop [name v]) = [2-7]>> then\n                set [powerup v] to [none]\n            end\n        end\n        set [powerup v] to [none]\n        wait until <<not <(backdrop [name v]) = [2-7]>> or <(reset) = [1]>>\n    end\n    if <(reset) = [1]> then\n        show\n    end\n    if <(backdrop [name v]) = [3-4]> then\n        switch costume to (fire v)\n        go to x: (-127) y: (-110)\n        show\n        wait until <touching (gobo v)?>\n        hide\n        set [powerup v] to [fire]\n        repeat (75)\n            wait (0.01) seconds\n            if <not <(backdrop [name v]) = [3-4]>> then\n                set [powerup v] to [none]\n            end\n            if <(reset) = [1]> then\n                show\n            end\n        end\n        set [powerup v] to [none]\n        wait until <<not <(backdrop [name v]) = [3-4]>> or <(reset) = [1]>>\n    end\n    if <(reset) = [1]> then\n        show\n    end\n    if <(backdrop [name v]) = [3-6]> then\n        switch costume to (gun v)\n        go to x: (-96) y: (-111)\n        show\n        wait until <touching (gobo v)?>\n        hide\n        set [powerup v] to [gun]\n        wait until <<not <(backdrop [name v]) = [3-6]>> or <(reset) = [1]>>\n        set [powerup v] to [none]\n    end\n    if <(reset) = [1]> then\n        show\n    end\nend\n\n@boss1\n\nwhen flag clicked\nset [beatboss1 v] to [no]\nhide\nwait until <(backdrop [name v]) = [boss1]>\nshow\ngo to x: (130) y: (-78)\nbroadcast (boss1 v)\n\nwhen I receive [boss1 v]\nsay [You think you can beat me?]\nwait (1) seconds\nsay []\nrepeat until <(beatboss1) = [yes]>\n    point towards (gobo v)\n    move (3) steps\n    if <touching (gobo v)?> then\n        glide (1) secs to x: (157) y: (-47)\n    end\nend\ngo to x: (0) y: (0)\nrepeat until <touching (_edge_ v)?>\n    say [Nooooooooooo!]\n    change y by (-1)\nend\nhide\nswitch backdrop to (next backdrop v)\n\n@Boss1Prop\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\nwait until <(backdrop [name v]) = [boss1]>\nshow\ngo to x: (167) y: (-127)\nwait until <touching (gobo v)?>\nset [beatboss1 v] to [yes]\nnext costume\nwait until <(backdrop [name v]) = [beatboss1]>\nhide\n\n@boss2\n\nwhen I receive [boss2 v]\nsay [I only have one weakness! To beat me you need to find it!]\nwait (1) seconds\nsay []\nrepeat until <(beatboss2) = [yes]>\n    repeat until <(y position) < [-238]>\n        change y by (-5)\n        if <<touching (gobo v)?> and <(trackerx) > (x position)>> then\n            repeat until <(y position) < [-238]>\n                say [How did you find my weakness?]\n                change y by (-1)\n            end\n            hide\n            set [beatboss2 v] to [yes]\n            say []\n        end\n    end\n    if <<touching (gobo v)?> and <(trackerx) > (x position)>> then\n        repeat until <(y position) < [-238]>\n            say [How did you find my weakness?]\n            change y by (-1)\n        end\n        hide\n        set [beatboss2 v] to [yes]\n        say []\n    end\n    set x to (pick random (-150) to (150))\n    repeat (pick random (1) to (40))\n        change y by (5)\n        if <<touching (gobo v)?> and <(trackerx) > (x position)>> then\n            repeat until <(y position) < [-238]>\n                say [How did you find my weakness?]\n                change y by (-1)\n            end\n            hide\n            set [beatboss2 v] to [yes]\n            say []\n        end\n    end\nend\nswitch backdrop to (next backdrop v)\n\nwhen flag clicked\nset [beatboss2 v] to [no]\nhide\nwait until <(backdrop [name v]) = [boss2]>\nshow\ngo to x: (111) y: (-239)\nrepeat until <(y position) = [-81]>\n    change y by (1)\nend\nbroadcast (boss2 v)\n\nwhen flag clicked\nforever\n    set [boss2x v] to (x position)\nend\n\n@Sand\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    hide\n    wait until <(backdrop [name v]) = [boss2]>\n    show\n    go to [front v] layer\n    wait until <not <(backdrop [name v]) = [boss2]>>\nend\n\n@Projectile\n\nwhen flag clicked\nhide\nforever\n    if <(PowerUp) = [gun]> then\n        if <key (space v) pressed?> then\n            create clone of (_myself_ v)\n            wait (1) seconds\n        end\n    end\nend\n\nwhen I start as a clone\ngo to (gobo v)\nshow\nif <(direction) = [right]> then\n    repeat until <<<touching (obstacle v)?> or <touching (_edge_ v)?>> or <touching (boss3 v)?>>\n        if <(PowerUp) = [gun]> then\n            change x by (10)\n        else\n            delete this clone\n        end\n    end\n    delete this clone\nelse\n    repeat until <<<touching (obstacle v)?> or <touching (_edge_ v)?>> or <touching (boss3 v)?>>\n        if <(PowerUp) = [gun]> then\n            change x by (-10)\n        else\n            delete this clone\n        end\n    end\n    delete this clone\nend\n\n@Obstacle\n\nwhen flag clicked\nhide\nforever\n    if <(backdrop [name v]) = [3-6]> then\n        go to x: (-54) y: (-109)\n        show\n        switch costume to (3-6 v)\n        wait until <touching (projectile v)?>\n        set [powerup v] to [none]\n        hide\n        wait until <not <(backdrop [name v]) = [3-6]>>\n    end\nend\n\n@Boss3\n\nwhen flag clicked\npoint in direction (90)\nhide\nwait until <(backdrop [name v]) = [boss3]>\ngo to x: (0) y: (0)\nshow\nset [powerup v] to [gun]\nrepeat until <<touching (projectile v)?> and <color (#ff0000) is touching (#b2b2b2)?>>\n    turn right (pick random (-20) to (20)) degrees\n    move (5) steps\n    if on edge, bounce\nend\nswitch backdrop to (next backdrop v)\nhide\nset [powerup v] to [none]\n\n@Boss4\n\nwhen flag clicked\nswitch costume to (gobo-a v)\npoint in direction (90)\nhide\nwait until <(backdrop [name v]) = [4-14]>\nshow\ngo to x: (128) y: (-47)\nsay [Now I am going to get my revenge.] for (2) seconds\nglide (1) secs to x: (-53) y: (-50)\nsay [You see, you have no power, you are trapped behind bars.] for (2) seconds\nsay [Hahahahahhahahaahhahahahhaa!] for (2) seconds\nswitch backdrop to (next backdrop v)\nwait until <(trackery) < [-178]>\nhide\nswitch backdrop to (next backdrop v)\n\nwhen flag clicked\nforever\n    set [boss4x v] to (x position)\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\n\n