Land in Space || A Scrolling Platformer

Instructions: Land in Space || A Scrolling Platformer\n––––––––––––––––––––––––––––––––––––––––––\nMade by: @jindalsargun\n––––––––––––––––––––––––––––––––––––––––––\nInstructions: \n➜Use arrow keys or WASD to move.\n➜Avoid spikes and don't fall inside holes.\n➜Reach the blue something to go to the next level.\n––––––––––––––––––––––––––––––––––––––––––\nUpdates:\n➜9th August 2021: shared\n––––––––––––––––––––––––––––––––––––––––––\nMusic:\n➜Waves sung by Anna Yvette\n––––––––––––––––––––––––––––––––––––––––––\n☇ 400+ followers Q and A\nhttps://scratch.mit.edu/projects/557740627/\n☇ Last platformer\nhttps://scratch.mit.edu/projects/555130559/\n––––––––––––––––––––––––––––––––––––––––––\nᴘʀᴏᴘᴏsᴇ ᴛʜɪs ᴛᴏ ʙᴇ ғᴇᴀᴛᴜʀᴇᴅ ʜᴇʀᴇ:\nhttps://scratch.mit.edu/studios/28715018/\nThank You for proposing it to get featured!\n––––––––––––––––––––––––––––––––––––––––––\nCredits:\n➜intro by @Invisity (modified by me)\n➜shooting stars by idk (pls tell me in the comments)\n➜all code by @jindalsargun (me)\n–––––––––––––––––––––––––––––––––––––––––––\nTags:\n#jindalsargun #Invisity #all #game #games #platformer #platformers #scrolling #player #spikes #fun #land #in #space #LandInSpace #waves #music #song #songs #Anna #Yvette #AnnaYvette\n–––––––––––––––––––––––––––––––––––––––––––\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nBye! (. ❛ ᴗ ❛.)

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [start v]\nswitch backdrop to (backdrop3 v)\n\n@Sprite2\n\n@Sprite3\n\n@Player\n\nwhen I receive [start v]\nset size to (100) %\nhide\nclear graphic effects\nswitch backdrop to (backdrop1 v)\npoint in direction (90)\nset rotation style [left-right v]\nset [scroll x v] to [308]\nset [scroll y v] to [63]\nset [x v] to [0]\nset [y v] to [0]\nshow\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [x v] by (1)\n        point in direction (90)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        point in direction (-90)\n        change [x v] by (-1)\n    end\n    change x by (x)\n    set [x v] to ((x) * (0.9))\n    if <<touching color (#ff8c8c)?> or <(Scroll Y) > [500]>> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        clear graphic effects\n        set [scroll x v] to [308]\n        set [scroll y v] to [63]\n        point in direction (90)\n    end\n    if <<touching color (#bbffab)?> or <touching color (#bf8080)?>> then\n        change y by (1)\n        if <<touching color (#bbffab)?> or <touching color (#bf8080)?>> then\n            change y by (1)\n            if <<touching color (#bbffab)?> or <touching color (#bf8080)?>> then\n                change y by (1)\n                if <<touching color (#bbffab)?> or <touching color (#bf8080)?>> then\n                    change y by (1)\n                    if <<touching color (#bbffab)?> or <touching color (#bf8080)?>> then\n                        change y by (1)\n                        if <<touching color (#bbffab)?> or <touching color (#bf8080)?>> then\n                            change x by ((x) * (-1))\n                            change y by (-5)\n                            if <<key (up arrow v) pressed?> or <key (space v) pressed?>> then\n                                if <(x) > [0]> then\n                                    set [x v] to [-19]\n                                else\n                                    set [x v] to [10]\n                                end\n                                set [y v] to [20]\n                            else\n                                set [x v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y v] by (-1)\n    change y by (y)\n    if <<touching color (#87d6ff)?> or <touching color (#c1ffec)?>> then\n        broadcast (Next level v)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        clear graphic effects\n        start sound [Connect v]\n    end\n    if <touching color (#bbffab)?> then\n        change y by ((y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    change [scroll x v] by ((x position) * (-1))\n    change [scroll y v] by ((y position) * (-1))\n    go to x: (0) y: (0)\n    if <<key (space v) pressed?> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        if <touching color (#bbffab)?> then\n            set [y v] to [13]\n        end\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nhide\n\n@Level\n\nwhen I receive [next level v]\nhide\nnext costume\nset [scroll x v] to [308]\nset [scroll y v] to [63]\nshow\n\nwhen I receive [start v]\nshow\nswitch costume to (size hack v)\nset size to (110) %\nswitch costume to (1 v)\nforever\n    go to x: (Scroll X) y: (Scroll Y)\nend\n\nwhen flag clicked\nhide\n\n@Music Button\n\nwhen this sprite clicked\nif <(costume [number v]) = [1]> then\n    switch costume to (mute v)\n    repeat (25)\n        change volume by (-4)\n    end\nelse\n    switch costume to (unmute v)\n    repeat (25)\n        change volume by (4)\n    end\nend\n\nwhen I receive [start v]\ngo to x: (-197) y: (-159)\nswitch costume to (unmute v)\nshow\ngo to [front v] layer\nset volume to (100) %\nforever\n    play sound [Anna Yvette - Waves v] until done\nend\n\nwhen flag clicked\nhide\n\n@Intro\n\ndefine Clone (number) of (id)\nset [clone id v] to (id)\nrepeat (number)\n    create clone of (_myself_ v)\nend\n\ndefine Cam (x) (y) (size) (direction)\nset [\[intro\] x v] to (x)\nset [\[intro\] y v] to (y)\nset [\[intro\] size v] to (size)\nset [\[intro\] direction v] to (direction)\n\ndefine Green flag\nrepeat (10)\n    reset timer\nend\nhide\ngo to x: (0) y: (0)\nset size to (100) %\npoint in direction (90)\nswitch costume to (blank v)\nCam [0] [0] [0] [0]\n\ndefine Smooth glide (x) (y) (size) (speed)\nset [costume v] to (costume [name v])\nswitch costume to (position v)\nchange x by (((x) - (x position)) / (speed))\nchange y by (((y) - (y position)) / (speed))\nif <(size) < [101]> then\n    switch costume to (full size v)\nelse\n    switch costume to (blank v)\nend\nchange size by (((size) - (size)) / (speed))\nswitch costume to (costume)\n\ndefine Position\npoint in direction ((\[Intro\] Direction) + (direction))\nset [costume v] to (costume [name v])\nswitch costume to (position v)\ngo to x: ((x) + (\[Intro\] X)) y: ((y) + (\[Intro\] Y))\nif <(size) < [101]> then\n    switch costume to (full size v)\nelse\n    switch costume to (blank v)\nend\nset size to ((\[Intro\] Size) + (size)) %\nswitch costume to (costume)\n\ndefine Line explosion (x) (y) (size) (speed) (number)\nset [x v] to (x)\nset [y v] to (y)\nset [size v] to (size)\nset [speed v] to (speed)\nset [direction v] to [0]\nrepeat (number)\n    change [direction v] by ((360) / (number))\n    Clone [1] of [Line explosion]\nend\nset [direction v] to [0]\n\nwhen I start as a clone\nif <(Clone ID) = [Line explosion]> then\n    if <(\[Intro\] Playing?) = [1]> then\n        go to [front v] layer\n        go to x: (x) y: (y)\n        point in direction (direction)\n        move ((speed) * (3)) steps\n        set size to (size) %\n        switch costume to (line explosion1 v)\n        show\n        repeat (11)\n            move (speed) steps\n            next costume\n        end\n    end\n    delete this clone\nend\n\ndefine Shockwave (x) (y) (size) (end)\nset [x v] to (x)\nset [y v] to (y)\nset [size v] to (size)\nset [speed v] to (end)\nClone [1] of [Shockwave]\n\nwhen I start as a clone\nif <(Clone ID) = [Shockwave]> then\n    if <(\[Intro\] Playing?) = [1]> then\n        go to x: (x) y: (y)\n        go to [front v] layer\n        set size to (size) %\n        set [effect v] to [12]\n        switch costume to (shockwave v)\n        show\n        repeat (35)\n            change [fisheye v] effect by (effect)\n            Smooth glide (x) (y) (speed) [5]\n            change [effect v] by ((effect) / (4))\n        end\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif < (Clone ID) contains [Particle]?> then\n    if <(\[Intro\] Playing?) = [1]> then\n        go to [front v] layer\n    end\n    switch costume to (join [Particle] (pick random (1) to (3)))\n    set size to (pick random (80) to (120)) %\n    set [y v] to [0]\n    show\n    if <(Clone ID) = [Particle]> then\n        go to x: (0) y: (0)\n    else\n        go to (random position v)\n    end\n    point in direction (pick random (-180) to (1808))\n    repeat (50)\n        change [ghost v] effect by (2)\n        move ((size) / (7)) steps\n        change size by (-2)\n        change y by (y)\n        change [y v] by (-0.5)\n        if <touching (_edge_ v)?> then\n            repeat (10)\n                change [ghost v] effect by (15)\n                move ((size) / (7)) steps\n                change size by (-2)\n                change y by (y)\n                change [y v] by (-0.5)\n            end\n            delete this clone\n        end\n    end\n    delete this clone\nend\n\ndefine Shake size (size)\nset [size v] to ((((size) - (size)) / (5)) + ((size) * (0.8)))\n\nwhen I start as a clone\nif <(Clone ID) = [Spin]> then\n    go to x: (x) y: (y)\n    set size to (size) %\n    show\n    point in direction (direction)\n    switch costume to (spin v)\n    repeat (17)\n        Position\n        next costume\n    end\n    delete this clone\nend\n\ndefine Spin (size)\nset [size v] to (size)\nset [x v] to [0]\nset [y v] to [50]\nset [direction v] to [90]\nClone [1] of [Spin]\nset [x v] to [0]\nset [y v] to [-50]\nset [direction v] to [90]\nClone [1] of [Spin]\nset [y v] to [0]\n\nwhen I start as a clone\nif < (Clone ID) contains [Spline]?> then\n    if < (Clone ID) contains [B]?> then\n        set [brightness v] effect to (100)\n    end\n    wait until <(timer) > [6.7]>\n    if <(\[Intro\] Playing?) = [1]> then\n        go to [front v] layer\n        go [backward v] (1) layers\n    end\n    repeat until <(timer) > (\[Intro\] End time)>\n        set [speed v] to [0.1]\n        wait (0.4) seconds\n    end\nend\n\nwhen I start as a clone\nif < (Clone ID) contains [Spline]?> then\n    switch costume to (spline v)\n    set [speed v] to [0.2]\n    repeat until <(timer) > (\[Intro\] End time)>\n        if <(timer) > [5.5]> then\n            show\n        end\n        go to x: (([sin v] of ((Splines) * (200)) ) * (200)) y: (([cos v] of ((Splines) * (300)) ) * (75))\n        change [splines v] by (speed)\n        change [speed v] by (((0.02) - (speed)) / (5))\n    end\n    delete this clone\nend\n\ndefine Spline\nswitch costume to (full size v)\nset size to (100) %\nrepeat (20)\n    Clone [1] of [Spline]\n    change size by (-5)\nend\nset size to (100) %\nwait (0.8) seconds\nset size to (100) %\nrepeat (20)\n    Clone [1] of [SplineB]\n    change size by (-5)\nend\nset size to (100) %\nwait (0.8) seconds\n\nwhen flag clicked\nset [\[intro\] playing? v] to [0]\nhide\n\ndefine Horizontal switch\nset [size v] to [75]\nset [x v] to [0]\nset [y v] to [0]\nset [direction v] to [90]\nClone [1] of [Spin]\nwait (0.07) seconds\nSpin [75]\n\nwhen I start as a clone\nif <(Clone ID) = [Circle]> then\n    set size to (0) %\n    switch costume to (particle3 v)\n    set [brightness v] effect to (100)\n    show\n    repeat (50)\n        if <(\[Intro\] Playing?) = [1]> then\n            go to [front v] layer\n            Smooth glide [0] [0] [5000] [10]\n        else\n            delete this clone\n        end\n    end\n    Keyframe [5.5]\n    set size to (100) %\n    switch costume to (start circle v)\n    repeat (50)\n        if <(\[Intro\] Playing?) = [1]> then\n            go to [front v] layer\n            Smooth glide [0] [0] [3000] [10]\n        else\n            delete this clone\n        end\n    end\n    delete this clone\nend\n\ndefine Keyframe (time)\nrepeat until <(timer) > (time)>\n    if <(timer) > (\[Intro\] End time)> then\n        stop [this script v]\n    end\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Ending1]> then\n    set size to (100) %\n    switch costume to (position v)\n    go to x: (999) y: (-999)\n    point in direction (90)\n    switch costume to (ending2 v)\n    show\n    repeat (100)\n        Smooth glide [0] [0] [100] [11]\n    end\n    go to x: (0) y: (0)\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Ending2]> then\n    set size to (100) %\n    switch costume to (position v)\n    go to x: (-999) y: (999)\n    point in direction (-90)\n    switch costume to (ending2 v)\n    show\n    repeat (100)\n        Smooth glide [0] [0] [100] [11]\n    end\n    go to x: (0) y: (0)\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Ending3]> then\n    wait (0.2) seconds\n    set size to (100) %\n    switch costume to (position v)\n    go to x: (999) y: (-999)\n    switch costume to (ending1 v)\n    point in direction (90)\n    show\n    repeat (100)\n        Smooth glide [0] [0] [100] [11]\n    end\n    go to x: (0) y: (0)\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Ending4]> then\n    wait (0.2) seconds\n    set size to (100) %\n    switch costume to (position v)\n    go to x: (-999) y: (999)\n    point in direction (-90)\n    switch costume to (ending1 v)\n    show\n    repeat (100)\n        Smooth glide [0] [0] [100] [11]\n    end\n    go to x: (0) y: (0)\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Ending5]> then\n    set size to (100) %\n    switch costume to (position v)\n    go to x: (-999) y: (-999)\n    point in direction (90)\n    switch costume to (ending4 v)\n    show\n    repeat (100)\n        Smooth glide [0] [0] [100] [11]\n    end\n    go to x: (0) y: (0)\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Ending6]> then\n    set size to (100) %\n    switch costume to (position v)\n    go to x: (999) y: (999)\n    point in direction (-90)\n    switch costume to (ending4 v)\n    show\n    repeat (100)\n        Smooth glide [0] [0] [100] [11]\n    end\n    go to x: (0) y: (0)\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Ending7]> then\n    wait (0.2) seconds\n    set size to (100) %\n    switch costume to (position v)\n    go to x: (-999) y: (-999)\n    point in direction (90)\n    switch costume to (ending3 v)\n    show\n    repeat (100)\n        Smooth glide [0] [0] [100] [11]\n    end\n    go to x: (0) y: (0)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Ending8]> then\n    wait (0.2) seconds\n    set size to (100) %\n    switch costume to (position v)\n    go to x: (999) y: (999)\n    point in direction (-90)\n    switch costume to (ending3 v)\n    show\n    repeat (100)\n        Smooth glide [0] [0] [100] [11]\n    end\n    go to x: (0) y: (0)\n    broadcast (Intro done v)\n    set [\[intro\] end time v] to (timer)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\n\ndefine Ending\nClone [1] of [Ending1]\nClone [1] of [Ending2]\nClone [1] of [Ending3]\nClone [1] of [Ending4]\nClone [1] of [Ending5]\nClone [1] of [Ending6]\nClone [1] of [Ending7]\nClone [1] of [Ending8]\n\nwhen I start as a clone\nif <(Clone ID) = [Text]> then\n    switch costume to (text v)\n    go to [front v] layer\n    go to x: (0) y: (0)\n    wait (1) seconds\n    show\n    set [size v] to [100]\n    set [direction v] to [90]\n    repeat until <(timer) > (\[Intro\] End time)>\n        Position\n        if <<<(timer) > [6.7]> and <(timer) < [8]>> and <(\[Intro\] End time) = [1]>> then\n            go to [front v] layer\n        end\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Cam]> then\n    set [\[intro\] direction v] to [0]\n    repeat until <(timer) > [10]>\n        if <(timer) < (\[Intro\] End time)> then\n            turn right ((((([cos v] of ((timer) * (300)) ) * (20)) + (0)) - (direction)) / (5)) degrees\n            change [\[intro\] size v] by ((((([cos v] of ((timer) * (200)) ) * (30)) + (0)) - (\[Intro\] Size)) / (4))\n            set [\[intro\] direction v] to (direction)\n        else\n            delete this clone\n        end\n    end\n    set [direction v] to [1]\n    repeat (15)\n        if <(timer) < (\[Intro\] End time)> then\n            change [direction v] by ((direction) / (3))\n            turn right (direction) degrees\n            set [\[intro\] direction v] to (direction)\n            change [\[intro\] size v] by ((((([cos v] of (((timer) - (50)) * (200)) ) * (30)) + (0)) - (\[Intro\] Size)) / (4))\n        else\n            delete this clone\n        end\n    end\n    repeat (10)\n        if <(timer) < (\[Intro\] End time)> then\n            turn right ((((([cos v] of ((timer) * (300)) ) * (20)) + (0)) - (direction)) / (5)) degrees\n            change [\[intro\] size v] by ((((([cos v] of ((timer) * (200)) ) * (30)) + (0)) - (\[Intro\] Size)) / (4))\n            set [\[intro\] direction v] to (direction)\n        else\n            delete this clone\n        end\n    end\n    if <(\[Intro\] Playing?) = [1]> then\n        Clone [1] of [Ending]\n    else\n        delete this clone\n    end\n    repeat until <(timer) > (\[Intro\] End time)>\n        if <(timer) < (\[Intro\] End time)> then\n            turn right ((((([cos v] of ((timer) * (300)) ) * (20)) + (0)) - (direction)) / (5)) degrees\n            change [\[intro\] size v] by ((((([cos v] of ((timer) * (200)) ) * (30)) + (0)) - (\[Intro\] Size)) / (4))\n            set [\[intro\] direction v] to (direction)\n        else\n            delete this clone\n        end\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Ending]> then\n    Ending\n    delete this clone\nend\n\nwhen I start as a clone\nif < (Clone ID) contains [Ending]?> then\n    go to [front v] layer\n    if <(letter (7) of (Clone ID)) > [6]> then\n        forever\n            go to [front v] layer\n            go [forward v] (100000) layers\n        end\n    end\nend\n\nwhen I start as a clone\nif < (Clone ID) contains [Hex]?> then\n    switch costume to (hexagon v)\n    if < (Clone ID) contains [B]?> then\n        switch costume to (hexagon2 v)\n    end\n    set [size v] to [0]\n    go to x: (0) y: (0)\n    show\n    if <(timer) < [4]> then\n        delete this clone\n    end\n    repeat (100)\n        change [size v] by (10)\n        Position\n        if <(timer) > (\[Intro\] End time)> then\n            delete this clone\n        end\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [PCloner]> then\n    wait (2) seconds\n    repeat (10)\n        if <(pick random (1) to (2)) = [1]> then\n            Clone (pick random (20) to (30)) of [Particle]\n        else\n            Clone (pick random (20) to (30)) of [Particles]\n        end\n        hide\n        wait (0.3) seconds\n    end\n    delete this clone\nend\n\nwhen I receive [start intro v]\nset [\[intro\] end time v] to [13.5]\nGreen flag\nstart sound [Sonder - Departure v]\nKeyframe [4]\nset [\[intro\] playing? v] to [1]\nClone [1] of [Circle]\nClone [1] of [Text]\nClone [1] of [Cam]\nClone [1] of [PCloner]\nSpline\nKeyframe [7]\nLine explosion [-140] [80] [100] [10] [10]\nLine explosion [140] [-80] [100] [10] [10]\nset [x v] to [0]\nset [y v] to [0]\nwait (1) seconds\nLine explosion [140] [80] [100] [10] [10]\nLine explosion [-140] [-80] [100] [10] [10]\nShockwave [0] [0] [0] [500]\nset [x v] to [0]\nset [y v] to [0]\nwait (2) seconds\nLine explosion [0] [0] [100] [20] [15]\nset [x v] to [0]\nset [y v] to [0]\n\nwhen I receive [start intro v]\nwait (4) seconds\nrepeat until <(timer) > (\[Intro\] End time)>\n    hide\n    Clone [1] of [Hex]\n    repeat (15)\n        set size to (size) %\n    end\n    Clone [1] of [HexB]\n    repeat (15)\n        set size to (size) %\n    end\nend\n\nwhen I receive [intro done v]\nset [\[intro\] playing? v] to [0]\nif <not < (Clone ID) contains [Ending]?>> then\n    delete this clone\nend\n\nwhen flag clicked\nbroadcast (Start intro v)\n\nwhen I receive [intro done v]\nbroadcast (Start v)\n\n@Shooting stars\n\nwhen I start as a clone\nshow\nrepeat (50)\n    change [ghost v] effect by (3)\n    change size by (-20)\n    move (0.2) steps\n    go to [back v] layer\nend\ndelete this clone\n\nwhen I receive [start v]\nforever\n    set size to (5) %\n    go to x: (pick random (-150) to (150)) y: (150)\n    repeat until <<touching (ground v)?> or <touching (_edge_ v)?>>\n        go to [back v] layer\n        move (2) steps\n        create clone of (_myself_ v)\n    end\n    hide\n    wait (pick random (3) to (7)) seconds\nend\n\n@Glow\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nshow\nforever\n    go to (player v)\nend\n\nwhen I receive [start v]\ngo to [back v] layer\nset size to (100) %\nforever\n    repeat (20)\n        change size by (1)\n    end\n    repeat (20)\n        change size by (-1)\n    end\nend\n\nwhen flag clicked\nhide\n\n@Sprite1\n\nwhen flag clicked\nshow\nswitch costume to (costume4 v)\nset [ghost v] effect to (100)\ngo to [front v] layer\ngo to x: (0) y: (0)\nset volume to (100) %\n\n