Grassland - A Platformer (Mobile Friendly)

Instructions: [Arrow Keys] or [WASD] - Move\n[P] - Skip Level\nSprings are bouncy, and Spikes are deadly. 

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop2 v)\n\nwhen I receive [before start v]\nswitch backdrop to (backdrop1 v)\nforever\n    play sound [Nebula v] until done\nend\n\nwhen I receive [before start v]\nforever\n    play sound [Sounds of the Boreal Forest.mp3 v] until done\nend\n\n@guy\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\ngo to (guy v)\nswitch costume to (eye v)\ngo [forward v] (1) layers\nset rotation style [left-right v]\nforever\n    point towards (guy v)\n    move ((distance to [guy v]) / (0.7)) steps\n    if <(ded) = [1]> then\n        hide\n    else\n        show\n    end\n    if <<<(x) = [0]> or <(x) > [0]>> and <(x) < [0.1]>> then\n        point in direction (90)\n    end\nend\n\ndefine xcoll\nrepeat until <not <touching (levels v)?>>\n    if <(x) > [0]> then\n        change x by (-1)\n    else\n        change x by (1)\n    end\nend\n\ndefine ycoll\nrepeat until <not <touching (levels v)?>>\n    if <(y) > [0]> then\n        change y by (-1)\n    else\n        change y by (1)\n    end\nend\n\nwhen I receive [before start v]\nset [ded v] to [0]\nclear graphic effects\nswitch costume to (guy v)\ncreate clone of (_myself_ v)\npoint in direction (90)\ngo to x: (-210) y: (-70)\nset rotation style [left-right v]\nset [x v] to [0]\nset [y v] to [0]\nshow\nforever\n    change [y v] by (-1)\n    if <<<mouse down?> and <(mouse x) > ([x position v] of [guy v])>> or <<key (d v) pressed?> or <key (right arrow v) pressed?>>> then\n        change [x v] by (1)\n    end\n    if <<<mouse down?> and <(mouse x) < ([x position v] of [guy v])>> or <<key (a v) pressed?> or <key (left arrow v) pressed?>>> then\n        change [x v] by (-1)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching (levels v)?> then\n        change y by (1)\n        if <touching (levels v)?> then\n            change y by (1)\n            if <touching (levels v)?> then\n                change y by (1)\n                if <touching (levels v)?> then\n                    change y by (1)\n                    if <touching (levels v)?> then\n                        change y by (1)\n                        if <touching (levels v)?> then\n                            change y by (1)\n                            if <touching (levels v)?> then\n                                change y by (-6)\n                                xcoll\n                                if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ([y position v] of [guy v])>>> then\n                                    set [y v] to [11]\n                                    if <([abs v] of (x) ) = (x)> then\n                                        set [x v] to [-8]\n                                    else\n                                        set [x v] to [8]\n                                    end\n                                else\n                                    set [x v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (y)\n    if <touching (levels v)?> then\n        ycoll\n        if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ([y position v] of [guy v])>>> and <(y) < [0]>> then\n            set [y v] to [13]\n        else\n            set [y v] to [0]\n        end\n    end\n    if <(x position) > [220]> then\n        broadcast (done v)\n        set [y v] to [0]\n        set [x v] to [0]\n        wait (1) seconds\n        go to x: (-210) y: (-70)\n    end\n    if <touching (spikes v)?> then\n        set [ded v] to [1]\n        switch costume to (fake v)\n        broadcast (death v)\n        start sound [Crunch v]\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        wait (1.5) seconds\n        go to x: (-210) y: (-70)\n        clear graphic effects\n        wait (.5) seconds\n        switch costume to (guy v)\n        set [y v] to [0]\n        set [x v] to [0]\n        set [ded v] to [0]\n    end\n    if <touching (bouncies v)?> then\n        set [y v] to [20]\n    end\nend\n\nwhen I receive [before start v]\nforever\n    if <<key (p v) pressed?> and <not <([costume # v] of [levels v]) = [16]>>> then\n        start sound [Teleport normal v]\n        broadcast (done v)\n        set [y v] to [0]\n        set [x v] to [0]\n        wait (1) seconds\n        go to x: (-210) y: (-70)\n        wait until <not <key (p v) pressed?>>\n    end\nend\n\n@Levels\n\nwhen flag clicked\nhide\n\nwhen I receive [done v]\nwait (1) seconds\nnext costume\n\nwhen I receive [before start v]\nshow\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\n\n@Spikes\n\nwhen flag clicked\nhide\n\nwhen I receive [done v]\nwait (1) seconds\nnext costume\n\nwhen I receive [before start v]\nshow\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\n\n@Deco\n\nwhen flag clicked\nhide\n\nwhen I receive [before start v]\nshow\nswitch costume to (costume1 v)\ngo to [front v] layer\nforever\n    go to x: (0) y: (0)\nend\n\nwhen I receive [done v]\nwait (1) seconds\nnext costume\n\n@Bouncies\n\nwhen I start as a clone\nif <(id) = [0]> then\n    switch costume to (costume1 v)\n    show\n    set size to (150) %\n    go to x: (60) y: (-82)\n    point in direction (90)\n    forever\n        if <touching (guy v)?> then\n            start sound [Boing v]\n            repeat (2)\n                next costume\n                wait (0.05) seconds\n            end\n            switch costume to (costume2 v)\n            wait (0.05) seconds\n            switch costume to (costume1 v)\n            wait (0.05) seconds\n            wait until <not <touching (guy v)?>>\n        end\n        if <not <([costume # v] of [levels v]) = [6]>> then\n            delete this clone\n        end\n    end\nend\n\nwhen I start as a clone\nif <(id) = [4]> then\n    switch costume to (costume1 v)\n    show\n    set size to (150) %\n    go to x: (-150) y: (-82)\n    point in direction (90)\n    forever\n        if <touching (guy v)?> then\n            start sound [Boing v]\n            repeat (2)\n                next costume\n                wait (0.05) seconds\n            end\n            switch costume to (costume2 v)\n            wait (0.05) seconds\n            switch costume to (costume1 v)\n            wait (0.05) seconds\n            wait until <not <touching (guy v)?>>\n        end\n        if <not <([costume # v] of [levels v]) = [8]>> then\n            delete this clone\n        end\n    end\nend\n\nwhen I start as a clone\nif <(id) = [5]> then\n    switch costume to (costume1 v)\n    show\n    set size to (150) %\n    go to x: (110) y: (-82)\n    point in direction (90)\n    forever\n        if <touching (guy v)?> then\n            start sound [Boing v]\n            repeat (2)\n                next costume\n                wait (0.05) seconds\n            end\n            switch costume to (costume2 v)\n            wait (0.05) seconds\n            switch costume to (costume1 v)\n            wait (0.05) seconds\n            wait until <not <touching (guy v)?>>\n        end\n        if <not <([costume # v] of [levels v]) = [8]>> then\n            delete this clone\n        end\n    end\nend\n\nwhen I start as a clone\nif <(id) = [6]> then\n    switch costume to (costume1 v)\n    show\n    set size to (150) %\n    go to x: (-150) y: (-82)\n    point in direction (90)\n    forever\n        if <touching (guy v)?> then\n            start sound [Boing v]\n            repeat (2)\n                next costume\n                wait (0.05) seconds\n            end\n            switch costume to (costume2 v)\n            wait (0.05) seconds\n            switch costume to (costume1 v)\n            wait (0.05) seconds\n            wait until <not <touching (guy v)?>>\n        end\n        if <not <([costume # v] of [levels v]) = [9]>> then\n            delete this clone\n        end\n    end\nend\n\nwhen I start as a clone\nif <(id) = [7]> then\n    switch costume to (costume1 v)\n    show\n    set size to (150) %\n    go to x: (-30) y: (23)\n    point in direction (90)\n    forever\n        if <touching (guy v)?> then\n            start sound [Boing v]\n            repeat (2)\n                next costume\n                wait (0.05) seconds\n            end\n            switch costume to (costume2 v)\n            wait (0.05) seconds\n            switch costume to (costume1 v)\n            wait (0.05) seconds\n            wait until <not <touching (guy v)?>>\n        end\n        if <not <([costume # v] of [levels v]) = [10]>> then\n            delete this clone\n        end\n    end\nend\n\nwhen I start as a clone\nif <(id) = [8]> then\n    switch costume to (costume1 v)\n    show\n    set size to (150) %\n    go to x: (-75) y: (-26)\n    point in direction (90)\n    forever\n        if <touching (guy v)?> then\n            start sound [Boing v]\n            repeat (2)\n                next costume\n                wait (0.05) seconds\n            end\n            switch costume to (costume2 v)\n            wait (0.05) seconds\n            switch costume to (costume1 v)\n            wait (0.05) seconds\n            wait until <not <touching (guy v)?>>\n        end\n        if <not <([costume # v] of [levels v]) = [12]>> then\n            delete this clone\n        end\n    end\nend\n\nwhen I start as a clone\nif <(id) = [9]> then\n    switch costume to (costume1 v)\n    show\n    set size to (150) %\n    go to x: (-170) y: (156)\n    point in direction (90)\n    forever\n        if <touching (guy v)?> then\n            start sound [Boing v]\n            repeat (2)\n                next costume\n                wait (0.05) seconds\n            end\n            switch costume to (costume2 v)\n            wait (0.05) seconds\n            switch costume to (costume1 v)\n            wait (0.05) seconds\n            wait until <not <touching (guy v)?>>\n        end\n        if <not <([costume # v] of [levels v]) = [12]>> then\n            delete this clone\n        end\n    end\nend\n\nwhen I start as a clone\nif <(id) = [10]> then\n    switch costume to (costume1 v)\n    show\n    set size to (150) %\n    go to x: (-150) y: (-82)\n    point in direction (90)\n    forever\n        if <touching (guy v)?> then\n            start sound [Boing v]\n            repeat (2)\n                next costume\n                wait (0.05) seconds\n            end\n            switch costume to (costume2 v)\n            wait (0.05) seconds\n            switch costume to (costume1 v)\n            wait (0.05) seconds\n            wait until <not <touching (guy v)?>>\n        end\n        if <not <([costume # v] of [levels v]) = [15]>> then\n            delete this clone\n        end\n    end\nend\n\nwhen I receive [before start v]\nhide\nswitch costume to (costume1 v)\nwait (0) seconds\nwait until <([costume # v] of [levels v]) = [6]>\nset [id v] to [0]\ncreate clone of (_myself_ v)\nwait until <([costume # v] of [levels v]) = [7]>\nrepeat (3)\n    change [id v] by (1)\n    create clone of (_myself_ v)\nend\nwait until <([costume # v] of [levels v]) = [8]>\nrepeat (2)\n    change [id v] by (1)\n    create clone of (_myself_ v)\nend\nwait until <([costume # v] of [levels v]) = [9]>\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nwait until <([costume # v] of [levels v]) = [10]>\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nwait until <([costume # v] of [levels v]) = [12]>\nrepeat (2)\n    change [id v] by (1)\n    create clone of (_myself_ v)\nend\nwait until <([costume # v] of [levels v]) = [15]>\nchange [id v] by (1)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nif <(id) = [1]> then\n    switch costume to (costume1 v)\n    show\n    set size to (150) %\n    go to x: (-140) y: (-82)\n    point in direction (90)\n    forever\n        if <touching (guy v)?> then\n            start sound [Boing v]\n            repeat (2)\n                next costume\n                wait (0.05) seconds\n            end\n            switch costume to (costume2 v)\n            wait (0.05) seconds\n            switch costume to (costume1 v)\n            wait (0.05) seconds\n            wait until <not <touching (guy v)?>>\n        end\n        if <not <([costume # v] of [levels v]) = [7]>> then\n            delete this clone\n        end\n    end\nend\n\nwhen I start as a clone\nif <(id) = [2]> then\n    switch costume to (costume1 v)\n    show\n    set size to (150) %\n    go to x: (0) y: (-82)\n    point in direction (90)\n    forever\n        if <touching (guy v)?> then\n            start sound [Boing v]\n            repeat (2)\n                next costume\n                wait (0.05) seconds\n            end\n            switch costume to (costume2 v)\n            wait (0.05) seconds\n            switch costume to (costume1 v)\n            wait (0.05) seconds\n            wait until <not <touching (guy v)?>>\n        end\n        if <not <([costume # v] of [levels v]) = [7]>> then\n            delete this clone\n        end\n    end\nend\n\nwhen I start as a clone\nif <(id) = [3]> then\n    switch costume to (costume1 v)\n    show\n    set size to (150) %\n    go to x: (140) y: (-82)\n    point in direction (90)\n    forever\n        if <touching (guy v)?> then\n            start sound [Boing v]\n            repeat (2)\n                next costume\n                wait (0.05) seconds\n            end\n            switch costume to (costume2 v)\n            wait (0.05) seconds\n            switch costume to (costume1 v)\n            wait (0.05) seconds\n            wait until <not <touching (guy v)?>>\n        end\n        if <not <([costume # v] of [levels v]) = [7]>> then\n            delete this clone\n        end\n    end\nend\n\n@Rando Bando clouds\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\ngo to [back v] layer\nswitch costume to (pick random (1) to (4))\nif <(side) = [1]> then\n    go to x: (240) y: (pick random (150) to (50))\n    repeat until <(x position) < [-240]>\n        change x by (-0.5)\n    end\n    delete this clone\nend\nif <(side) = [2]> then\n    go to x: (-240) y: (pick random (150) to (50))\n    repeat until <(x position) > [240]>\n        change x by (0.5)\n    end\n    delete this clone\nend\n\nwhen I receive [before start v]\nforever\n    set [side v] to (pick random (1) to (2))\n    create clone of (_myself_ v)\n    wait (pick random (10) to (15)) seconds\nend\n\n@Shade\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    show\n    go to [front v] layer\n    set [ghost v] effect to (95)\nend\n\n@Clean transitions\n\nwhen flag clicked\nhide\nforever\n    go to [front v] layer\nend\n\nwhen I receive [done v]\nstart sound [Connect v]\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nclear graphic effects\nwait (0.5) seconds\nrepeat (6)\n    change x by (((465) - (x position)) / (2))\nend\nhide\n\nwhen I receive [death v]\nwait (1) seconds\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nclear graphic effects\nwait (0.5) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\n\n@thumb\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (100)\n    go to [front v] layer\n    go to x: (0) y: (0)\n    show\nend\n\n@Intro\n\nwhen I start as a clone\nif <(size) = [70]> then\n    show\n    go to x: (0) y: (-110)\n    set [ghost v] effect to (100)\n    set size to (100) %\n    go to [front v] layer\n    switch costume to (corpcooga v)\n    repeat (5)\n        change [ghost v] effect by (-20)\n    end\n    wait (0.5) seconds\n    repeat (10)\n        wait (0.01) seconds\n        change [ghost v] effect by (10)\n    end\nend\n\nwhen flag clicked\nwait until <mouse down?>\nwait until <not <mouse down?>>\nstop all sounds\nstart sound [Teleport v]\nhide\nbroadcast (before start v)\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nset volume to (100) %\nstart sound [Intro music v]\nshow\ngo to [front v] layer\ngo to x: (-240) y: (0)\npoint in direction (-150)\nswitch costume to (op v)\nset [ghost v] effect to (100)\nset [vel v] to [30]\nset size to (30) %\nrepeat until <(x position) = [0]>\n    change x by (vel)\n    turn right (vel) degrees\n    change [ghost v] effect by ((vel) * (-0.5))\n    change size by ((vel) / (6))\n    change [vel v] by (-2)\nend\nset size to (71) %\ncreate clone of (_myself_ v)\nset size to (70) %\ncreate clone of (_myself_ v)\nrepeat (15)\n    set [bounce v] to (((bounce) * (0.7)) + ((80.5) - (size)))\n    change size by (bounce)\nend\nset size to (80) %\nwait (0.2) seconds\npoint in direction (90)\nset [sine v] to [0]\nrepeat (15)\n    point in direction ((90) + (([tan v] of ((sine) * (8)) ) * (10)))\nend\npoint in direction (90)\nset [size vel v] to [18]\nrepeat until <(size vel) < [2]>\n    change [size vel v] by (-2)\n    change size by (size vel)\n    turn left ((size vel) * (4)) degrees\nend\nset [sine v] to [0]\nrepeat until <(x position) < [0]>\n    set x to (([tan v] of ((sine) * (8)) ) * (20))\n    turn right (([tan v] of ((sine) * (8)) ) * (20)) degrees\nend\nrepeat until <(x position) > [0]>\n    set x to (([tan v] of ((sine) * (8)) ) * (20))\n    turn right (((90) - (direction)) / (3)) degrees\nend\nrepeat until <(size vel) < [-17]>\n    change [size vel v] by (-2)\n    change size by ((size vel) / (1.25))\n    turn left ((size vel) * (4)) degrees\nend\npoint in direction (90)\nset x to (0)\nwait (0.5) seconds\ncreate clone of (_myself_ v)\nwait (0.9) seconds\nhide\nwait (1) seconds\nstop [other scripts in sprite v]\nbroadcast (before start v)\n\nwhen I start as a clone\nif <(size) = [80]> then\n    set [sizevel v] to [30]\n    go to x: (0) y: (0)\n    switch costume to (costume1 v)\n    set size to (30) %\n    show\n    go to [front v] layer\n    repeat (30)\n        switch costume to (hax v)\n        change size by (sizevel)\n        change [sizevel v] by (-1)\n        switch costume to (costume1 v)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(size) = [71]> then\n    set size to (100) %\n    go to [front v] layer\n    switch costume to (poof-0 v)\n    repeat (13)\n        wait (0.005) seconds\n        next costume\n    end\n    delete this clone\nend\n\nwhen flag clicked\nforever\n    change [sine v] by (1)\nend\n\nwhen I start as a clone\nforever\n    if <mouse down?> then\n        delete this clone\n    end\nend\n\n