BIOMES || A Scrolling Platformer

Instructions: Welcome to BIOMES || A Scrolling Platformer\nthis project was my most comlex project, I spent quite a while on it. \n\nPlay on four different biomes using the arrow keys, play on grasslands, play on tundra, play on desert and play on the forest.

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [desert v]\nswitch backdrop to (backdrop2 v)\n\nwhen I receive [forest v]\nswitch backdrop to (backdrop1 v)\n\nwhen flag clicked\nforever\n    play sound [Unlimited v] until done\nend\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [5]> then\n        broadcast (end v)\n    end\nend\n\n@blank\n\n@Platforms\n\nwhen I receive [green flag v]\nset [biome # v] to [1]\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: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (desert 1 v)\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (forest v)\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\n            end\n            if <(LEVEL) = [5]> then\n                switch costume to (costume1 v)\n            end\n        end\n    end\nend\n\nClone at x: [0] y: [360]\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\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 [reset v]\ndelete this clone\n\nwait (0.1) seconds\n\nhide\n\nset [level v] to [1]\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen I receive [level over v]\nchange [biome # v] by (1)\n\nset [biome # v] to [2]\n\nwhen flag clicked\nif <(costume [number v]) = [5]> then\n    broadcast (tundra v)\nend\nif <(costume [number v]) = [13]> then\n    broadcast (desert v)\nend\nif <(costume [number v]) = [19]> then\n    broadcast (forest v)\nend\n\nforever\n\nClone at x: [360] y: [0]\n\nwhen I receive [end v]\n\nswitch costume to (costume1 v)\nforever\n\nstop [other scripts in sprite v]\n\n@Player\n\nwhen flag clicked\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen I receive [green flag v]\ngo to x: (-100) y: (0)\nhide\n\nwhen I receive [play game v]\nforever\n    change [color v] effect by (25)\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\ndefine Game On\nset [x v] to [0]\nset [y v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nhide variable [collected v]\nhide variable [collected max v]\nhide variable [exit v]\nhide variable [in air v]\nhide variable [level v]\nhide variable [mouse v]\nhide variable [scroll x v]\nhide variable [scroll y v]\nhide variable [sx v]\nhide variable [sy v]\nhide variable [x v]\nhide variable [y v]\npoint in direction (90)\nclear graphic effects\nset size to (100) %\nshow\n\ndefine Tick\nif <key (left arrow v) pressed?> then\n    change [sx v] by (-2)\n    point in direction (-90)\nend\nif <key (right arrow v) pressed?> then\n    change [sx v] by (2)\n    point in direction (90)\nend\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nset [sx v] to ((sx) * (0.8))\nif <key (up arrow v) pressed?> then\n    if <(in air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nchange [sy v] by (-2)\nChange player y by (sy)\nPosition\nTest - Die\nchange [scroll x v] by (round (((x) - (SCROLL X)) / (3)))\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (15)))\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\nset [scroll x v] to [0]\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    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\nhide\n\ndefine Test - Die\nif <touching (danger v)?> then\n    set [exit v] to [Die]\nend\n\ndefine Game - Win!\nhide\nwait (1) seconds\nchange [level v] by (1)\nset [exit v] to []\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen flag clicked\nforever\n    Bounce\nend\n\ndefine Bounce\nif <touching (bounce pad v)?> then\n    set [sy v] to [25]\nend\n\nwhen flag clicked\nforever\n    if <touching (spikes v)?> then\n        Game - Die\n    end\nend\n\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\n\nwhen flag clicked\nforever\n    Portal\nend\n\ndefine Portal\nif <touching (portal v)?> then\n    set [exit v] to [win]\nend\n\nwhen flag clicked\nforever\n    if <key (4 v) pressed?> then\n        set [exit v] to [win]\n    end\nend\n\n@Grass\n\nwhen I receive [green flag v]\nset [level v] to [1]\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 1 1 \(1\) v)\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (desert 1 v)\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\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\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 [reset v]\ndelete this clone\n\nwait (0.1) seconds\n\nhide\n\nset [level v] to [1]\n\nwhen flag clicked\ngo to [front v] layer\n\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\n\nClone at x: [0] y: [360]\n\nwhen I receive [end v]\nhide\nforever\n    stop [other scripts in sprite v]\nend\n\n@Bounce Pad\n\nwhen I receive [green flag v]\nset [level v] to [1]\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]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\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: [360]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (forest bounce v)\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\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 [reset v]\ndelete this clone\n\nwait (0.1) seconds\n\nhide\n\nset [level v] to [1]\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen I receive [end v]\nhide\nforever\n    stop [other scripts in sprite v]\nend\n\n@Spikes\n\nwhen I receive [green flag v]\nset [level v] to [1]\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 1 4 \(3\) v)\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (cactus 1 v)\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (forest spikes 1 v)\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\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\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 [reset v]\ndelete this clone\n\nwait (0.1) seconds\n\nhide\n\nset [level v] to [1]\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen I receive [end v]\nhide\nforever\n    stop [other scripts in sprite v]\nend\n\n@Background\n\nwhen flag clicked\nshow\nswitch costume to (grassland v)\n\nwhen I receive [tundra v]\nswitch costume to (tundra v)\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [2]> then\n        broadcast (tundra v) and wait\n    end\n    if <(LEVEL) = [3]> then\n        broadcast (desert v) and wait\n    end\n    if <(LEVEL) = [4]> then\n        broadcast (forest v)\n    end\nend\n\nwhen I receive [desert v]\nswitch costume to (desert v)\n\nwhen I receive [forest v]\nswitch costume to (tree v)\n\nwhen I receive [end v]\nhide\nforever\n    stop [other scripts in sprite v]\nend\n\n@Clouds\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\nforever\n    create clone of (_myself_ v)\n    wait (pick random (1) to (2)) seconds\nend\n\nwhen I start as a clone\ngo to [back v] layer\nset [ghost v] effect to (0)\nset x to (341)\nset y to (pick random (-58) to (170))\nforever\n    change x by (-2)\n    if <(x position) < [-130]> then\n        delete this clone\n    end\nend\n\nwhen flag clicked\nforever\n    if <(EXIT) = [win]> then\n        hide\n    end\nend\n\nwhen I receive [end v]\nhide\nforever\n    stop [other scripts in sprite v]\nend\n\n@Portal\n\nwhen I receive [green flag v]\nset [level v] to [1]\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]\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: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 2 9 v)\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n            Clone at x: [360] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (forest v)\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\n                Clone at x: [360] y: [0]\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\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 [reset v]\ndelete this clone\n\nwait (0.1) seconds\n\nhide\n\nset [level v] to [1]\n\nwhen flag clicked\ngo to [front v] layer\n\nClone at x: [0] y: [360]\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [13]> then\n        if <touching (player v)?> then\n            broadcast (desert v)\n        end\n    end\nend\n\nwhen I receive [end v]\nhide\nforever\n    stop [other scripts in sprite v]\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [19]> then\n        if <touching (player v)?> then\n            broadcast (forest v)\n        end\n    end\nend\n\n@Snow\n\nwhen flag clicked\nhide\n\nwhen I receive [tundra v]\ngo to [front v] layer\nshow\nset [ghost v] effect to (100)\nforever\n    create clone of (_myself_ v)\n    wait (pick random (0.25) to (0.5)) seconds\nend\n\nwhen I start as a clone\nset [ghost v] effect to (0)\nset x to (pick random (-234) to (234))\nset y to (174)\nforever\n    change y by (-2)\n    if <(y position) < [-174]> then\n        delete this clone\n    end\nend\n\nwhen I receive [desert v]\nhide\n\nwhen I receive [end v]\nhide\nforever\n    stop [other scripts in sprite v]\nend\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\nshow\ngo to [front v] layer\n\n