Journey-A mobile friendly scrolling platformer

Instructions: Our adventure is on a long journey,full of danger,will he make it?\nWASD,arrow keys,or mobile controls to move.\nAvoid spikes and lava. Get to the portal to win.\npress v to skip level.\nloved and faved by StratfordJames!\nOne easter egg on a level(labled easter egg)\nDon't forget to check out my other scrolling platformers!\nfollow @FreezeNova

@Stage\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\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    switch costume to (costume2 v)\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    switch costume to (costume1 v)\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 <(up) = [1]>> or <<mouse down?> and <(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\nhide\nbroadcast (die v)\nwait until <(respawn) = [1]>\nwait (0.5) seconds\nshow\n\nset [exit v] to []\nrepeat (5)\n    hide\n    wait (.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\n\ndefine Test - Die\nif <<touching (lava v)?> or <touching (spikes v)?>> then\n    set [exit v] to [die]\n    change [deaths per lv v] by (1)\n    broadcast (die v)\nend\n\ndefine Game - Win\nset [deaths per lv v] to [0]\nrepeat (50)\n    point towards (exit v)\n    turn right (65) degrees\n    move ((distance to [exit v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nhide\nchange [level v] by (1)\npoint in direction (90)\nwait (1) seconds\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\nbroadcast (Tick v) and wait\n\nbroadcast (Tick v) and wait\n\nwhen flag clicked\nset [deaths per lv v] to [0]\npoint in direction (90)\n\nwhen flag clicked\nwait (4) seconds\nforever\n    play sound [Encanted-Places v] until done\nend\n\ngo to (random position v)\n\nhide\nwait until <[] = [1]>\nwait (0.1) seconds\nshow\n\nwait (1.5) seconds\n\nhide\nwait (0.5) seconds\nwait (0.2) seconds\nshow\n\ngo to (random position v)\n\nturn left (15) degrees\n\nwhen flag clicked\nforever\n    if <key (v v) pressed?> then\n        if <not <(LEVEL) = [7]>> then\n            if <[5] < (deaths per lv)> then\n                hide\n                Game - Win\n                wait (5) seconds\n            else\n                broadcast (not enough deaths v)\n            end\n        end\n    end\nend\n\n\n\n@lava\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        else\n            if <(LEVEL) = [4]> then\n                switch costume to (4 v)\n                Clone at x: [1800] y: [0]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (costume1 v)\n                    Clone at x: [2000] y: [-100]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (6 v)\n                    else\n                        if <(LEVEL) = [7]> then\n                            switch costume to (7 v)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: ((y) + (lava rise))\nif <<(x) = (x position)> and <((y) + (lava rise)) = (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\nwhen I start as a clone\nforever\n\nchange y by (-10)\n\nwait (0.1) seconds\n\nchange y by (10)\n\nset [scroll y v] to [10]\n\nwhen flag clicked\nset [lava rise v] to [5]\nforever\n    repeat (5)\n        change [lava rise v] by (2)\n    end\n    wait (0.1) seconds\n    repeat (5)\n        change [lava rise v] by (-2)\n    end\n    wait (0.1) seconds\nend\n\nwait (0.01) seconds\n\nwait (0.01) seconds\n\nClone at x: [2000] y: [-100]\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: [500] y: [0]\n    Clone at x: [800] 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: [100] y: [0]\n        Clone at x: [200] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (3 v)\n            Clone at x: [500] y: [0]\n            Clone at x: [500] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 v)\n                Clone at x: [900] y: [0]\n                Clone at x: [650] y: [0]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5 v)\n                    Clone at x: [400] y: [0]\n                    Clone at x: [400] y: [0]\n                    Clone at x: [400] y: [0]\n                    Clone at x: [400] y: [0]\n                    Clone at x: [400] y: [0]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (level 6 acural 6 v)\n                        Clone at x: [600] y: [400]\n                        Clone at x: [600] y: [-400]\n                        Clone at x: [600] y: [0]\n                    else\n                        if <(LEVEL) = [7]> then\n                            switch costume to (level 7 acural 5 v)\n                        end\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: [400] y: [0]\nClone at x: [400] y: [0]\nClone at x: [400] y: [0]\nClone at x: [400] y: [0]\n\nClone at x: [600] y: [400]\nClone at x: [600] y: [-400]\nClone at x: [600] y: [0]\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]\nset [portal open? v] to [1]\nif <(LEVEL) = [1]> then\n    Clone at x: [1200] y: [50]\nelse\n    if <(LEVEL) = [2]> then\n        Clone at x: [1000] y: [50]\n    else\n        if <(LEVEL) = [3]> then\n            Clone at x: [1600] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                Clone at x: [2000] y: [100]\n            else\n                if <(LEVEL) = [5]> then\n                    Clone at x: [2000] y: [50]\n                else\n                    if <(LEVEL) = [6]> then\n                        Clone at x: [2300] y: [400]\n                    else\n                        if <(LEVEL) = [7]> then\n                            Clone at x: [2300] y: [400]\n                        else\n                            if <(LEVEL) = [8]> then\n                                Clone at x: [2300] y: [400]\n                            end\n                        end\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]\n\nhide\n\nswitch costume to (open v)\n\nwhen flag clicked\nforever\n    next costume\nend\n\nif <(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 (closed v)\n    Clone at x: [600] y: [0]\nelse\n    if <(LEVEL) = [3]> then\n        set [portal open? v] to [0]\n        switch costume to (closed v)\n        set [ghost v] effect to (40)\n        set [brightness v] effect to (-40)\n        Clone at x: [500] y: [100]\n    else\n        if <(LEVEL) = [4]> then\n            set [portal open? v] to [0]\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                set [portal open? v] to [0]\n                set [brightness v] effect to (-40)\n                set [ghost v] effect to (40)\n                Clone at x: [-190] y: [200]\n            end\n        end\n    end\nend\n\nset [portal open? v] to [0]\nset [brightness v] effect to (-40)\nswitch costume to (closed v)\n\nif <(LEVEL) = [7]> then\n\nClone at x: [2000] y: [100]\n\n@spikes\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: [900] 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: [500] y: [0]\n                    Clone at x: [500] y: [0]\n                    Clone at x: [500] y: [0]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (6 v)\n                        Clone at x: [1000] y: [50]\n                        Clone at x: [1000] y: [50]\n                    else\n                        if <(LEVEL) = [7]> then\n                            switch costume to (7 v)\n                        end\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\nwhen I start as a clone\nforever\n\nchange y by (10)\n\nchange y by (-10)\n\nwait (0.1) seconds\n\nset [scroll y v] to [10]\n\nwhen flag clicked\nset [lava rise v] to [5]\n\nrepeat (5)\n    change [lava rise v] by (2)\nend\nwait (0.1) seconds\nrepeat (5)\n    change [lava rise v] by (-2)\nend\nwait (0.1) seconds\n\nforever\n\nClone at x: [500] y: [0]\n\nClone at x: [500] y: [0]\nClone at x: [500] y: [0]\n\nClone at x: [50] y: [50]\n\nturn left (15) degrees\n\nif <(LEVEL) = [7]> then\n    switch costume to (7 v)\nend\n\n@thumnail\n\nwhen flag clicked\nrepeat (100)\n    change [ghost v] effect by (1)\nend\n\nwait (0) seconds\n\n@intro\n\nwhen flag clicked\nhide\nwait (0.5) seconds\nshow\nswitch costume to (gsssrfvjuzkvmxmemyjyj5 v)\nrepeat (36)\n    next costume\n    wait (0.1) seconds\nend\nhide\n\n@letters on intro\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\nswitch costume to (costume2 v)\nwait (3) seconds\nhide\n\n@Sprite1\n\nwhen I receive [not enough deaths v]\nshow\nwait (3) seconds\nhide\n\nwhen flag clicked\nhide\n\n@Sprite2\n\nwhen I receive [die v]\nswitch costume to ([costume # v] of [player v])\nshow\npoint in direction (90)\ngo to (player v)\nrepeat (8)\n    change y by (12)\n    turn right (15) degrees\nend\nrepeat until <(y position) < [-179]>\n    change y by (-12)\n    turn right (15) degrees\nend\npoint in direction (90)\nhide\nset [respawn v] to [1]\nwait (0.01) seconds\nset [respawn v] to [0]\nif <(costume [number v]) = [1]> then\nelse\nend\n\nwhen flag clicked\nhide\nset [respawn v] to [0]\n\nwait (0.01) seconds\n\nrepeat (10)\n    change y by (10)\n    turn right (-15) degrees\nend\nrepeat until <(y position) < [-179]>\n    change y by (-7)\n    turn right (-15) degrees\nend\npoint in direction (90)\nhide\nset [respawn v] to [1]\nwait (0.01) seconds\nset [respawn v] to [0]\n\n