Plains! #Platformer #Games

Instructions: Hey guys! It's me @-TechnoCoder- (Ashish)!\nDidn't Played part 1?\nPlay here: https://scratch.mit.edu/projects/493290168/\nPart-3 is Out Play Here: https://scratch.mit.edu/projects/510810848/\nSo a lot of you guys asked for the grasslands part 2. Well, here it is! Plains A Platformer! It took me 2 days to make it!\n-INSTRUCTIONS-\n↪Works With W, A, S, D, and Arrow Keys!\n↪It's Not Mobile-friendly lol\n↪Same Instructions as Greenlands!\n\n-CREDITS-\n↪Code: All Code is by me!\n↪ Art: All art is by me!\n↪Music: From #Youtube\n↪Music By #AlanWalker #theSpecter\n\n-TAGS-\n#Plains #Platformer #games #-TechnoCoder-\n #Youtube #AlanWalker  #theSpecter\n\n\n\n

@Stage\n\ngo to [front v] layer\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\n@Player\n\nwhen flag clicked\n\nwhen I receive [next!:\) v]\ngo to x: (-223) y: (-49)\n\nwhen flag clicked\nforever\n    if <key (r v) pressed?> then\n        Reset\n    end\n    if <touching (spikes v)?> then\n        Reset\n    end\nend\n\ndefine Reset\ngo to x: (-223) y: (-49)\nstart sound [Death v]\n\nwhen flag clicked\ngo to [front v] layer\nset [xvel v] to [0]\nset [yvel v] to [0]\nset [level v] to [1]\nforever\n    if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>>> then\n        if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n            change [xvel v] by (1)\n            switch costume to (2a v)\n        end\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n            change [xvel v] by (-1)\n            switch costume to (1a v)\n        end\n    else\n        switch costume to (3a v)\n    end\n    set [xvel v] to ((Xvel) * (0.9))\n    change x by (Xvel)\n    if <touching (platform v)?> then\n        change y by (1)\n        if <touching (platform v)?> then\n            change y by (1)\n            if <touching (platform v)?> then\n                change y by (1)\n                if <touching (platform v)?> then\n                    change y by (1)\n                    if <touching (platform v)?> then\n                        change y by (1)\n                        if <touching (platform v)?> then\n                            change x by ((Xvel) * (-1))\n                            change y by (-5)\n                            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<key (space v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n                                if <(Xvel) > [0]> then\n                                    set [xvel v] to [-5]\n                                else\n                                    set [xvel v] to [5]\n                                end\n                                set [xvel v] to [10]\n                            else\n                                set [xvel v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yvel v] by (-1)\n    change y by (Yvel)\n    if <touching (platform v)?> then\n        change y by ((Yvel) * (-1))\n        set [yvel v] to [0]\n    end\n    change y by (-1)\n    if <<touching (platform v)?> and <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<key (space v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>> then\n        set [yvel v] to [12]\n        switch costume to (6a v)\n    end\n    change y by (1)\n    if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> and <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<key (space v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>> then\n        switch costume to (4a v)\n    end\n    if <<<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> and <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<key (space v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>>> then\n        switch costume to (5a v)\n    end\n    if <(x position) > [234]> then\n        broadcast (next!:\) v)\n        change [level v] by (1)\n    end\nend\n\nwhen flag clicked\nplay sound [Alan Walker - The Spectre v] until done\ngo to x: (-161) y: (5)\nset [xvel v] to [0]\nset [yvel v] to [0]\nset [level v] to [1]\n\n@Spikes\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(Level) = [2]> then\n        show\n        go to x: (-37) y: (0)\n        switch costume to (7 v)\n    end\n    if <(Level) = [3]> then\n        show\n        go to x: (-31) y: (4)\n        switch costume to (8 v)\n    end\n    if <(Level) = [4]> then\n        show\n        go to x: (-25) y: (5)\n        switch costume to (2 v)\n    end\n    if <(Level) = [5]> then\n        hide\n    end\n    if <(Level) = [6]> then\n        show\n        go to x: (-25) y: (5)\n        switch costume to (17 v)\n    end\n    if <(Level) = [6]> then\n        show\n        go to x: (-52) y: (6)\n        switch costume to (22 v)\n    end\n    if <(Level) = [7]> then\n        hide\n    end\nend\n\n@detector\n\nwhen flag clicked\nhide\nset [faved___ v] to [0]\nset [loved__ v] to [0]\nset [clone id v] to [0]\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nwait until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\nwait (1) seconds\nshow\ngo to x: (0) y: (50)\nreset timer\nswitch costume to (pick random (1) to (4))\nset [ghost v] effect to (100)\nrepeat until <(timer) > [3.5]>\n    change y by ((y position) / (-15))\n    change [ghost v] effect by (-3)\nend\nreset timer\nrepeat until <(timer) > [3.5]>\n    change y by (((y position) - (-100)) / (-15))\n    change [ghost v] effect by (10)\nend\n\nwhen I start as a clone\nif <(clone id) = [0]> then\n    go to x: (-15) y: (0)\n    set [loved__ v] to [0]\n    switch costume to (love v)\n    forever\n        set [love? v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [loved__ v] to [1]\n        end\n    end\nend\nif <(clone id) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (fave v)\n    set [faved___ v] to [0]\n    forever\n        set [fav v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [faved___ v] to [1]\n        end\n    end\nend\n\n@notif\n\nwhen flag clicked\ngo to x: (0) y: (50)\nhide\nwait (pick random (2) to (10)) seconds\nshow\nrepeat until <(y position) < [6]>\n    change y by (((5) - (y position)) / (6))\nend\nwait (3.5) seconds\nrepeat until <(y position) > [49.5]>\n    change y by (((y position) + (5)) / (5))\nend\nhide\nforever\n    wait (pick random (14) to (26)) seconds\n    show\n    repeat until <(y position) < [6]>\n        change y by (((5) - (y position)) / (6))\n    end\n    wait (3.5) seconds\n    repeat until <(y position) > [49.5]>\n        change y by (((y position) + (5)) / (5))\n    end\n    hide\nend\n\nwhen I receive [alert v]\nstop [other scripts in sprite v]\nrepeat (5)\n    change [ghost v] effect by (20)\nend\nhide\n\nwhen I receive [tick v]\ngo to [front v] layer\n\n@Clouds\n\nwhen flag clicked\nset [ghost v] effect to (50)\nforever\n    wait (2) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\ngo to [back v] layer\ngo to x: (200) y: (pick random (50) to (180))\nshow\nrepeat until <(x position) < [-200]>\n    change x by (-3)\n    if <<([costume name v] of [platform v]) > [6]> and <([costume name v] of [platform v]) < [11]>> then\n        hide\n        delete this clone\n    end\nend\nrepeat (10)\n    hide\n    delete this clone\nend\nif <(Level) = [8]> then\n    forever\n        hide\n    end\nend\n\n@Platform\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (1 v)\n\nwhen I receive [next!:\) v]\nforever\n    switch costume to (Level)\nend\n\n