Blob: A Platformer (Mobile Friendly)
@Stage\n\nwhen flag clicked\nforever\n    switch backdrop to (Platform#)\nend\n\nwhen flag clicked\nforever\n    if <<<<(Platform#) = [1]> or <(Platform#) = [5]>> or <(Platform#) = [6]>> or <(Platform#) = [7]>> then\n        stop all sounds\n        wait (0.01) seconds\n        play sound [Blob Grass Theme v] until done\n    end\nend\n\nwhen I receive [music off v]\nset volume to (0) %\n\nwhen I receive [music on v]\nset volume to (200) %\n\nwhen flag clicked\nforever\n    if <<(Platform#) = [33]> or <(Platform#) = [35]>> then\n        stop all sounds\n        wait (0.01) seconds\n        play sound [Evil Blob's Castle Theme v] until done\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<<(Platform#) = [8]> or <(Platform#) = [9]>> or <(Platform#) = [10]>> or <(Platform#) = [11]>> then\n        stop all sounds\n        wait (0.01) seconds\n        play sound [Blob Cave Theme v] until done\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<<<(Platform#) = [12]> or <(Platform#) = [14]>> or <(Platform#) = [16]>> or <(Platform#) = [17]>> or <(Platform#) = [18]>> then\n        stop all sounds\n        wait (0.01) seconds\n        play sound [Blob Desert Theme v] until done\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<<(Platform#) = [19]> or <(Platform#) = [20]>> or <(Platform#) = [21]>> or <(Platform#) = [23]>> then\n        stop all sounds\n        wait (0.01) seconds\n        play sound [Blob Tundra Theme v] until done\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<(Platform#) = [26]> or <(Platform#) = [28]>> or <<(Platform#) = [30]> or <(Platform#) = [31]>>> then\n        stop all sounds\n        wait (0.01) seconds\n        play sound [Blob Water Theme v] until done\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Platform#) = [36]> then\n        if <(Battle) = [1]> then\n            stop all sounds\n            repeat until <(Battle) = [2]>\n                wait (0.01) seconds\n                play sound [Evil Blob Battle Theme v] until done\n            end\n        end\n    end\nend\n\nwhen I receive [battle start v]\nset [battle v] to [1]\n\nset [platform# v] to [36]\n\nwhen flag clicked\nforever\n    if <(Platform#) = [36]> then\n        stop all sounds\n        broadcast (Inside Castle v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [blobet v]\nstop all sounds\n\nwhen flag clicked\nforever\n    if <(Platform#) = [37]> then\n        play sound [End Scene Theme v] until done\n    end\nend\n\nwhen I receive [end scene v]\nbroadcast (Music on v)\n\nwhen flag clicked\nchange [☁ players v] by (1)\n\n@Blob\n\nwhen flag clicked\npoint in direction (90)\ngo to [front v] layer\nset [mobile v] to [0]\nforever\n    if <(Mobile) = [1]> then\n        stop [this script v]\n    else\n        set [x vel v] to [0]\n        set [y vel v] to [0]\n        set [jump v] to [0]\n        set [stop all v] to [0]\n        go to x: (-210) y: (-55)\n        repeat until <<<<<(x position) > [240]> or <(y position) > [180]>> or <<touching (death v)?> or <touching (final boss v)?>>> or <(y position) < [-182]>> or <touching (evil blob v)?>>\n            change [x vel v] by (<key (right arrow v) pressed?> - <key (left arrow v) pressed?>)\n            set [x vel v] to ((X Vel) * (0.9))\n            create clone of (_myself_ v)\n            change x by (round (X Vel))\n            if <touching (platform v)?> then\n                change x by (round ((X Vel) * (-1)))\n                if <<<key (up arrow v) pressed?> or <key (space v) pressed?>> or <touching (trampolines v)?>> then\n                    if <(X Vel) > [0]> then\n                        set [x vel v] to [-8]\n                    else\n                        set [x vel v] to [8]\n                    end\n                    set [jump v] to [0]\n                else\n                    set [x vel v] to [0]\n                end\n            end\n            change [y vel v] by (-1)\n            change y by (Y Vel)\n            if <touching (platform v)?> then\n                change y by ((Y Vel) * (-1))\n                if <(Y Vel) < [0]> then\n                    set [jump v] to [0]\n                end\n                set [y vel v] to [0]\n            end\n            if <<<key (up arrow v) pressed?> or <key (space v) pressed?>> or <touching (trampolines v)?>> then\n                if <(Jump) = [0]> then\n                    if <touching (trampolines v)?> then\n                        set [y vel v] to [25]\n                        start sound [Drum Boing v]\n                    else\n                        set [y vel v] to [15]\n                        start sound [Low Whoosh v]\n                    end\n                    set [jump v] to [1]\n                end\n            end\n            if <(Stop All) = [1]> then\n                stop [this script v]\n            end\n        end\n        if <<<(x position) > [240]> or <(y position) > [180]>> or <(y position) < [-182]>> then\n            broadcast (Next Level v)\n            change [platform# v] by (1)\n        end\n    end\nend\n\nwhen I start as a clone\nswitch costume to (blob1 v)\nrepeat (10)\n    change size by (-9)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen flag clicked\nshow\nset [platform# v] to [1]\nswitch costume to (blob1 v)\n\nwhen I receive [death v]\nglide (1) secs to x: (0) y: (-114)\nset [stop all v] to [1]\nwait (1) seconds\nglide (1) secs to x: (-163) y: (-114)\nwait until <(Platform#) = [37]>\nhide\n\nwhen I receive [mobile v]\ngo to [front v] layer\nset [mobile v] to [1]\nforever\n    set [x vel v] to [0]\n    set [y vel v] to [0]\n    set [jump v] to [0]\n    set [stop all v] to [0]\n    go to x: (-210) y: (-55)\n    repeat until <<<<<(x position) > [240]> or <(y position) > [180]>> or <<touching (death v)?> or <touching (final boss v)?>>> or <(y position) < [-182]>> or <touching (evil blob v)?>>\n        change [x vel v] by (Stick x)\n        set [x vel v] to ((X Vel) * (0.9))\n        create clone of (_myself_ v)\n        change x by (round (X Vel))\n        if <touching (platform v)?> then\n            change x by (round ((X Vel) * (-1)))\n            if <<<key (up arrow v) pressed?> or <key (space v) pressed?>> or <<(Stick y) > [0.6]> or <touching (trampolines v)?>>> then\n                if <(X Vel) > [0]> then\n                    set [x vel v] to [-8]\n                else\n                    set [x vel v] to [8]\n                end\n                set [jump v] to [0]\n            else\n                set [x vel v] to [0]\n            end\n        end\n        change [y vel v] by (-1)\n        change y by (Y Vel)\n        if <touching (platform v)?> then\n            change y by ((Y Vel) * (-1))\n            if <(Y Vel) < [0]> then\n                set [jump v] to [0]\n            end\n            set [y vel v] to [0]\n        end\n        if <<<key (up arrow v) pressed?> or <key (space v) pressed?>> or <<(Stick y) > [0.6]> or <touching (trampolines v)?>>> then\n            if <(Jump) = [0]> then\n                if <touching (trampolines v)?> then\n                    set [y vel v] to [25]\n                    start sound [Drum Boing v]\n                else\n                    set [y vel v] to [15]\n                    start sound [Low Whoosh v]\n                end\n                set [jump v] to [1]\n            end\n        end\n        if <(Stop All) = [1]> then\n            stop [this script v]\n        end\n        if <<<(x position) > [240]> or <(y position) > [180]>> or <(y position) < [-182]>> then\n            broadcast (Next Level v)\n            change [platform# v] by (1)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n    end\nend\n\n@Platform\n\nwhen flag clicked\ngo to x: (-67) y: (-120)\nforever\n    switch costume to (Platform#)\nend\n\n@Death\n\nwhen flag clicked\ngo to [back v] layer\ngo to x: (50) y: (0)\nswitch costume to (lava1 v)\nforever\n    switch costume to (Platform#)\n    set y to (0)\nend\n\n@Coins\n\nwhen flag clicked\ngo to [back v] layer\nshow\nset [coins v] to [0]\nforever\n    switch costume to (Platform#)\nend\n\nwhen flag clicked\nforever\n    if <touching (blob v)?> then\n        start sound [Coin v]\n        hide\n        change [coins v] by (1)\n    end\nend\n\nwhen I receive [next level v]\nshow\n\n@Music Button\n\nwhen flag clicked\nshow\nswitch costume to (on v)\ngo to x: (225) y: (157)\nbroadcast (Music on v)\nset size to (200) %\nshow\nforever\n    if <not <touching (mouse-pointer v)?>> then\n        set [ghost v] effect to (60)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen I receive [music off v]\nwait (1) seconds\nforever\n    if <<<touching (mouse-pointer v)?> and <mouse down?>> and <(costume [number v]) = [2]>> then\n        switch costume to (on v)\n        broadcast (Music on v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [music on v]\nwait (1) seconds\nrepeat until <<<touching (mouse-pointer v)?> and <mouse down?>> and <(costume [number v]) = [2]>>\n    if <touching (mouse-pointer v)?> then\n        switch costume to (off v)\n    else\n        switch costume to (on v)\n    end\nend\nswitch costume to (off v)\nbroadcast (music off v)\nstop [this script v]\n\nwhen flag clicked\nset [ghost v] effect to (60)\nforever\n    go to [front v] layer\nend\n\n@Thing\n\nwhen flag clicked\ngo to x: (0) y: (24)\nforever\n    if <(Platform#) = [37]> then\n        show\n    else\n        hide\n    end\nend\n\n@Trampolines\n\nwhen flag clicked\nswitch costume to (trampolines1 v)\ngo to x: (36) y: (29)\nforever\n    if <(Platform#) = [1]> then\n        hide\n    end\n    if <(Platform#) = [10]> then\n        show\n    end\n    if <(Platform#) = [11]> then\n        switch costume to (trampolines2 v)\n    end\n    if <(Platform#) = [12]> then\n        hide\n    end\n    if <(Platform#) = [37]> then\n        show\n        switch costume to (trampolines3 v)\n        go to x: (0) y: (0)\n    end\nend\n\n@Blob Shark\n\nwhen flag clicked\nhide\ngo to [back v] layer\nset [ghost v] effect to (60)\nforever\n    if <<<<(Platform#) = [27]> or <(Platform#) = [28]>> or <<(Platform#) = [29]> or <(Platform#) = [30]>>> or <<(Platform#) = [31]> or <(Platform#) = [32]>>> then\n        hide\n        create clone of (_myself_ v)\n        wait (30) seconds\n    else\n        hide\n    end\nend\n\nwhen I start as a clone\nshow\nset y to (pick random (150) to (-92))\nrepeat (260)\n    change x by (-2)\n    wait (0.03) seconds\n    next costume\nend\ndelete this clone\n\n@Castle\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to [back v] layer\nhide\nforever\n    if <(Platform#) = [34]> then\n        show\n    end\n    if <(Platform#) = [35]> then\n        show\n        switch costume to (costume2 v)\n    end\n    if <(Platform#) = [36]> then\n        hide\n    end\nend\n\n@Evil Blob\n\nwhen flag clicked\nset [battle v] to [0]\nhide\ngo to x: (175) y: (-75)\nset [ghost v] effect to (0)\nswitch costume to (evil blob1 v)\n\nwhen I receive [attack v]\ngo to x: (175) y: (-76)\nchange [life v] by (-1)\n\nwhen I receive [death v]\nstop all sounds\nstop [other scripts in sprite v]\nbroadcast (music off v)\ngo to x: (175) y: (-76)\nswitch costume to (evil blob2 v)\nplay sound [Death v] until done\nplay sound [Evil Blob Defeated v] until done\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nset [battle v] to [2]\n\nwhen I receive [battle start v]\nforever\n    if <(Platform#) = [36]> then\n        repeat until <touching (block1 v)?>\n            switch costume to (evil blob1 v)\n            change x by (-3)\n        end\n        wait (0.1) seconds\n        repeat until <touching (block2 v)?>\n            switch costume to (evil blob3 v)\n            change x by (3)\n        end\n    end\nend\n\nwhen I receive [inside castle v]\nshow\nplay sound [Voice1 v] until done\nbroadcast (Battle Start v)\n\n@Final Boss\n\nwhen I receive [attack v]\nif <(Life) = [3]> then\n    start sound [Pain v]\n    wait (0.1) seconds\nend\nif <(Life) = [2]> then\n    start sound [Pain v]\n    wait (0.1) seconds\nend\nif <(Life) = [1]> then\n    start sound [Pain v]\n    wait (0.1) seconds\nend\nif <(Life) = [0]> then\n    hide\n    broadcast (Death v)\n    stop [this script v]\nend\n\nwhen flag clicked\nset [life v] to [3]\nhide\nforever\n    if <(Platform#) = [36]> then\n        if <(Battle) = [2]> then\n            hide\n            stop [this script v]\n        else\n            show\n            set [ghost v] effect to (0)\n            go to (evil blob v)\n            if <touching (blob v)?> then\n                if <(Battle) = [1]> then\n                    broadcast (Attack v)\n                end\n            end\n        end\n    end\nend\n\n@Block1\n\nwhen flag clicked\nhide\nset [ghost v] effect to (99)\ngo to x: (-237) y: (-118)\nforever\n    if <(Platform#) = [36]> then\n        show\n    else\n        hide\n    end\nend\n\nset [ghost v] effect to (0)\n\n@Block2\n\nwhen flag clicked\nhide\nset [ghost v] effect to (99)\ngo to x: (227) y: (-118)\nforever\n    if <(Platform#) = [36]> then\n        show\n    else\n        hide\n    end\nend\n\nset [ghost v] effect to (0)\n\n@Cage\n\nwhen flag clicked\ngo to x: (0) y: (491)\nswitch costume to (cage1 v)\ngo to [back v] layer\nhide\nforever\n    if <(Platform#) = [36]> then\n        if <(Battle) = [2]> then\n            broadcast (Blobet v)\n            stop [this script v]\n        end\n    end\nend\n\nwhen I receive [blobet v]\nwait (1) seconds\nshow\nstart sound [Chains v]\nglide (5.2) secs to x: (0) y: (211)\nbroadcast (End v)\nrepeat (5)\n    next costume\n    wait (0.01) seconds\nend\nplay sound [Metal Crash v] until done\nwait until <(Platform#) = [37]>\nhide\n\n@Blobet\n\nwhen flag clicked\nset [end v] to [0]\ngo to x: (0) y: (-108)\nhide\n\nwhen I receive [end v]\ngo to [back v] layer\nshow\nwait (1) seconds\nglide (0.7) secs to x: (-83) y: (-108)\nplay sound [Blobet v] until done\nwait (1) seconds\nbroadcast (End Scene v)\nset [platform# v] to [37]\nswitch backdrop to (the end! v)\ngo to x: (210) y: (-115)\n\nwhen I receive [end scene v]\ngo to [front v] layer\n\n@Blob End\n\nwhen I start as a clone\nswitch costume to (blob1 v)\nrepeat (10)\n    change size by (-9)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    if <(Platform#) = [37]> then\n        show\n        set [x vel v] to [0]\n        set [y vel v] to [0]\n        set [jump v] to [0]\n        go to x: (-210) y: (-122)\n        repeat until <<<<<(x position) > [240]> or <(y position) > [180]>> or <touching (death v)?>> or <(y position) < [-182]>> or <touching (evil blob v)?>>\n            change [x vel v] by (<key (right arrow v) pressed?> - <key (left arrow v) pressed?>)\n            set [x vel v] to ((X Vel) * (0.9))\n            create clone of (_myself_ v)\n            change x by (round (X Vel))\n            if <touching (platform v)?> then\n                change x by (round ((X Vel) * (-1)))\n                if <<<key (up arrow v) pressed?> or <key (space v) pressed?>> or <touching (trampolines v)?>> then\n                    if <(X Vel) > [0]> then\n                        set [x vel v] to [-8]\n                    else\n                        set [x vel v] to [8]\n                    end\n                    set [jump v] to [0]\n                else\n                    set [x vel v] to [0]\n                end\n            end\n            change [y vel v] by (-1)\n            change y by (Y Vel)\n            if <<touching (platform v)?> or <touching (blobet v)?>> then\n                change y by ((Y Vel) * (-1))\n                if <(Y Vel) < [0]> then\n                    set [jump v] to [0]\n                end\n                set [y vel v] to [0]\n            end\n            if <<<key (up arrow v) pressed?> or <key (space v) pressed?>> or <touching (trampolines v)?>> then\n                if <(Jump) = [0]> then\n                    if <touching (trampolines v)?> then\n                        set [y vel v] to [25]\n                        start sound [Drum Boing v]\n                    else\n                        set [y vel v] to [15]\n                        start sound [Low Whoosh v]\n                    end\n                    set [jump v] to [1]\n                end\n            end\n        end\n        if <<<(x position) > [240]> or <(y position) > [180]>> or <(y position) < [-182]>> then\n            broadcast (Next Level v)\n            change [platform# v] by (1)\n        end\n    else\n        hide\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\n\n@Coins:\n\nwhen flag clicked\nset [brightness v] effect to (0)\nforever\n    if <(Platform#) = [8]> then\n        set [brightness v] effect to (100)\n    end\n    if <(Platform#) = [12]> then\n        set [brightness v] effect to (0)\n    end\n    if <(Platform#) = [19]> then\n        set [brightness v] effect to (100)\n    end\n    if <(Platform#) = [26]> then\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen flag clicked\nforever\n    go to x: (-193) y: (156)\n    show\nend\n\n@Digit1\n\nwhen flag clicked\nset [brightness v] effect to (0)\nforever\n    if <(Platform#) = [8]> then\n        set [brightness v] effect to (100)\n    end\n    if <(Platform#) = [12]> then\n        set [brightness v] effect to (0)\n    end\n    if <(Platform#) = [19]> then\n        set [brightness v] effect to (100)\n    end\n    if <(Platform#) = [26]> then\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen flag clicked\nforever\n    show\n    go to x: (-143) y: (154)\nend\n\nwhen flag clicked\nforever\n    if <(Coins) = [0]> then\n        switch costume to (0 v)\n    end\n    if <(Coins) = [10]> then\n        switch costume to (1 v)\n    end\n    if <(Coins) = [20]> then\n        switch costume to (2 v)\n    end\nend\n\n@Digit2\n\nwhen flag clicked\nforever\n    show\n    go to x: (-125) y: (154)\nend\n\nwhen flag clicked\nforever\n    if <<<(Coins) = [0]> or <(Coins) = [10]>> or <(Coins) = [20]>> then\n        switch costume to (0 v)\n    end\n    if <<<(Coins) = [1]> or <(Coins) = [11]>> or <(Coins) = [21]>> then\n        switch costume to (1 v)\n    end\n    if <<<(Coins) = [2]> or <(Coins) = [12]>> or <(Coins) = [22]>> then\n        switch costume to (2 v)\n    end\n    if <<<(Coins) = [3]> or <(Coins) = [13]>> or <(Coins) = [23]>> then\n        switch costume to (3 v)\n    end\n    if <<<(Coins) = [4]> or <(Coins) = [14]>> or <(Coins) = [24]>> then\n        switch costume to (4 v)\n    end\n    if <<<(Coins) = [5]> or <(Coins) = [15]>> or <(Coins) = [25]>> then\n        switch costume to (5 v)\n    end\n    if <<<(Coins) = [6]> or <(Coins) = [16]>> or <(Coins) = [26]>> then\n        switch costume to (6 v)\n    end\n    if <<<(Coins) = [7]> or <(Coins) = [17]>> or <(Coins) = [27]>> then\n        switch costume to (7 v)\n    end\n    if <<(Coins) = [8]> or <(Coins) = [18]>> then\n        switch costume to (8 v)\n    end\n    if <<(Coins) = [9]> or <(Coins) = [19]>> then\n        switch costume to (9 v)\n    end\nend\n\nwhen flag clicked\nset [brightness v] effect to (0)\nforever\n    if <(Platform#) = [8]> then\n        set [brightness v] effect to (100)\n    end\n    if <(Platform#) = [12]> then\n        set [brightness v] effect to (0)\n    end\n    if <(Platform#) = [19]> then\n        set [brightness v] effect to (100)\n    end\n    if <(Platform#) = [26]> then\n        set [brightness v] effect to (0)\n    end\nend\n\n@Joystick\n\nwhen flag clicked\nhide\nset [my self v] to [Joystick]\nset [max stick v] to [42]\nswitch costume to (base v)\ngo to [front v] layer\ncreate clone of (_myself_ v)\nset [ghost v] effect to (20)\nset size to (100) %\n\nwhen I start as a clone\ngo to [front v] layer\nswitch costume to (stick  v)\nset [ghost v] effect to (15)\nforever\n    set [stick power v] to []\n    set [stick x v] to [0]\n    set [stick y v] to [0]\n    repeat until <mouse down?>\n        go to (My self)\n    end\n    if <(distance to [mouse-pointer v]) < ((size) / (.6))> then\n        repeat until <not <mouse down?>>\n            go to (mouse-pointer v)\n            point towards (My self)\n            turn right (180) degrees\n            set [stick direction v] to (direction)\n            set [stick power v] to (distance to [(My self) v])\n            if <(Stick power) > (Max stick)> then\n                move ((Max stick) - (Stick power)) steps\n                set [stick power v] to (Max stick)\n            end\n            set [stick power v] to ((Stick power) / (Max stick))\n            set [stick x v] to ((Stick power) * ([sin v] of (Stick direction) ))\n            set [stick y v] to ((Stick power) * ([cos v] of (Stick direction) ))\n        end\n    else\n        wait until <not <mouse down?>>\n    end\nend\n\nwhen I receive [mobile v]\nshow\n\nwhen flag clicked\nask [Mobile? Y\N] and wait\nif < (answer) contains [y]?> then\n    broadcast (Mobile v)\nend\nif < (answer) contains [n]?> then\n    stop [other scripts in sprite v]\n    stop [this script v]\nend\n\n
200 Loves for Part 2!\n\nControls:\nArrow keys to move.\nSpace or up arrow to jump.\nMobile Friendly.