♦︎ LEGO 2 ♦︎ | A Platformer #Games #Platformer #All

Instructions: ♦︎ LEGO 2 ♦︎ | A Platformer\n\nLEGO 1: https://scratch.mit.edu/projects/542862750/\nLEGO 2: https://scratch.mit.edu/projects/547644658/\n\n- 36th On GAMES!!! TYSM! \n\n⌙ Hi Guys!! This is Part 2!! I was getting a lot of requests to make part 2, so here it is!!! I Hope you Enjoy!!\n~~~~~~~~~~~CONTROLS~~~~~~~~~~~~~\nMobile- Friendly, Arrow Keys To Move, And Press Skip to Skip Levels (I don't recommend that...)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n★ Leave a ♥︎ and a ★ if you liked this!!\n★ I might make part 3 if I get 100 hearts, stars!!\n★ See what happens if you don't Skip!!\n\n-Credits-\nMe For Pixel Art (Lego)\nMe For Coding\nBGM: Monkey Spinning Monkey\nBGM: SMB3 Hammer Bros Theme\nSFX: Super Mario, Scratch

@Stage\n\nwhen flag clicked\nbroadcast (Start v)\nforever\n    play sound [Kevin_MacLeod_-_Monkeys_Spinning_Monkeys.mp3 v] until done\nend\n\nwhen flag clicked\nwait until <(Level) = [14]>\nwait (.25) seconds\nstop [other scripts in sprite v]\nbroadcast (another detect v)\nforever\n    play sound [Super Mario Bros v] until done\nend\n\nwhen I receive [another detect v]\nwait until <(Level) = [15]>\nwait (.25) seconds\nstop [other scripts in sprite v]\nforever\n    play sound [Super Mario Bros \(NES\) Music - Ending Theme v] until done\nend\n\n@lego\n\ndefine reset\nset [xv v] to [0]\nset [yv v] to [0]\n\ndefine physics <touch>\nset [x v] to (x position)\nset [y v] to (y position)\ngo to [front v] layer\ngo [backward v] (1) layers\nclear graphic effects\nchange [yv v] by (-1)\nif <touching (trampoline v)?> then\n    start sound [Boing sound effect v]\n    change [yv v] by (20)\nend\nif <key (r v) pressed?> then\n    broadcast (Reset v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    go to x: (-200) y: (-45)\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    point in direction (90)\n    change [xv v] by (0.9)\nend\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    point in direction (-90)\n    change [xv v] by (-0.9)\nend\nset [xv v] to ((Xv) * (0.9))\nchange x by (Xv)\nif <<touching (platforms v)?> or <touching (barrier v)?>> then\n    change y by (1)\nend\nif <<touching (platforms v)?> or <touching (barrier v)?>> then\n    change y by (1)\nend\nif <<touching (platforms v)?> or <touching (barrier v)?>> then\n    change y by (1)\nend\nif <<touching (platforms v)?> or <touching (barrier v)?>> then\n    change y by (1)\nend\nif <<touching (platforms v)?> or <touching (barrier v)?>> then\n    change y by (-4)\n    change x by ((Xv) * (-1))\n    if <<key (up arrow v) pressed?> or <mouse down?>> then\n        set [yv v] to [14]\n        if <(Xv) > [0]> then\n            start sound [smb_jump-small v]\n            set [xv v] to [-10]\n        else\n            start sound [smb_jump-small v]\n            set [xv v] to [10]\n        end\n    end\nend\nchange y by (Yv)\nif <<touching (platforms v)?> or <touching (barrier v)?>> then\n    change y by ((Yv) * (-1))\n    set [yv v] to [0]\nend\nchange y by (-1)\nif <<<key (up arrow v) pressed?> or <mouse down?>> and <<touching (platforms v)?> or <touching (barrier v)?>>> then\n    if <touching (trampoline v)?> then\n        change [yv v] by (20)\n    else\n        change [yv v] by (14)\n    end\n    start sound [smb_jump-small v]\nend\nchange y by (1)\nif <(x position) > [235]> then\n    change [level v] by (1)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    reset\n    go to x: (-200) y: (-45)\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\nif <<<touching (danger v)?> or <<<touching (boss v)?> and <(Boss Defeat?) = [0]>> or <touching (enemies v)?>>> or <(y position) < [-175]>> then\n    start sound [Crunch v]\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    reset\n    go to x: (-200) y: (-45)\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\n\ndefine Tick\n\nwhen I receive [next level v]\ngo to x: (-200) y: (-45)\n\nwhen I receive [skip meh v]\ngo to x: (-200) y: (-45)\n\ndefine Bouncy \nif <touching color (#fff800)?> then\n    set [yv v] to [20]\nend\n\ndefine Wall Jump\n\nwhen I receive [start v]\nwait (1) seconds\nshow\ngo to x: (-183) y: (0)\nset [xy v] to [0]\nset [yv v] to [0]\nforever\n    physics <>\nend\n\nwhen I receive [next level v]\ngo to x: (-200) y: (-45)\nshow\n\nwhen I receive [shape v]\nif <key (down arrow v) pressed?> then\n    switch costume to (pixil-frame-2 v)\nelse\n    switch costume to (pixil-frame-0 v)\nend\n\nwhen flag clicked\nset rotation style [left-right v]\ngo to [front v] layer\n\nwhen I receive [stop v]\nstop [other scripts in sprite v]\ngo to x: (-200) y: (-45)\n\nwhen I receive [resume v]\nforever\n    physics <>\nend\n\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [xy v] by (1)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [xy v] by (-1)\nend\nchange x by (Xy)\nset [xy v] to ((Xy) * (0.9))\nif <touching color (#000000)?> then\n    change y by (1)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change x by ((Xy) * (-1))\n                        change y by (-5)\n                        Wall Jump\n                    end\n                end\n            end\n        end\n    end\nend\nchange [yv v] by (-1)\nchange y by (Yv)\nif <touching color (#000000)?> then\n    change y by ((Yv) * (-1))\n    set [yv v] to [0]\nend\nchange y by (-1)\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    if <touching color (#000000)?> then\n        set [yv v] to [13]\n    end\nend\nchange y by (1)\nif <(x position) > [225]> then\n    broadcast (Next Level v)\nend\nBouncy \nBad\n\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    if <(Xy) > [0]> then\n        set [xy v] to [-10]\n    else\n        set [xy v] to [10]\n    end\n    set [yv v] to [15]\nelse\n    set [xy v] to [0]\nend\n\ndefine Bad\nif <touching color (#ff0000)?> then\n    go to x: (-183) y: (0)\nend\nif <(y position) < [-172]> then\n    go to x: (-183) y: (0)\nend\n\nwhen flag clicked\nset [level v] to [1]\n\n@Platforms\n\nwhen I receive [next level v]\nchange [level v] by (1)\n\nwhen flag clicked\nset [level v] to [1]\ngo to x: (0) y: (0)\nhide\nswitch costume to (costume6 v)\ngo to [back v] layer\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [start v]\nswitch costume to (costume1 v)\nshow\n\nchange [level v] by (1)\n\n@Txtbox\n\nwhen flag clicked\nforever\n    Go\nend\n\ndefine Go\ngo to (lego v)\nswitch costume to (Level)\n\n@Skip\n\nwhen this sprite clicked\nchange [# skips v] by (1)\nbroadcast (Next Level v)\n\nwhen flag clicked\nset [# skips v] to [0]\nshow\ngo to [front v] layer\nset size to (90) %\nwait (.2) seconds\nforever\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        change size by (((80) - (size)) / (3))\n    else\n        change size by (((70) - (size)) / (3))\n    end\n    if <(Level) = [15]> then\n        repeat (10)\n            change [ghost v] effect by (10)\n            change [pixelate v] effect by (10)\n        end\n        hide\n    else\n        show\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to [front v] layer\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nforever\n    set [ghost v] effect to (100)\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n@Danger\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nwait until <(Level) = [2]>\nbroadcast (Wait v)\nshow\nforever\n    glide (pick random (.1) to (.2)) secs to x: (0) y: (10)\n    glide (pick random (.1) to (.2)) secs to x: (0) y: (0)\nend\n\nwhen I receive [wait v]\nwait until <(Level) = [3]>\nhide\nstop [other scripts in sprite v]\nwait until <(Level) = [5]>\ngo to x: (0) y: (6)\nswitch costume to (costume2 v)\nshow\nwait until <(Level) = [6]>\nhide\nwait until <(Level) = [11]>\ngo to x: (-12) y: (47)\nswitch costume to (costume3 v)\nshow\nwait until <(Level) = [12]>\nhide\n\n@Cloud\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\n    wait (1) seconds\nend\n\nwhen I start as a clone\nswitch costume to (pick random (1) to (2))\nshow\ngo to x: (-270) y: (pick random (178) to (116))\nset [ghost v] effect to (100)\nset [random v] to (pick random (6) to (10))\nrepeat (Random)\n    change [ghost v] effect by (-10)\n    change x by (pick random (4) to (5))\nend\nrepeat until <(x position) > [250]>\n    change x by (pick random (4) to (5))\nend\nrepeat (Random)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\n@House\n\nwhen flag clicked\ngo to x: (-60) y: (-66)\nhide\nwait until <(Level) = [9]>\nshow\nwait until <(Level) = [10]>\nhide\n\n@NPC\n\ndefine typewrite (text) for (wait) seconds\nset [say v] to []\nset [letter v] to []\nrepeat (length of (text))\n    wait (0.01) seconds\n    change [letter v] by (1)\n    set [say v] to (join (say) (letter (letter) of (text)))\n    say (say)\n    start sound [B Sax v]\nend\nwait (wait) seconds\nsay []\n\nwhen flag clicked\ngo to x: (-75) y: (-100)\nset [touching?? v] to [0]\nhide\nset [touching2?? v] to [0]\nwait until <(Level) = [9]>\nrepeat (1)\n    switch costume to (a v)\n    create clone of (_myself_ v)\nend\ngo to x: (75) y: (-100)\nswitch costume to (a v)\ncreate clone of (_myself_ v)\nswitch costume to (b v)\ncreate clone of (_myself_ v)\nswitch costume to (costume2 v)\nwait until <(Level) = [10]>\nbroadcast (Delete interactives v)\nwait until <(Level) = [14]>\nwait until <<not <(Level) = [14]>> or <key (h v) pressed?>>\nif <key (h v) pressed?> then\n    switch costume to (b2 v)\n    go to x: (-16) y: (-197)\n    set [ghost v] effect to (100)\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    wait (2) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\nend\nhide\n\nwhen I start as a clone\nif <<(costume [name v]) = [a]> and <[-75] = (x position)>> then\n    show\n    forever\n        if <touching (lego v)?> then\n            set [touching?? v] to [1]\n        else\n            set [touching?? v] to [0]\n        end\n    end\nelse\n    if <<(costume [name v]) = [a]> and <[75] = (x position)>> then\n        show\n        forever\n            if <touching (lego v)?> then\n                set [touching2?? v] to [1]\n            else\n                set [touching2?? v] to [0]\n            end\n        end\n    else\n        if <(costume [name v]) = [b]> then\n            hide\n            forever\n                if <<(Touching??) = [1]> or <(Touching2??) = [1]>> then\n                    go to (lego v)\n                    show\n                    if <key (a v) pressed?> then\n                        hide\n                        broadcast (interact v) and wait\n                    end\n                else\n                    hide\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [interact v]\nif <(costume [name v]) = [a]> then\n    if <(Touching??) = [1]> then\n        if <[-75] = (x position)> then\n            typewrite [Hello Young Fellow! If you are looking for the lego village, you have to go a little further!] for [2] seconds\n        end\n    else\n        if <[75] = (x position)> then\n            typewrite [Hi! Check My Profile!!] for [2] seconds\n        end\n    end\nend\n\nwhen I receive [delete interactives v]\nif <not <(costume [name v]) = [costume2]>> then\n    stop [other scripts in sprite v]\n    delete this clone\nend\n\n@BARRIER\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nwait until <(Level) = [14]>\nshow\nwait (.15) seconds\nglide (.1) secs to x: (0) y: (-220)\nwait until <(Boss Defeat?) = [1]>\nshow\nwait (.15) seconds\nglide (.1) secs to x: (0) y: (0)\nwait until <(Level) = [15]>\nhide\n\n@BOSS\n\nwhen flag clicked\npoint in direction (90)\nset size to (100) %\nset [loop v] to [0]\nhide\nset [boss defeat? v] to [0]\nwait until <(Level) = [14]>\nswitch costume to (costume1 v)\ncreate clone of (_myself_ v)\nswitch costume to (costume2 v)\ncreate clone of (_myself_ v)\nswitch costume to (costume3 v)\n\ngo to x: (-13) y: (57)\n\nwhen I start as a clone\nif <(costume [name v]) = [costume1]> then\n    show\n    go to x: (-13) y: (177)\n    glide (.1) secs to x: (-13) y: (57)\n    forever\n        show\n        repeat (pick random (1) to (5))\n            repeat (5)\n                change [color v] effect by (0)\n                change [brightness v] effect by (2)\n            end\n            repeat (5)\n                change [color v] effect by (0)\n                change [brightness v] effect by (-2)\n            end\n        end\n        set [loop v] to [1]\n        create clone of (_myself_ v)\n    end\nelse\n    if <(costume [name v]) = [costume2]> then\n        show\n        go to x: (-13) y: (177)\n        glide (.1) secs to x: (-13) y: (57)\n        broadcast (detetct v)\n        forever\n            go to [front v] layer\n            show\n            repeat (5)\n                change [color v] effect by (0)\n                change [brightness v] effect by (2)\n            end\n            repeat (5)\n                change [color v] effect by (0)\n                change [brightness v] effect by (-2)\n            end\n        end\n    end\nend\n\nwhen I receive [detetct v]\nif <(costume [name v]) = [costume2]> then\n    forever\n        if <touching (lego v)?> then\n            set [boss defeat? v] to [1]\n            broadcast (defeat v)\n            delete this clone\n        end\n    end\nend\n\nwhen I receive [defeat v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\n    change [pixelate v] effect by (10)\nend\ndelete this clone\n\nif <(costume [name v]) = [costume1]> then\nend\n\nwhen I start as a clone\nif <(loop) = [1]> then\n    hide\n    switch costume to (podoboosmw v)\n    broadcast (costume v)\n    wait (.2) seconds\n    point in direction (90)\n    go to x: (pick random (-240) to (240)) y: (-187)\n    show\n    set [fire vel v] to [1]\n    repeat until <(y position) > (pick random (0) to (-80))>\n        change [fire vel v] by (2)\n        change y by (Fire vel)\n    end\n    point in direction (-90)\n    repeat until <[0] > (Fire vel)>\n        change [fire vel v] by (-2)\n    end\n    set [fire vel v] to [0]\n    repeat until <[-155] > (y position)>\n        change [fire vel v] by (-2)\n        change y by (Fire vel)\n    end\n    delete this clone\nend\n\nwhen I receive [costume v]\nif <(costume [name v]) = [PodobooSMW]> then\n    set size to (20) %\n    forever\n        switch costume to (podoboosmw v)\n        wait (.1) seconds\n        switch costume to (podoboosmw2 v)\n        wait (.1) seconds\n    end\nend\n\n@Ending\n\nwhen flag clicked\nhide\nwait until <(Level) = [15]>\nswitch costume to (4 v)\nrepeat (4)\n    next costume\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\ngo to x: ((-68) + ((40) * ((costume [name v]) - (1)))) y: (-108)\nset [color v] effect to ((20) * ((costume [name v]) - (0)))\n\n@Last\n\nwhen flag clicked\nhide variable [☁ finished people without skips! :d v]\nhide variable [# skips v]\nhide\nwait until <(Level) = [15]>\nbroadcast (defeat v)\nshow variable [# skips v]\nshow\nif <(# SKIPS) = [0]> then\n    change [☁ finished people without skips! :d v] by (1)\n    show variable [☁ finished people without skips! :d v]\nend\n\n