The Moon - A scrolling platformer #games

Instructions: The Moon\n---------------------------------------------------------------------------------\nIf you didn't know already this is a collab project with @fastteddy654 that I shared a bit too late.\nTry out his awesome games!\nMore Accurate Version:\nhttps://scratch.mit.edu/projects/527783906/\n---------------------------------------------------------------------------------\nLinks:⬇️\nUnderWater v1.05:\nhttps://scratch.mit.edu/projects/534725740/\nNeon World - a platformer:\nhttps://scratch.mit.edu/projects/513489345/\nMy Colorless Platformer:\nhttps://scratch.mit.edu/projects/528430318/\n\nTags:\n #Blakonight #moon #planet #space #solarsystem #scrollingplatformer #water #ocean #sea  #colourless #contest #Neon #platformer #cool #competition #art  #explorer #stickman #music #marshmello #a #b #c #d #e #f #g #h #h #i #j #k #l #m #n #o #p #q #r #s #t #u #v #w #x #y #z #berricake #sterlon #cutepiranha #potatoanimator #scratch #everything #studio #cutepiranha #fastteddy654 #timmccool #scratch #scratchcat #ceebee #lava #neonworld #neonworld2 #inferno #roblox #fortnite #1 #2 #3 #4 #5 #6 #7 #8 #9 #10\n#contest #game #games #art #all #beanos #nyancat #bingus #rickastley #troll #animations #colorless \n#grubhub #whyareyoulookingatthesetags #popular #trending #amazing #advertising #advertisement #stopadvertising #stopasianhate #blacklivesmatter #platformer #chewymint #noncheeseball2 #blob #ninja #dragonballz #underrated #anything #everything #backdrop #sprite #request #trend #oof #supersoniclva123\n

@Stage\n\nwhen flag clicked\nforever\n    play sound [Starship2 v] until done\nend\n\n@player\n\nwhen flag clicked\nhide\nset volume to (100) %\n\nbroadcast (green flag v) and wait\nbroadcast (start! v) and wait\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\ngo [backward v] (2) layers\n\ndefine game on!\nset [scroll x v] to ((SCROLL X) / (5))\nset [scroll y v] to ((SCROLL Y) / (5))\nset [scroll x v] to (round (SCROLL X))\nset [scroll y v] to (round (SCROLL Y))\nset [x v] to [0]\nset [y v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nbroadcast (close space v)\nset rotation style [all around v]\npoint in direction (90)\nswitch costume to (base v)\nset [ghost v] effect to (0)\nclear graphic effects\nset size to (75) %\nshow\n\ndefine Tick\nif <touching (bounce v)?> then\n    set [sy v] to [30]\nend\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > [10]>>> then\n    switch costume to (left2 v)\n    change player x by [8]\nelse\n    if <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < [-10]>>> then\n        switch costume to (left3 v)\n        change player x by [-8]\n    end\nend\nif <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    if <(in air) < [4]> then\n        set [sy v] to [10]\n    end\nend\nif <touching (platforms v)?> then\nchange [sy v] by (-0.5)\nchange player y by (sy)\ntest die\nchange [scroll x v] by (round (((x) - (SCROLL X)) / (10)))\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 change player x by (sx)\nchange [x v] by (sx)\nposition\nif <touching (platforms v)?> then\n    repeat (10)\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 (-10)\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\nset [exit v] to []\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\n\ndefine test die\nif <<(god mode LOL) = [0]> and <touching (danger v)?>> then\n    set [exit v] to [die]\nend\n\ndefine game - win\nrepeat (50)\n    point towards (exit v)\n    turn right (65) degrees\n    move ((distance to [exit v]) / (2)) steps\n    change size by (-0.5)\n    change [ghost v] effect by (2)\nend\nhide\nchange [my variable v] by (1)\nwait (1) seconds\n\nwhen I receive [green flag v]\nswitch costume to (left2 v)\nset [my variable 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        broadcast (attack? v)\n    end\n    if <(EXIT) = [win]> then\n        game - win\n        set [scroll x v] to [0]\n        set [scroll y v] to [0]\n    else\n        game-die\n    end\nend\n\ndefine position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\nwhen [9 v] key pressed\nset [exit v] to [win]\n\nwhen flag clicked\nset [god mode lol v] to [0]\nset [fly hacks v] to [0]\n\nwhen [8 v] key pressed\nif <(god mode LOL) = [0]> then\n    set [god mode lol v] to [1]\nelse\n    set [god mode lol v] to [0]\nend\n\n@platforms\n\nwhen I receive [green flag v]\nset [ghost v] effect to (0)\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nclear graphic effects\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level 1 1 v)\nif <(my variable) = [1]> then\n    Clone at x: [480] y: [0]\n    Clone at x: [340] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\n    Clone at x: [400] y: [0]\nelse\n    if <(my variable) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [480] y: [0]\n        Clone at x: [480] y: [0]\n        Clone at x: [480] y: [0]\n        Clone at x: [480] y: [100]\n        Clone at x: [480] y: [100]\n    else\n        if <(my variable) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [480] y: []\n            Clone at x: [480] y: []\n            Clone at x: [615] y: []\n            Clone at x: [480] y: []\n            Clone at x: [480] y: []\n            Clone at x: [480] y: []\n        else\n            if <(my variable) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone at x: [480] y: []\n                Clone at x: [480] y: []\n                Clone at x: [450] y: []\n                Clone at x: [450] y: []\n                Clone at x: [800] y: []\n            else\n                if <(my variable) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone at x: [480] y: []\n                    Clone at x: [480] y: []\n                    Clone at x: [-1200] y: [200]\n                else\n                    if <(my variable) = [6]> then\n                        switch costume to (level 6 1 v)\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\nClone at x: [480] y: []\nClone at x: [450] y: []\nClone at x: [450] y: []\nClone at x: [800] y: []\n\n@Danger\n\nwhen I receive [green flag v]\nset [ghost v] effect to (10)\nswitch costume to (level 1 1 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]\nswitch costume to (level 1 1 v)\nif <(my variable) = [1]> then\n    Clone at x: [1564] y: [-31]\n    Clone at x: [360] y: []\nelse\n    if <(my variable) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [486] y: [-85]\n        Clone at x: [900] y: [200]\n        Clone at x: [1200] y: [200]\n    else\n        if <(my variable) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [600] y: []\n            Clone at x: [1200] y: [303]\n            Clone at x: [400] y: [-303]\n        else\n            if <(my variable) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone at x: [720] y: []\n                Clone at x: [360] y: []\n                Clone at x: [360] y: []\n                Clone at x: [800] y: []\n                Clone at x: [360] y: []\n            else\n                if <(my variable) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone at x: [360] y: []\n                    Clone at x: [180] y: []\n                    Clone at x: [360] y: []\n                    Clone at x: [] y: [100]\n                else\n                    if <(my variable) = [6]> then\n                        switch costume to (level 6 1 v)\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\ngo to [back v] layer\ngo [forward v] (1) layers\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@Exit\n\nwhen I receive [green flag v]\nhide\nswitch costume to (open v)\nset [ghost v] effect to (0)\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) (((y) - (SCROLL Y)) + (([sin v] of ((timer) * (300)) ) * (-5)))\nif <touching (player v)?> then\n    set [exit v] to [win]\nend\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(my variable) = [1]> then\n    Clone at x: [2359] y: [119]\nelse\n    if <(my variable) = [2]> then\n        Clone at x: [2952] y: [0]\n    else\n        if <(my variable) = [3]> then\n            Clone at x: [2700] y: [-64]\n        else\n            if <(my variable) = [4]> then\n                Clone at x: [2250] y: [-20]\n            else\n                if <(my variable) = [5]> then\n                    Clone at x: [10000] y: [144]\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)\nset [x v] to (x)\nset [y v] to (y)\n\nwhen [m v] key pressed\nshow variable [mouse v]\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [,] ((mouse y) + (SCROLL Y))))\n\nwhen flag clicked\n\n@Sprite1\n\nwhen flag clicked\ngo to [front v] layer\ngo [backward v] (1) layers\nhide\ngo to x: (0) y: (0)\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.001)\ngo to [front v] layer\nshow\n\n@Sprite2\n\nwhen flag clicked\ngo to [front v] layer\ngo [backward v] (1) layers\nshow\nwait (2) seconds\nrepeat (4)\n    change [ghost v] effect by (25)\nend\nhide\nbroadcast (green flag v)\n\n