Nature -A Scrolling Platformer-

Instructions: #56 on trending\nArrow keys/wad/mobile to move.\nAvoid spikes and lava.\nBounce on trampolines.\nThe flags are checkpoints.\nThere is one, long, level with 3 checkpoints.\nHave fun!

@Stage\n\nwhen I receive [start v]\nrepeat (10)\n    erase all\nend\n\nwhen I receive [start v]\nset volume to (100) %\nforever\n    play sound [Sunlight v] until done\nend\n\n@Player\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nTest dying\nBouce?\nrepeat until <not <<touching (platforms v)?> or <touching (sprite2 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)\nBouce?\nPosition\nTest dying\nif <<touching (platforms v)?> or <touching (sprite2 v)?>> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <<touching (platforms v)?> or <touching (sprite2 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 down?> and <(mouse y) > ((y position) + (20))>>> 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)?> or <touching (sprite2 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 Tick\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [sx v] by (-2)\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [sx v] by (2)\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 <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n    if <[4] > (in air)> then\n        set [sy v] to [16]\n    end\nend\nchange [sy v] by (-2)\nChange Player y by (sy)\nif <(LEVEL) = [1]> then\n    set [scroll x v] to (x)\nend\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nif <(LEVEL) = [1]> then\n    change [scroll y v] by (round (((y) - (SCROLL Y)) / (10)))\nend\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(y) < [-160]> then\n    set [exit v] to [die]\nend\nif <touching (platforms4 v)?> then\n    start sound [Big Boing v]\n    set [sy v] to [30]\nend\nif <(LEVEL) = [2]> then\n    set [check v] to [0]\nend\n\nwhen flag clicked\nset [check v] to [0]\nbroadcast (green flag v) and wait\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\ngo [backward v] (1) layers\n\nwhen I receive [playgame 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        win\n    else\n        die\n    end\nend\n\ndefine Game on\nif <(LEVEL) = [1]> then\n    if <(Check) = [0]> then\n        set [x v] to [0]\n        set [y v] to [0]\n    end\n    if <(Check) = [1]> then\n        set [x v] to [2850]\n        set [y v] to [200]\n    end\n    if <(Check) = [2]> then\n        set [x v] to [4585]\n        set [y v] to [50]\n    end\n    if <(Check) = [3]> then\n        set [x v] to [1605]\n        set [y v] to [200]\n    end\n    set [sx v] to [0]\n    set [sy v] to [0]\n    set [in air v] to [0]\n    set [exit v] to []\n    set [scroll y v] to [0]\n    set [scroll x v] to [0]\n    point in direction (90)\n    set size to (100) %\n    set [ghost v] effect to (0)\n    show\nend\nif <(LEVEL) = [2]> then\n    set [sx v] to [0]\n    set [sy v] to [0]\n    set [in air v] to [0]\n    set [exit v] to []\n    point in direction (90)\n    set size to (100) %\n    set [ghost v] effect to (0)\n    show\n    broadcast (boss fight v)\nend\n\ndefine win\nrepeat (10)\n    turn right (36) degrees\n    change size by (-10)\n    change [ghost v] effect by (10)\nend\nhide\nchange [level v] by (1)\nif <(LEVEL) = [2]> then\n    set [check v] to [0]\nend\nwait (1) seconds\n\ndefine die\nset [exit v] to []\nset rotation style [all around v]\nrepeat (10)\n    turn right (36) degrees\n    change size by (-10)\n    change [ghost v] effect by (10)\nend\nset rotation style [left-right v]\nhide\nwait (.5) seconds\nset [exit v] to []\n\ndefine Test dying\nif <touching (platforms3 v)?> then\n    start sound [Crunch v]\n    set [exit v] to [die]\nend\nif <touching (sprite3 v)?> then\n    start sound [Crunch v]\n    set [exit v] to [die]\nend\nif <touching (sprite4 v)?> then\n    start sound [Crunch v]\n    set [exit v] to [die]\nend\n\nif <not <(username) = [sceptile100]>> then\nend\n\ndefine Bouce?\n\nwhen I receive [start v]\nbroadcast (playgame v) and wait\n\nwhen I receive [boss fight v]\ngo to x: (-165) y: (-54)\n\n@Platforms\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\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 [green flag v]\nhide\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (1 v)\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    clone [450] [0]\nend\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 flag clicked\nhide\n\ndefine clone (x) (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nswitch costume to (11 v)\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\nset [ghost v] effect to (100)\n\n@Platforms2\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\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 [green flag v]\nhide\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (1 v)\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    clone [450] [0]\nelse\nend\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 flag clicked\nset volume to (100) %\nhide\ngo to [back v] layer\n\ndefine clone (x) (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nswitch costume to (11 v)\n\n@Platforms3\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\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 [green flag v]\nhide\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (1 v)\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    clone [450] [0]\nend\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 flag clicked\nhide\n\ndefine clone (x) (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nswitch costume to (11 v)\n\n@Platforms4\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\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 [green flag v]\nhide\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (1 v)\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    clone [450] [0]\nend\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 flag clicked\nhide\n\ndefine clone (x) (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nswitch costume to (11 v)\n\n@Platforms6\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    set [check v] to [2]\nend\nif <(Check) = [2]> then\n    set [ghost v] effect to (0)\nelse\n    set [ghost v] effect to (50)\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 [green flag v]\nhide\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (1 v)\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    clone [450] [0]\nend\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 flag clicked\nhide\n\ndefine clone (x) (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nswitch costume to (11 v)\n\nstart sound [Connect v]\n\n@Platforms7\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    set [check v] to [3]\nend\nif <<(Check) = [3]> or <<(Check) = [1]> or <(Check) = [2]>>> then\n    set [ghost v] effect to (0)\nelse\n    set [ghost v] effect to (50)\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 [green flag v]\nhide\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (1 v)\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    clone [450] [0]\nend\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 flag clicked\nhide\n\ndefine clone (x) (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nswitch costume to (11 v)\n\nstart sound [Connect v]\n\n@Platforms5\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    set [check v] to [1]\nend\nif <<(Check) = [1]> or <(Check) = [2]>> then\n    set [ghost v] effect to (0)\nelse\n    set [ghost v] effect to (50)\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 [green flag v]\nhide\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (1 v)\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    Clone at x: [450] y: [0]\n    clone [450] [0]\nend\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 flag clicked\nhide\n\ndefine clone (x) (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nswitch costume to (11 v)\n\nstart sound [Connect v]\n\n@intro\n\nwhen flag clicked\nset volume to (100) %\nstart sound [Super intro v]\nswitch costume to (screen shot 2020-07-06 at 3 v)\nset size to (100) %\nerase all\nhide\nset [ghost v] effect to (0)\npen up\ngo to x: (-231) y: (-240)\nset pen size to (100)\nset pen color to (#00f307)\npen down\nrepeat (3)\n    point in direction (0)\n    repeat (20)\n        move (20) steps\n    end\n    point in direction (90)\n    repeat (5)\n        move (20) steps\n    end\n    point in direction (180)\n    repeat (20)\n        move (20) steps\n    end\n    point in direction (90)\n    repeat (5)\n        move (20) steps\n    end\nend\npen up\nshow\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nset size to (200) %\npoint in direction (90)\nshow\nrepeat (20)\n    change size by (-10)\n    turn right (10) degrees\nend\nrepeat (10)\n    change size by (20)\n    turn right (10) degrees\nend\npoint in direction (90)\nrepeat (10)\n    change size by (-10)\nend\nwait (.5) seconds\nrepeat (20)\n    turn right (18) degrees\n    create clone of (_myself_ v)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nerase all\nbroadcast (start v)\nerase all\ndelete this clone\n\nwhen flag clicked\nforever\n    set pen color to (#00f307)\n    wait (.5) seconds\n    repeat (17)\n        change pen (color v) by (-1)\n    end\n    set pen color to (#ffe900)\n    wait (.5) seconds\n    repeat (14)\n        change pen (color v) by (-1)\n    end\n    set pen color to (#ff0000)\n    wait (.5) seconds\n    repeat (32)\n        change pen (color v) by (1)\n    end\nend\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nset pen size to (100)\nset pen color to (#ffffff)\npen down\nrepeat until <touching (_edge_ v)?>\n    move (15) steps\nend\ndelete this clone\n\n