Grasslands (Platformer)

Instructions: /* Thankyou all for 300+ views :) */\n======Controls=====\n*W/A/S/D or Arrow keys to move\n*It is mobile friendly\n*If you touch spikes you die\n*Jump on trampoline to go up faster

@Stage\n\nwhen flag clicked\nforever\n    play sound [Nebula v] until done\nend\n\n@Thumbnail \n\nwhen I receive [cmon let’s go v]\nset [ghost v] effect to (100)\nforever\n    set [tm v] to ((timer) + (0.0000000000000000000000000000000000000000000000001))\nend\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nshow\ngo to [front v] layer\n\n@platform\n\nset [level v] to [17]\n\nwhen [timer v] > (Tm)\nhide\n\nwhen I receive [cmon let’s go v]\ngo [forward v] (1) layers\ngo to [back v] layer\nshow\nswitch costume to (lvl v)\nforever\n    switch costume to (((22) * (((Level) / (1)) + ((Level) * ((Level) - (Level))))) / (22))\n    go to x: (0) y: (-25)\nend\n\nwhen flag clicked\nhide\n\n@Player\n\nwhen I start as a clone\nswitch costume to (player v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-3)\n    wait (0) seconds\nend\ndelete this clone\n\ndefine Refresh \nset [x vel v] to [0]\nset [yvel v] to [0]\nset size to (75) %\npoint in direction (90)\n\nwhen I receive [return v]\nset [x v] to [-211]\nset [y v] to [-37]\nbroadcast (Ohhh v)\n\nwhen [timer v] > (Tm)\nhide\n\nwhen I receive [ohhh v]\ngo to x: (X) y: (Y)\n\nwhen I receive [cmon let’s go v]\nshow\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I receive [cmon let’s go v]\nbroadcast (Return v)\nRefresh \nswitch costume to (costume1 v)\ngo to [front v] layer\nset [level v] to [1]\nforever\n    change [yvel v] by (-1)\n    if <<key (d v) pressed?> or <<key (right arrow v) pressed?> or <<(x position) < (mouse x)> and <mouse down?>>>> then\n        change [x vel v] by (0.8)\n    end\n    if <<key (a v) pressed?> or <<key (left arrow v) pressed?> or <<(x position) > (mouse x)> and <mouse down?>>>> then\n        change [x vel v] by (-0.8)\n    end\n    set [x vel v] to ((X vel) * (0.9))\n    change x by (X vel)\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                        change x by ((X vel) * (-1))\n                        change y by (-5)\n                        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(y position) < (mouse y)> and <mouse down?>>>> then\n                            set [yvel v] to [12.5]\n                            if <(X vel) > [0]> then\n                                set [x vel v] to [-7.5]\n                            else\n                                set [x vel v] to [7.5]\n                            end\n                        else\n                            set [x vel v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\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)?> then\n        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(y position) < (mouse y)> and <mouse down?>>>> then\n            set [yvel v] to [14]\n        end\n    end\n    change y by (1)\n    if <(x position) > [239]> then\n        go to x: (-211) y: (-37)\n        change [level v] by (1)\n        Refresh \n        broadcast (Next level v)\n    end\n    if <<<touching (spikes v)?> or <(y position) = [-185]>> or <touching (crush v)?>> then\n        repeat (10)\n            change size by (-5)\n            wait (0.01) seconds\n        end\n        wait (0.1) seconds\n        set [x vel v] to [0]\n        set [yvel v] to [0]\n        broadcast (Return v)\n        repeat (10)\n            change size by (5)\n            wait (0.01) seconds\n        end\n    end\n    if <touching (trampoline  v)?> then\n        set [yvel v] to [22.5]\n        broadcast (Tj v)\n    end\n    if <touching (boost right v)?> then\n        change [x vel v] by (7.5)\n    end\n    if <touching (boost left v)?> then\n        change [x vel v] by (-7.5)\n    end\n    if <touching (water v)?> then\n        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(y position) < (mouse y)> and <mouse down?>>>> then\n            set [yvel v] to [5]\n        else\n            set [yvel v] to [-3]\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\n@Spikes\n\nwhen [timer v] > (Tm)\nhide\n\nwhen I receive [cmon let’s go v]\nshow\nswitch costume to (lvl v)\ngo to [back v] layer\nforever\n    switch costume to (((22) * (((Level) / (1)) + ((Level) * ((Level) - (Level))))) / (22))\nend\n\nwhen flag clicked\nhide\n\n@Down\n\nwhen [timer v] > (Tm)\nhide\n\nwhen I receive [cmon let’s go v]\nshow\ngo [forward v] (1) layers\ngo to [front v] layer\ngo to x: (-191) y: (139)\nforever\n    if <<key (down arrow v) pressed?> or <<key (s v) pressed?> or <<mouse down?> and <([y position v] of [player v]) > (mouse y)>>>> then\n        switch costume to (yes v)\n    else\n        switch costume to (no v)\n    end\nend\n\nwhen flag clicked\nhide\n\n@Left\n\nwhen [timer v] > (Tm)\nhide\n\nwhen I receive [cmon let’s go v]\nforever\n    go to x: (([x position v] of [down v]) - (25)) y: ([y position v] of [down v])\nend\n\nwhen I receive [cmon let’s go v]\nshow\ngo [forward v] (1) layers\ngo to [front v] layer\nforever\n    if <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <([x position v] of [player v]) > (mouse x)>>>> then\n        switch costume to (yes v)\n    else\n        switch costume to (no v)\n    end\nend\n\nwhen flag clicked\nhide\n\n@Right\n\nwhen [timer v] > (Tm)\nhide\n\nwhen I receive [cmon let’s go v]\nforever\n    go to x: (([x position v] of [down v]) + (25)) y: ([y position v] of [down v])\nend\n\nwhen I receive [cmon let’s go v]\nshow\ngo [forward v] (1) layers\ngo to [front v] layer\nforever\n    if <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > ([x position v] of [player v])>>>> then\n        switch costume to (yes v)\n    else\n        switch costume to (no v)\n    end\nend\n\nwhen flag clicked\nhide\n\n@Up\n\nwhen [timer v] > (Tm)\nhide\n\nwhen I receive [cmon let’s go v]\nshow\ngo [forward v] (1) layers\ngo to [front v] layer\nforever\n    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > ([y position v] of [player v])>>>> then\n        switch costume to (yes v)\n    else\n        switch costume to (no v)\n    end\nend\n\nwhen I receive [cmon let’s go v]\nforever\n    go to x: ([x position v] of [down v]) y: (([y position v] of [down v]) + (25))\nend\n\nwhen flag clicked\nhide\n\n@Shadows\n\nwhen [timer v] > (Tm)\nhide\n\nwhen I receive [cmon let’s go v]\nshow\ngo to [back v] layer\nswitch costume to (lvl2 v)\nforever\n    set [ghost v] effect to (50)\n    switch costume to (((Level) + (Level)) - (Level))\nend\n\nwhen flag clicked\nhide\n\n@Trampoline \n\ndefine If <\(level\)> Then position (x) (y) Hide lock (yes or no)\nif <\(level\)> then\n    go to x: (x) y: (y)\n    if <(yes or no) = [On]> then\n        hide\n    else\n        show\n    end\nend\n\nwhen I receive [tj v]\nswitch costume to (trampoline  v)\nrepeat (5)\n    next costume\n    wait (0.01) seconds\nend\n\nset [level v] to [8]\n\nwhen [timer v] > (Tm)\nhide\n\nwhen I receive [cmon let’s go v]\nswitch costume to (trampoline  v)\nforever\n    go [backward v] (1) layers\n    If <(Level) = [1]> Then position [0] [0] Hide lock [On]\n    If <(Level) = [2]> Then position [0] [0] Hide lock [On]\n    If <(Level) = [3]> Then position [0] [0] Hide lock [On]\n    If <(Level) = [4]> Then position [0] [0] Hide lock [On]\n    If <(Level) = [5]> Then position [0] [0] Hide lock [On]\n    If <(Level) = [6]> Then position [0] [0] Hide lock [On]\n    If <(Level) = [7]> Then position [0] [0] Hide lock [On]\n    If <(Level) = [8]> Then position [-25] [-88] Hide lock [Off]\n    If <(Level) = [9]> Then position [0] [0] Hide lock [On]\n    If <(Level) = [10]> Then position [-50] [-88] Hide lock [Off]\n    If <(Level) = [11]> Then position [] [] Hide lock [On]\n    If <(Level) = [12]> Then position [100] [-88] Hide lock [Off]\n    If <(Level) = [13]> Then position [] [] Hide lock [On]\n    If <(Level) = [14]> Then position [] [] Hide lock [On]\n    If <(Level) = [15]> Then position [] [] Hide lock [On]\n    If <(Level) = [16]> Then position [] [] Hide lock [On]\n    If <(Level) = [17]> Then position [] [] Hide lock [On]\n    If <(Level) = [18]> Then position [] [] Hide lock [On]\n    If <(Level) = [19]> Then position [] [] Hide lock [On]\n    If <(Level) = [20]> Then position [] [] Hide lock [On]\nend\n\n@Boost right\n\ndefine If <level> Then position at x: (x) Y: (y) Hide lock (on or off)\nif <level> then\n    go to x: (x) y: (y)\n    if <(on or off) = [On]> then\n        hide\n    else\n        show\n    end\nend\n\nwhen [timer v] > (Tm)\nhide\n\nwhen I receive [cmon let’s go v]\nforever\n    If <(Level) = [1]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [2]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [3]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [4]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [5]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [6]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [7]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [8]> Then position at x: [90] Y: [-88] Hide lock [Off]\n    If <(Level) = [9]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [10]> Then position at x: [25] Y: [150] Hide lock [Off]\n    If <(Level) = [11]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [12]> Then position at x: [50] Y: [-88] Hide lock [Off]\n    If <(Level) = [13]> Then position at x: [-50] Y: [38] Hide lock [Off]\n    If <(Level) = [14]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [15]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [16]> Then position at x: [90] Y: [-88] Hide lock [On]\n    If <(Level) = [17]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [18]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [19]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [20]> Then position at x: [90] Y: [-88] Hide lock [Off]\nend\n\n@Boost left\n\ndefine If <level> Then position at x: (x) Y: (y) Hide lock (on or off)\nif <level> then\n    go to x: (x) y: (y)\n    if <(on or off) = [On]> then\n        hide\n    else\n        show\n    end\nend\n\nwhen [timer v] > (Tm)\nhide\n\nwhen I receive [cmon let’s go v]\nforever\n    If <(Level) = [1]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [2]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [3]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [4]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [5]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [6]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [7]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [8]> Then position at x: [-90] Y: [-88] Hide lock [Off]\n    If <(Level) = [9]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [10]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [11]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [12]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [13]> Then position at x: [100] Y: [-88] Hide lock [Off]\n    If <(Level) = [14]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [15]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [16]> Then position at x: [90] Y: [-88] Hide lock [On]\n    If <(Level) = [17]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [18]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [19]> Then position at x: [] Y: [] Hide lock [On]\n    If <(Level) = [20]> Then position at x: [90] Y: [-88] Hide lock [Off]\nend\n\n@Sun\n\nwhen [timer v] > (Tm)\nhide\n\nwhen I receive [cmon let’s go v]\nset size to (75) %\nshow\nforever\n    go to [back v] layer\nend\n\nwhen I receive [cmon let’s go v]\nforever\n    if <(Level) = [17]> then\n        hide\n    else\n        show\n    end\nend\n\nwhen flag clicked\ngo to x: (195) y: (136)\nhide\n\nwhen I receive [cmon let’s go v]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset [ghost v] effect to (52)\nset size to (25) %\nforever\n    change size by ((0) + ((10) * ([cos v] of (((timer) - (3)) * (200)) )))\nend\n\n@Crush\n\nwhen [timer v] > (Tm)\nhide\n\nwhen I receive [cmon let’s go v]\ngo to x: (36) y: (100)\nforever\n    if <(Level) = [12]> then\n        show\n        repeat until <(Level) = [13]>\n            repeat (10)\n                change y by (-15)\n            end\n            wait (1) seconds\n            repeat (10)\n                change y by (15)\n            end\n            wait (1) seconds\n            if <[12] < (Level)> then\n                hide\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Water\n\nwhen [timer v] > (Tm)\nhide\n\nwhen I start as a clone\nnext costume\ngo to x: (0) y: ((y position) + (pick random (10) to (20)))\npoint in direction (90)\nforever\n    change y by ([sin v] of ((timer) * (250)) )\nend\n\nwhen I receive [cmon let’s go v]\ngo to x: (0) y: (-10)\nshow\nswitch costume to (1 v)\nreset timer\npoint in direction (90)\ngo [backward v] (1) layers\ngo to [back v] layer\nforever\n    switch costume to (((Level) + (Level)) - (Level))\n    repeat (10)\n        change y by (1)\n        wait (0.01) seconds\n    end\n    repeat (10)\n        change y by (-1)\n        wait (0.01) seconds\n    end\nend\n\nwhen I receive [cmon let’s go v]\nrepeat (2)\n    create clone of (_myself_ v)\nend\nforever\n    change y by ([sin v] of ((timer) * (200)) )\nend\n\n@Skip\n\nwhen [timer v] > (Tm)\nhide\n\nwhen this sprite clicked\nchange [level v] by (1)\nset [x vel v] to [0]\nset [yvel v] to [0]\nset [x v] to [-211]\nset [y v] to [-37]\nbroadcast (Ohhh v)\n\nwhen I receive [cmon let’s go v]\ngo to x: (-108) y: (142)\nshow\nforever\n    repeat (100)\n        change y by (([sin v] of ((timer) * (250)) ) * (1))\n    end\n    go to x: (-108) y: (142)\n    wait (0.01) seconds\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [cmon let’s go v]\nforever\n    if <(Level) = [17]> then\n        hide\n    else\n        show\n    end\nend\n\n@Reset\n\nwhen [timer v] > (Tm)\nhide\n\nwhen this sprite clicked\nset [x vel v] to [0]\nset [yvel v] to [0]\nset [x v] to [-211]\nset [y v] to [-37]\nbroadcast (Ohhh v)\n\nwhen I receive [cmon let’s go v]\ngo to x: (-24) y: (152)\nshow\nforever\n    repeat (100)\n        change y by ((([sin v] of ((timer) * (250)) ) * (-1)) * (1))\n    end\n    go to x: (-24) y: (152)\n    wait (0.01) seconds\nend\n\nwhen flag clicked\nhide\n\n@Start\n\nwhen flag clicked\ngo to x: (0) y: (-50)\ngo to [back v] layer\nclear graphic effects\nshow\npoint in direction (90)\nforever\n    repeat (10)\n        turn right (1) degrees\n    end\n    repeat (20)\n        turn left (1) degrees\n    end\n    repeat (10)\n        turn right (1) degrees\n    end\nend\n\nwhen this sprite clicked\nbroadcast (Cmon let’s go v)\nhide\n\nwhen flag clicked\nforever\n    change y by ([sin v] of ((timer) * (250)) )\nend\n\n@Back\n\nwhen I start as a clone\ngo to [back v] layer\ngo to x: (-240) y: (pick random (-240) to (240))\nset [ghost v] effect to (pick random (70) to (90))\nset size to (pick random (75) to (125)) %\nswitch costume to (pick random (1) to (4))\npoint in direction (pick random (-180) to (180))\nshow\nglide (2) secs to x: (240) y: (pick random (-240) to (240))\ndelete this clone\n\nwhen I receive [cmon let’s go v]\nhide\nforever\n    create clone of (_myself_ v)\nend\n\n