Earth - A 360 Platformer

Instructions: Hello there, welcome to my second 360-degree platformer. This is the sequel to my first 360 platformer Lava World. Link - https://scratch.mit.edu/projects/468009493\n\n- Use arrow keys to move the player jump.\n- You can wall jump.\n- Leave a ❤️ and ⭐ and maybe a follow.\n- Dodge the spikes.\n- Get to the green to win.\n- Have fun!

@Stage\n\nwhen flag clicked\nbroadcast (Green flag v)\n\n@ clouds\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nset size to (pick random (50) to (80)) %\nshow\ngo to [back v] layer\nset [ghost v] effect to (20)\nswitch costume to (pick random (1) to (4))\nif <(side) = [1]> then\n    go to x: (300) y: (pick random (150) to (100))\n    repeat until <(x position) < [-250]>\n        change x by (-1)\n    end\n    delete this clone\nend\nif <(side) = [2]> then\n    go to x: (-300) y: (pick random (150) to (100))\n    repeat until <(x position) > [250]>\n        change x by (1)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nforever\n    go [backward v] (1) layers\n    go to [back v] layer\nend\n\nwhen I receive [green flag v]\nforever\n    set [side v] to (pick random (1) to (2))\n    create clone of (_myself_ v)\n    wait (pick random (15) to (30)) seconds\nend\n\n@Platform\n\ndefine SET HACK SIZE TO (number or text)\nswitch costume to (2 v)\nset size to (number or text) %\nswitch costume to (1 v)\n\nwhen I receive [respawn v]\npoint in direction (90)\ngo to x: (-10) y: (-500)\nset [d vel v] to [0]\nset [y vel v] to [0]\nstop all sounds\nplay sound [Vexento - Masked Heroes \[NCS Fanmade\] v] until done\n\nwhen I receive [green flag v]\ngo to [front v] layer\nshow\nbroadcast (Respawn v)\nSET HACK SIZE TO [200]\nforever\n    change [y vel v] by (1)\n    if <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>> then\n        change [d vel v] by (-0.2)\n    end\n    if <<key (left arrow v) pressed?> or <<(x position) > (mouse x)> and <mouse down?>>> then\n        change [d vel v] by (0.2)\n    end\n    set [d vel v] to ((d vel) * (0.8))\n    turn right (d vel) degrees\n    if <touching (player v)?> then\n        change y by (-1)\n        if <touching (player v)?> then\n            change y by (-1)\n            if <touching (player v)?> then\n                change y by (-1)\n                if <touching (player v)?> then\n                    change y by (-1)\n                    if <touching (player v)?> then\n                        change y by (4)\n                        turn right ((d vel) * (-1)) degrees\n                        set [d vel v] to [0]\n                    end\n                end\n            end\n        end\n    end\n    change y by (y vel)\n    if <touching (player v)?> then\n        change y by ((y vel) * (-1))\n        set [y vel v] to [0]\n    end\n    change y by (1)\n    if <touching (player v)?> then\n        if <<key (up arrow v) pressed?> or <<(mouse y) > [50]> and <mouse down?>>> then\n            set [y vel v] to [-12]\n        end\n    end\n    change y by (-1)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag v]\nplay sound [Vexento - Masked Heroes \[NCS Fanmade\] v] until done\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\npoint in direction (90)\ngo to x: (-10) y: (-500)\nset [d vel v] to [0]\nset [y vel v] to [0]\nstop all sounds\nplay sound [Vexento - Masked Heroes \[NCS Fanmade\] v] until done\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [1]> then\n        switch costume to (1 v)\n    else\n        switch costume to (costume2 v)\n    end\nend\n\nwhen I receive [next level v]\nnext costume\nset [d vel v] to [0]\nset [y vel v] to [0]\nbroadcast (Respawn v)\n\n@Player\n\nwhen I receive [green flag v]\nforever\n    if <not <<key (up arrow v) pressed?> or <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>>>> then\n        switch costume to (1 v)\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (-1)\nhide\n\nwhen I receive [green flag v]\nshow\n\nwhen flag clicked\nforever\n    change y by (-5)\n    if <touching color (#218ad0)?> then\n        set [y vel v] to [-20]\n    end\n    if <touching color (#348340)?> then\n        broadcast (Respawn v)\n    end\n    if <touching color (#66ff7d)?> then\n        broadcast (Respawn v)\n    end\n    if <touching color (#50ff00)?> then\n        broadcast (Win v)\n    end\n    change y by (5)\nend\n\nwhen I receive [respawn v]\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [green flag v]\nforever\n    if <<key (w v) pressed?> or <<key (space v) pressed?> or <key (up arrow v) pressed?>>> then\n        switch costume to (6 v)\n    end\n    if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n        switch costume to (4 v)\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        switch costume to (5 v)\n    end\n    if <<key (left arrow v) pressed?> and <key (up arrow v) pressed?>> then\n        switch costume to (2 v)\n    end\n    if <<key (right arrow v) pressed?> and <key (up arrow v) pressed?>> then\n        switch costume to (3 v)\n    end\nend\n\n@Love/Fave\n\nwhen flag clicked\nhide\nforever\n    wait (pick random (40) to (50)) seconds\n    switch costume to (costume1 v)\n    go to x: (0) y: (50)\n    show\n    go to [front v] layer\n    repeat (9)\n        change y by (-6)\n    end\n    repeat (5)\n        change y by (3)\n    end\n    repeat (5)\n        change y by (-1)\n    end\n    wait (2) seconds\n    repeat (15)\n        change y by (7)\n    end\n    hide\nend\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\n@Thumbnail\n\nwhen flag clicked\nswitch costume to (1 v)\nforever\n    go to x: (0) y: (0)\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n@Love/Fave Detector\n\nwhen flag clicked\npoint in direction (90)\nhide\nset [clone id v] to [0]\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nwait until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\nwait (0.5) seconds\nshow\ngo to x: (0) y: (-100)\nreset timer\nswitch costume to (2 v)\nset [ghost v] effect to (100)\ngo [forward v] (2000) layers\nrepeat until <(timer) > [3.5]>\n    change y by ((y position) / (-15))\n    change [ghost v] effect by (-3)\nend\nreset timer\nrepeat until <(timer) > [3.5]>\n    change y by (((y position) - (-100)) / (-15))\n    change [ghost v] effect by (10)\nend\n\nwhen I start as a clone\nif <(clone id) = [0]> then\n    go to x: (-15) y: (0)\n    set [loved__ v] to [0]\n    switch costume to (love v)\n    forever\n        set [love? v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            wait (0.2) seconds\n            if <touching (mouse-pointer v)?> then\n                set [loved__ v] to [1]\n            end\n        end\n    end\nend\nif <(clone id) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (fave v)\n    set [faved___ v] to [0]\n    forever\n        set [fav v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            wait (0.2) seconds\n            if <touching (mouse-pointer v)?> then\n                set [faved___ v] to [1]\n            end\n        end\n    end\nend\n\n@Win Screen\n\nwhen flag clicked\nhide\n\nwhen I receive [win v]\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\n\n@Sun\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    show\n    go to x: (218) y: (160)\n    set size to (140) %\n    repeat (40)\n        change size by (0.6)\n    end\n    repeat (40)\n        change size by (-0.6)\n    end\nend\n\nwhen I receive [win v]\nhide\n\n