Grassland - A scrolling Platformer || #scrolling || #Platformer

Instructions:                                  *Grassland*\n\n------>Arrow keys or mobile.\n\n------>Play this fun game.\n\n------>Love,fav, follow.\n\n#100 on trending (25/10/2020)\n#64 on trending (26/10/2020)\n3333 visits (9/11/2020)\n

@Stage\n\nwhen flag clicked\nforever\n    set [mouse v] to (join (join ((mouse x) + (Scroll x)) [,]) ((mouse x) + (Scroll x)))\n    set [mouse v] to (join (join ((mouse x) + (Scroll x)) [,]) ((mouse x) + (Scroll x)))\n    set [mouse v] to (join (join ((mouse x) + (Scroll x)) [,]) ((mouse x) + (Scroll x)))\n    set [mouse v] to (join (join ((mouse x) + (Scroll x)) [,]) ((mouse x) + (Scroll x)))\n    set [mouse v] to (join (join ((mouse x) + (Scroll x)) [,]) ((mouse x) + (Scroll x)))\n    set [mouse v] to (join (join ((mouse x) + (Scroll x)) [,]) ((mouse x) + (Scroll x)))\n    set [mouse v] to (join (join ((mouse x) + (Scroll x)) [,]) ((mouse x) + (Scroll x)))\n    set [mouse v] to (join (join ((mouse x) + (Scroll x)) [,]) ((mouse x) + (Scroll x)))\n    set [mouse v] to (join (join ((mouse x) + (Scroll x)) [,]) ((mouse x) + (Scroll x)))\n    set [mouse v] to (join (join ((mouse x) + (Scroll x)) [,]) ((mouse x) + (Scroll x)))\n    set [mouse v] to (join (join ((mouse x) + (Scroll x)) [,]) ((mouse x) + (Scroll x)))\n    set [mouse v] to (join (join ((mouse x) + (Scroll x)) [,]) ((mouse x) + (Scroll x)))\n    hide variable [mouse v]\n    hide variable [mouse v]\nend\n\n@Player\n\nwhen flag clicked\nforever\n    if <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n        switch costume to (up v)\n    else\n        switch costume to (normal v)\n    end\n    if <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>> then\n        switch costume to (right v)\n    end\n    if <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>> then\n        switch costume to (left v)\n    end\nend\n\nwhen flag clicked\nbroadcast (Green flag v) and wait\nbroadcast (Play game v) and wait\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    broadcast (reset v) and wait\n    broadcast (Setup v) and wait\n    Game on\n    repeat until <(Exit) > []>\n        Tick\n        broadcast (Tick v) and wait\n    end\n    if <(Exit) = [win]> then\n        Game - win\n    else\n        Game - die\n    end\nend\n\ndefine Game on\nset [x v] to [0]\nset [y v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\npoint in direction (90)\nset size to (30) %\nset [ghost v] effect to (0)\nshow\n\ndefine Tick\nif <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>> then\n    change [sx v] by (-4)\nend\nif <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>> then\n    change [sx v] by (4)\nend\nset [sx v] to ((SX) * (0.8))\nif <([abs v] of (SX) ) > [0.9]> then\n    Change Player x (round (SX))\nend\nif <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n    if <(In Air) < [4]> then\n        if <(JUMP) = [short]> then\n            set [sy v] to [14]\n        end\n        if <(JUMP) = [long]> then\n            set [sy v] to [20]\n        end\n    end\nend\nchange [sy v] by (-1)\nChange Player by (SY)\nTest - die\nset [scroll x v] to (x)\nif <(Scroll x) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (Scroll y)) / (10)))\nif <(Scroll y) < [0]> then\n    set [scroll y v] to [0]\nend\nPotition\nif <(y) < [-180]> then\n    set [exit v] to [die]\nend\n\ndefine Change Player by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPotition\nrepeat until <not <touching (platforms v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Potition\n    set [sy v] to [0]\nend\n\ndefine Potition\ngo to x: ((x) - (Scroll x)) y: ((y) - (Scroll y))\n\ndefine Change Player x (sx)\nchange [x v] by (sx)\nPotition\nif <touching (platforms v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Potition\n        if <not <touching (platforms v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n        if <(sx) > [0]> then\n            set [sx v] to [-16]\n        else\n            set [sx v] to [16]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (platforms v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Potition\n    end\nend\n\ndefine Game - die\nset [exit v] to []\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\n\ndefine Test - die\nif <touching (danger v)?> then\n    set [exit v] to [die]\nend\n\ndefine Game - win\nset [ghost v] effect to (100)\nhide\nchange [level v] by (1)\nwait (1) seconds\n\nwhen I receive [you win v]\nhide\n\n@Platforms\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPotition ((x) - (Scroll x)) ((y) - (Scroll y))\n\nwhen I receive [setup v]\nhide\nset [y v] to [0]\nset [x v] to [0]\nif <(Level) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at X [300] Y [0]\n    Clone at X [100] Y [300]\n    Clone at X [500] Y [300]\n    Clone at X [450] Y [130]\n    Clone at X [470] Y [120]\n    Clone at X [470] Y [120]\n    Clone at X [475] Y [125]\n    Clone at X [490] Y [140]\n    Clone at X [510] Y [140]\nend\n\ndefine Potition (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at X (x) Y (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [you win v]\nhide\n\n@ART Platform\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPotition ((x) - (Scroll x)) ((y) - (Scroll y))\n\nwhen I receive [setup v]\nhide\nset [y v] to [0]\nset [x v] to [0]\nif <(Level) = [1]> then\n    switch costume to (1 v)\n    Clone at X [300] Y [0]\n    Clone at X [100] Y [300]\n    Clone at X [500] Y [300]\n    Clone at X [505] Y [160]\n    Clone at X [450] Y [90]\n    Clone at X [470] Y [120]\n    Clone at X [475] Y [125]\n    Clone at X [470] Y [160]\n    Clone at X [490] Y [160]\n    Clone at X [350] Y [140]\nend\n\ndefine Potition (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at X (x) Y (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [you win v]\nhide\n\n@danger\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPotition ((x) - (Scroll x)) ((y) - (Scroll y))\n\nwhen I receive [setup v]\nhide\nset [y v] to [0]\nset [x v] to [0]\nif <(Level) = [1]> then\n    switch costume to (0 v)\n    Clone at X [2850] Y [1097]\nend\n\ndefine Potition (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at X (x) Y (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [you win v]\nhide\n\n@collectabels\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPotition ((x) - (Scroll x)) ((y) - (Scroll y))\nif <touching (player v)?> then\n    change [collected v] by (1)\n    if <(COLLECTED) = (Collected max)> then\n        broadcast (Open portal v)\n    end\n    delete this clone\nend\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [collected max v] to [0]\nset [y v] to [0]\nset [x v] to [0]\nif <(Level) = [1]> then\n    switch costume to (collectables v)\n    Clone at X [-208] Y [-3]\n    Clone at X [-168] Y [-3]\n    Clone at X [-128] Y [-3]\n    Clone at X [-88] Y [-3]\n    Clone at X [299] Y [197]\n    Clone at X [359] Y [333]\n    Clone at X [399] Y [333]\n    Clone at X [439] Y [333]\n    Clone at X [404] Y [411]\n    Clone at X [444] Y [411]\n    Clone at X [484] Y [411]\n    Clone at X [591] Y [506]\n    Clone at X [591] Y [546]\n    Clone at X [591] Y [586]\n    Clone at X [591] Y [626]\n    Clone at X [591] Y [666]\n    Clone at X [1157] Y [762]\n    Clone at X [1197] Y [782]\n    Clone at X [1237] Y [802]\n    Clone at X [1277] Y [822]\n    Clone at X [1317] Y [842]\n    Clone at X [1317] Y [842]\n    Clone at X [1357] Y [862]\n    Clone at X [1397] Y [882]\n    Clone at X [1437] Y [902]\n    Clone at X [1477] Y [922]\n    Clone at X [1517] Y [942]\n    Clone at X [1808] Y [838]\n    Clone at X [2022] Y [981]\n    Clone at X [2206] Y [968]\n    Clone at X [2246] Y [968]\n    Clone at X [2286] Y [968]\n    Clone at X [2326] Y [968]\n    Clone at X [2259] Y [1047]\n    Clone at X [2299] Y [1047]\n    Clone at X [2339] Y [1047]\n    Clone at X [2379] Y [1047]\n    Clone at X [2584] Y [1094]\n    Clone at X [2624] Y [1094]\n    Clone at X [2664] Y [1094]\n    Clone at X [2704] Y [1094]\n    Clone at X [2744] Y [1094]\n    Clone at X [2784] Y [1094]\n    Clone at X [2902] Y [1371]\n    Clone at X [2942] Y [1371]\n    Clone at X [2982] Y [1371]\n    Clone at X [3022] Y [1371]\n    Clone at X [2902] Y [1411]\n    Clone at X [2942] Y [1411]\n    Clone at X [2982] Y [1411]\n    Clone at X [3022] Y [1411]\n    Clone at X [2902] Y [1451]\n    Clone at X [2942] Y [1451]\n    Clone at X [2982] Y [1451]\n    Clone at X [3022] Y [1451]\n    Clone at X [3067] Y [1293]\n    Clone at X [3107] Y [1283]\n    Clone at X [3147] Y [1283]\nend\nset [x v] to [-99999]\n\ndefine Potition (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at X (x) Y (y)\nset [x v] to (x)\nset [y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\nwhen I receive [you win v]\nhide\n\nwhen flag clicked\nset size to (70) %\nforever\n    next costume\nend\n\nwhen I start as a clone\nforever\n    next costume\nend\n\n@  \n\nwhen flag clicked\ngo to x: (-198) y: (159)\nswitch costume to (0 v)\nset [collected v] to [0]\nset [number v] to [0]\nforever\n    set [number v] to (COLLECTED)\nend\n\nwhen flag clicked\nforever\n    switch costume to (letter (1) of (number))\nend\n\nwhen I receive [-20 v]\nchange [collected v] by (-20)\n\n@       \n\nwhen flag clicked\ngo to x: (-187) y: (159)\nhide\nswitch costume to (0 v)\nset [number v] to [0]\nforever\n    if <(length of (number)) > [1]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    switch costume to (letter (2) of (number))\nend\n\n@       2\n\nwhen flag clicked\ngo to x: (-176) y: (159)\nhide\nswitch costume to (0 v)\nset [collected v] to [0]\nset [number v] to [0]\nforever\n    if <(length of (number)) > [2]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    switch costume to (letter (3) of (number))\nend\n\n@       3\n\nwhen flag clicked\ngo to x: (-165) y: (159)\nhide\nswitch costume to (0 v)\nset [collected v] to [0]\nset [number v] to [0]\nforever\n    if <(length of (number)) > [3]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    switch costume to (letter (4) of (number))\nend\n\n@collectabels2\n\nwhen flag clicked\ngo to x: (-220) y: (160)\nforever\n    next costume\nend\n\n@shop (poster)\n\nwhen flag clicked\ngo to x: (-203) y: (-158)\nset size to (50) %\nset [ghost v] effect to (50)\nswitch costume to ( shop \(po s\) v)\nwait (1) seconds\nforever\n    go to [front v] layer\n    if <(costume [number v]) = [1]> then\n        if <touching (mouse-pointer v)?> then\n            set size to (60) %\n            set [ghost v] effect to (15)\n        else\n            set size to (50) %\n            set [ghost v] effect to (25)\n        end\n    end\n    if <(costume [number v]) = [2]> then\n        if <<not <touching (mouse-pointer v)?>> and <mouse down?>> then\n            go to x: (-203) y: (-158)\n            set size to (50) %\n            set [ghost v] effect to (50)\n            switch costume to ( shop \(po s\) v)\n            broadcast (shop out v)\n        end\n    end\nend\n\nwhen this sprite clicked\nswitch costume to ( shop v)\nset size to (100) %\ngo to x: (0) y: (0)\nset [ghost v] effect to (25)\nbroadcast (shop v)\nset [shop v] to [shop]\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [1]> then\n        set [shop v] to []\n    end\nend\n\n@Long jump\n\nwhen flag clicked\nhide\ngo to x: (24) y: (-9)\nswitch costume to (sell v)\n\nwhen I receive [shop v]\nshow\ngo to x: (24) y: (-9)\nforever\n    go to [front v] layer\nend\n\nwhen this sprite clicked\nif <(number) > [19]> then\n    switch costume to (bought v)\n    set [jump v] to [Large]\n    broadcast (-20 v)\n    broadcast (active v)\nend\n\nwhen flag clicked\nset [jump v] to [Short]\n\nwhen I receive [shop out v]\nhide\n\n@Long/short jump\n\nwhen flag clicked\nswitch costume to (short v)\ngo to x: (169) y: (-152)\nhide\nforever\n    if <(costume [name v]) = [short]> then\n        set [jump v] to [short]\n    end\n    if <(costume [name v]) = [long]> then\n        set [jump v] to [long]\n    end\nend\n\nwhen I receive [active v]\nswitch costume to (long v)\ngo to x: (169) y: (-152)\nshow\n\nwhen this sprite clicked\nnext costume\n\nchange [clone id v] by (1)\n\n@Thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    go to x: (0) y: (0)\n    go to [front v] layer\nend\n\n