Adventure || A Mobile Scrolling Platformer (Contest Entry) #Games #All

Instructions: hello, and welcome to my best game ever, Adventure!!!\nArrow keys, WASD, or mobile to move. Note: nothing was taken from @--Dessert-- this is a contest entry\nclick the flag 2xs\n                                      \n                                      CREDITS\n@Griffpatch for the scrolling engine\n@Capt_Boanerges for the mountains\n@MJM3 for the coins\nyoutube for the music\n@-DiamondFox- (me) for the rest of the game\n\n                                       GOALS\n100 loves\n200 loves\n300 loves\n\nShoutout #1: @Zillien for being cool\nShoutout #2: @--Dessert-- for hosting the contest\nShoutout #3: @JoeyDoggieRat\nShoutout #4: @Ryham301

@Stage\n\nwhen [space v] key pressed\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [, ] ((mouse y) + (SCROLL Y))))\nshow variable [mouse v]\n\nwhen I receive [game v]\nstop all sounds\nforever\n    play sound [JJD - Adventure \[NCS Release\] v] until done\nend\n\nwhen flag clicked\nplay sound [TheFatRat - Prelude \(Jackpot EP Track 3\) v] until done\n\n@blank \n\n@Player\n\nwhen flag clicked\nhide\nhide variable [mouse v]\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game 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)\n    end\n    if <(EXIT) = [win]> then\n        win\n    else\n        game - die\n    end\nend\n\ndefine game on\nset [x v] to [0]\nset [y v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nshow\n\ndefine Tick\nif <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [sx v] by (-2)\n    switch costume to (player3 v)\nend\nif <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [sx v] by (2)\n    switch costume to (player2 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 <<mouse down?> and <(mouse y) > [0]>>> 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\n\ndefine change player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nposition\nrepeat until <not <touching (levels 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 (levels v)?> then\n    repeat (12)\n        change [y v] by (1)\n        position\n        if <not <touching (levels 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) > [0]>>> 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 (levels 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\nset [exit v] to []\nshow\n\ndefine test - die\n\ndefine win\nset [exit v] to []\nhide\nbroadcast (transition v)\nwait (2) seconds\nchange [level v] by (1)\n\nwhen I receive [game v]\nset [player v] to [0]\nforever\n    if <(PLAYER) = [1]> then\n        set [☁ p1 - x v] to (mouse x)\n        set [☁ p1 - x v] to <[] > [50]>\n    end\n    go to x: (☁ P1 - X) y: (☁ P1 - Y)\nend\n\nwhen [1 v] key pressed\nset [player v] to [1]\n\nwhen I receive [game v]\nforever\n    if <not <<<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> or <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>>>> then\n        switch costume to (player v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (_edge_ v)?> then\n        set [exit v] to [die]\n    end\n    if <touching (danger v)?> then\n        set [exit v] to [die]\n    end\nend\n\n@Levels\n\nwhen I receive [green flag v]\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 (1 1 v)\n    clone at x [380] y [0]\n    clone at x [380] y [0]\n    clone at x [380] y [0]\n    clone at x [380] y [0]\n    clone at x [380] y [0]\n    clone at x [400] y [400]\n    clone at x [-380] y [230]\n    clone at x [480] y [230]\n    clone at x [-480] y [230]\n    clone at x [480] y [230]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (2 1 v)\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\n@coins\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    change [collected v] by (1)\n    if <(COLLECTED) = (COLLECTED MAX)> then\n        broadcast (open v)\n    end\n    delete this clone\nend\n\nwhen I receive [setup v]\nhide\nset [collected max v] to [0]\nset [collected v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (coin v)\n    clone at x [380] y [116]\n    clone at x [663] y [-13]\n    clone at x [976] y [28]\n    clone at x [1722] y [185]\n    clone at x [1907] y [185]\n    clone at x [2093] y [185]\n    clone at x [2337] y [411]\n    clone at x [2589] y [411]\n    clone at x [1962] y [639]\n    clone at x [2122] y [639]\n    clone at x [2285] y [639]\nend\nset [x v] to [-9999999999999999999999999]\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)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\n@danger\n\nwhen I receive [green flag v]\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 (1 1 v)\n    clone at x [380] y [0]\n    clone at x [380] y [0]\n    clone at x [380] y [0]\n    clone at x [380] y [0]\n    clone at x [380] y [0]\n    clone at x [400] y [400]\n    clone at x [-380] y [230]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (2 1 v)\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\n@Sprite1\n\nwhen flag clicked\ngo to x: (470) y: (0)\nhide\n\nwhen I receive [transition v]\ngo to [front v] layer\nshow\nglide (1) secs to x: (0) y: (0)\nglide (1) secs to x: (470) y: (0)\nhide\n\n@flag\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <<(costume [number v]) = [2]> and <touching (player v)?>> 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]\nif <(LEVEL) = [1]> then\n    switch costume to (flag closed v)\n    clone at x [2562] y [1263]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (flag closed v)\n        clone at x [99999999999] y [99999999999999999]\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)\nset [x v] to (x)\nset [y v] to (y)\n\nwhen I receive [open v]\nswitch costume to (flag open v)\n\n@cgguyd\n\nwhen flag clicked\nhide\nswitch costume to (backdrop1 v)\ngo to [back v] layer\ngo to x: (0) y: (0)\n\nwhen I receive [setup v]\ngo to x: (0) y: (0)\n\nwhen I receive [game v]\nshow\n\n@menu + thumbnail\n\nwhen I receive [game v]\nbroadcast (green flag v) and wait\nbroadcast (Play game v) and wait\n\nwhen I receive [game v]\nhide\n\nwhen flag clicked\nshow\n\nwhen flag clicked\nswitch costume to (costume2 v)\n\n@start\n\nwhen flag clicked\ngo to x: (0) y: (-135)\nshow\nforever\n    change [direction v] by (7.5)\n    point in direction ((([sin v] of (direction) ) * (5)) + (90))\nend\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((130) - (size)) / (4))\n    else\n        change size by (((100) - (size)) / (4))\n    end\nend\n\nwhen flag clicked\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        hide\n        broadcast (game v)\n    end\nend\n\n@cloud\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\ngo to [back v] layer\nshow\nswitch costume to (pick random (1) to (5))\nset [x cloud v] to (pick random (-3) to (-7))\nset [ghost v] effect to (pick random (25) to (50))\nset size to (pick random (40) to (100)) %\nset y to (pick random (140) to (160))\nset x to (220)\nrepeat until <(x position) < [-200]>\n    change x by (x cloud)\nend\ndelete this clone\n\nwhen I receive [game v]\nhide\nforever\n    hide\n    create clone of (_myself_ v)\n    wait (pick random (1) to (3)) seconds\nend\n\nwhen flag clicked\nhide\n\n@money\n\nwhen flag clicked\nset [equipped v] to [none]\nhide\n\nwhen I start as a clone\nif <(size) = [100]> then\n    forever\n        go to [front v] layer\n        go to x: (193) y: (156)\n        set size to (35) %\n        if <<((round ((COLLECTED) * (100))) / (100)) = [10]> or <((round ((COLLECTED) * (100))) / (100)) > [10]>> then\n            show\n            switch costume to (letter (1) of (COLLECTED))\n        else\n            hide\n        end\n    end\nend\n\nwhen I start as a clone\nif <(size) = [99]> then\n    wait () seconds\n    go to [front v] layer\n    set size to (35) %\n    set [brightness v] effect to (100)\n    switch costume to (0 v)\n    go to x: (263) y: (156)\n    show\n    repeat (10)\n        change x by (((193) - (x position)) / (3))\n    end\n    forever\n        go to [front v] layer\n        set size to (35) %\n        show\n        if <(COLLECTED) < [10]> then\n            go to x: (193) y: (156)\n            switch costume to (letter (1) of (COLLECTED))\n        else\n            go to x: (207) y: (156)\n            switch costume to (letter (2) of (COLLECTED))\n        end\n        set [brightness v] effect to (100)\n    end\nend\n\nwhen I receive [game v]\nset size to (100) %\ncreate clone of (_myself_ v)\nset size to (99) %\ncreate clone of (_myself_ v)\nset size to (98) %\ncreate clone of (_myself_ v)\nset size to (97) %\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(size) = [98]> then\n    wait () seconds\n    set size to (100) %\n    go to [front v] layer\n    switch costume to (money v)\n    go to x: (263) y: (157)\n    show\n    repeat (10)\n        change x by (((165) - (x position)) / (3))\n    end\n    forever\n        go to x: (165) y: (157)\n        set size to (100) %\n        show\n        switch costume to (money v)\n    end\nend\n\nwhen I start as a clone\nif <(size) = [97]> then\n    go to [front v] layer\n    go [backward v] (1) layers\n    wait () seconds\n    set size to (100) %\n    switch costume to (shading v)\n    go to x: (100) y: (0)\n    show\n    repeat (10)\n        change x by (((0) - (x position)) / (3))\n    end\n    forever\n        go to x: (0) y: (0)\n        set size to (100) %\n        show\n        switch costume to (shading v)\n        set [ghost v] effect to (0)\n    end\nend\n\n@thing\n\nwhen flag clicked\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (4))\n    else\n        change size by (((100) - (size)) / (4))\n    end\nend\n\nwhen I receive [game v]\nhide\n\nwhen flag clicked\nforever\n    point in direction ((([sin v] of (direction) ) * (5)) + (90))\nend\n\n