Grassy-A mobile scrolling platformer

Instructions: The sequel to my project Lava Cave, our adventuer takes a stop at the grasslands. The grasslands are full of spikes and danger. Controls:arrow keys,was,or mobile.\nGoal:\nCollect all the coins on the level to open the door. If the door is closed,that means you haven't collected all the coins. If it is open,then you go in to advance to the next level. Spikes hurt though and it will make you restart,and you have to collect all the coins again\nIF YOU SEE A AD REPORT IT!\nALSO THE REASON THIS IS GENERIC IS BECAUSE MY UNGENERIC PLATFORMER GETS MUCH LESS LOVES THAN MY GENERICS

@Stage\n\n@Exit\n\nwhen I receive [green flag v]\nhide\n\nshow\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <<touching (player v)?> and <(portal open?) = [1]>> then\n    set [exit v] to [win]\nend\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    set [portal open? v] to [0]\n    switch costume to (costume1 v)\n    set [ghost v] effect to (40)\n    set [brightness v] effect to (-40)\n    Clone at x: [997] y: [255]\nelse\n    if <(LEVEL) = [2]> then\n        set [portal open? v] to [0]\n        set [ghost v] effect to (40)\n        set [brightness v] effect to (-40)\n        switch costume to (costume1 v)\n        Clone at x: [600] y: [-89]\n    else\n        if <(LEVEL) = [3]> then\n            set [portal open? v] to [0]\n            set [ghost v] effect to (40)\n            set [brightness v] effect to (-40)\n            Clone at x: [500] y: [-89]\n        else\n            if <(LEVEL) = [4]> then\n                set [portal open? v] to [0]\n                switch costume to (costume1 v)\n                set [brightness v] effect to (-40)\n                set [ghost v] effect to (40)\n                Clone at x: [-190] y: [200]\n            else\n                if <(LEVEL) = [5]> then\n                    Clone at x: [200] y: [580]\n                    switch costume to (costume1 v)\n                    set [brightness v] effect to (-40)\n                    set [ghost v] effect to (40)\n                    set [portal open? v] to [0]\n                else\n                    if <(LEVEL) = [6]> then\n                        Clone at x: [-40] y: [-20]\n                        switch costume to (costume1 v)\n                        set [portal open? v] to [0]\n                        set [brightness v] effect to (-40)\n                        set [ghost v] effect to (40)\n                    end\n                end\n            end\n        end\n    end\nend\n\nClone at x: [920] y: [-28]\n\ncreate clone of (_myself_ v)\n\nnext costume\nnext costume\n\ndefine Position (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)\n\nwhen I receive [open portal v]\nset [brightness v] effect to (5)\nset [ghost v] effect to (0)\nset [portal open? v] to [1]\nswitch costume to (costume2 v)\n\nhide\n\nswitch costume to (open v)\n\nwhen flag clicked\nforever\n\nnext costume\n\nClone at x: [] y: []\n\nClone at x: [200] y: [580]\n\nClone at x: [-190] y: [200]\n\nturn right (15) degrees\n\nset [brightness v] effect to (-40)\n\nswitch costume to (costume1 v)\n\nturn right (15) degrees\n\nturn left (15) degrees\n\ngo to (random position v)\n\ngo to (random position v)\n\nturn left (15) degrees\n\n@Player\n\nwhen flag clicked\nhide\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\nwait (4) seconds\nshow\n\nwhen I receive [green flag v]\n\ngo to [front v] layer\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    show\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)\n    end\n    if <(EXIT) = [win]> then\n        Game - Win\n    else\n        Game - Die\n    end\nend\n\nbroadcast (Tick v) and wait\n\ndefine Game On\nset [y v] to [0]\nset [x v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset [ghost v] effect to (0)\nset size to (100) %\n\nshow\n\ndefine Tick\nif <<<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <(left) = [1]>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [sx v] by (-2)\n    point in direction (-90)\nend\nif <<<mouse down?> and <(x position) < (mouse x)>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <(right) = [1]>>> then\n    change [sx v] by (2)\n    point in direction (90)\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <(up) = [1]>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    if <(in air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-2)\nend\nChange Player y 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\nPosition\nif <(y) < [-180]> then\n    set [exit v] to [die]\nend\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\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    Position\n    set [sy v] to [0]\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nif <touching (platforms v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\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 <key (w v) pressed?>> or <(mouse y) > (y position)>> 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        Position\n    end\nend\n\ndefine Game - Die\nset [exit v] to []\n\ndefine Test - Die\nif <touching (danger v)?> then\n    set [exit v] to [die]\nend\n\ndefine Game - Win\nrepeat (50)\n    move ((distance to [exit v]) / (2)) steps\n    point towards (exit v)\n    turn right (65) degrees\n    change size by (-1)\nend\nhide\nchange [level v] by (1)\nwait (1) seconds\n\nchange [ghost v] effect by (2)\n\ndefine Walk\n\nwhen I receive [walk v]\n\n\n\n\nwhen I receive [walk v]\n\nwhen flag clicked\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\nend\n\n\n\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    if <[3] < (costume [number v])> then\n        wait (0.1) seconds\n        next costume\n    else\n        switch costume to (walk 1 v)\n    end\nelse\n    switch costume to (idle v)\nend\n\nwhen flag clicked\nhide\n\nturn right (15) degrees\n\nwhen [r v] key pressed\nGame - Die\nset [exit v] to [DIE]\n\nrepeat (5)\n    hide\n    wait (.1) seconds\n    show\n    wait (0.1) seconds\nend\nwait (0.5) seconds\nhide\n\nwait (0.01) seconds\n\nwhen flag clicked\nwait (4) seconds\nforever\n    play sound [Distant-Mountains v] until done\nend\n\nplay sound [Distant-Mountains v] until done\n\nchange [pitch v] effect by (10)\n\nchange [pitch v] effect by (10)\n\nturn left (15) degrees\n\n@DANGER\n\nwhen I receive [green flag v]\nhide\n\nshow\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [630] y: [-30]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 v)\n            Clone at x: [800] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (4 v)\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (5 v)\n                    Clone at x: [300] y: [500]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (costume1 v)\n                    end\n                end\n            end\n        end\n    end\nend\n\nif <(LEVEL) = [5]> then\n    switch costume to (5 v)\nelse\nend\n\ndefine Position (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\nturn right (15) degrees\n\n@Platforms\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [0] y: [0]\n        Clone at x: [300] y: [0]\n        Clone at x: [530] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (amon v)\n            Clone at x: [300] y: []\n            Clone at x: [500] y: []\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 v)\n                Clone at x: [300] y: []\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5 v)\n                    Clone at x: [500] y: []\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (ending v)\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Position (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\nnext costume\nnext costume\n\ncreate clone of (_myself_ v)\n\nClone at x: [500] y: []\n\nturn right (15) degrees\n\n@Collectables\n\nwhen I receive [green flag v]\nhide\n\nshow\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    change [collected v] by (1)\n    broadcast (collect v)\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 max v] to [0]\nset [collected v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    Clone at x: [80] y: [0]\n    Clone at x: [240] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [570] y: [6]\nelse\n    if <(LEVEL) = [2]> then\n        Clone at x: [380] y: [60]\n        Clone at x: [-109] y: [120]\n        Clone at x: [240] y: [60]\n        Clone at x: [140] y: [60]\n        Clone at x: [0] y: [650]\n    else\n        if <(LEVEL) = [3]> then\n            Clone at x: [890] y: [200]\n            Clone at x: [1200] y: [180]\n            Clone at x: [280] y: [-100]\n        else\n            if <(LEVEL) = [4]> then\n                Clone at x: [220] y: [120]\n                Clone at x: [240] y: [-20]\n                Clone at x: [420] y: [120]\n                Clone at x: [420] y: [320]\n                Clone at x: [200] y: [400]\n                Clone at x: [-100] y: [600]\n            else\n                if <(LEVEL) = [5]> then\n                    Clone at x: [-150] y: [0]\n                end\n            end\n        end\n    end\n    set [x v] to [-9999999999]\nend\nset [x v] to [-9999999999]\n\ncreate clone of (_myself_ v)\n\nnext costume\nnext costume\n\ndefine Position (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\nswitch costume to (dot v)\n\nswitch costume to (dot v)\n\nwhen flag clicked\n\nwhen I start as a clone\nshow\nset size to (100) %\nforever\n    repeat (10)\n        change size by (1)\n        wait (0.1) seconds\n    end\n    repeat (10)\n        change size by (-1)\n        wait (0.1) seconds\n    end\nend\n\nClone at x: [25] y: [10]\n\nClone at x: [-100] y: [750]\n\nClone at x: [-120] y: [750]\n\nClone at x: [-109] y: [40]\n\nClone at x: [220] y: [90]\n\nClone at x: [170] y: [150]\nClone at x: [30] y: [200]\n\nClone at x: [-50] y: [-20]\n\nClone at x: [220] y: [120]\nClone at x: [240] y: [-20]\nClone at x: [420] y: [120]\nClone at x: [420] y: [320]\nClone at x: [200] y: [400]\nClone at x: [-100] y: [600]\n\nwhen I start as a clone\nshow\nset size to (100) %\nforever\n    next costume\n    wait (0.1) seconds\nend\n\nchange size by (1)\n\nchange size by (-1)\n\nrepeat (10)\n    wait (0.1) seconds\n    change x by (1)\nend\nrepeat (10)\n    wait (0.1) seconds\n    change x by (-1)\nend\n\nwhen I receive [collect v]\nplay sound [Coin v] until done\n\nturn left (15) degrees\n\nturn right (15) degrees\nturn right (15) degrees\n\n@Sprite1\n\nwhen flag clicked\nshow\nwait (1) seconds\nhide\n\nmove (10) steps\n\n@Sprite2\n\nwhen flag clicked\nchange [color v] effect by (25)\n\nwhen flag clicked\nshow\nwait (1) seconds\nhide\n\nswitch backdrop to (backdrop2 v)\n\n@gSSSrFvjUzkvmxmeMYjyJ5\n\nwhen flag clicked\nhide\nwait (1) seconds\nshow\nswitch costume to (gsssrfvjuzkvmxmemyjyj5 v)\nrepeat (36)\n    next costume\n    wait (0.1) seconds\nend\nhide\n\n@Sprite6\n\nwhen flag clicked\nhide\nwait (2) seconds\nshow\ngo to [front v] layer\nwait (0.5) seconds\ncreate clone of (_myself_ v)\nwait (3) seconds\nhide\n\nwhen I start as a clone\nchange [color v] effect by (25)\nswitch costume to (costume2 v)\nwait (3) seconds\nhide\n\n