Earth - A Platformer [pt.1]

Instructions: - My first release!!\n\n- Project 2 - https://scratch.mit.edu/projects/486289443/\n- Project 3 - https://scratch.mit.edu/projects/486419716/\n - At the time of releasing this I don't have any followers but I hope I get noticed soon!\n - ( That was when I did release. And my gosh, 2k + veiws and 100 followers?!??! Thanks so much!!!! )\n\n - Use the arrow keys to move around. (Press r to restart!)\n\n - I would love it if you ⭐ And ❤️ !!!\n\nCredits to @RecordBoi for the Physics code, he makes some platformers himself! Go check him out!\nRest of the code and art by me

@Stage\n\n@Platforms\n\nwhen I receive [next level v]\nnext costume\n\nif <(costume [number v]) = [10]> then\n    stop [other scripts in sprite v]\nelse\n    next costume\nend\n\nwhen flag clicked\nswitch costume to (level 1 v)\ngo to x: (0) y: (0)\n\n@Spikes\n\nwhen flag clicked\nforever\n    switch costume to ([costume # v] of [platforms v])\nend\n\n@EarthCrystal\n\nwhen flag clicked\nshow\nforever\n    switch costume to ([costume # v] of [platforms v])\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        play sound [Collect v] until done\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        hide\n    end\nend\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen flag clicked\nforever\n    switch costume to ([costume # v] of [platforms v])\nend\n\n@Thumb\n\nwhen flag clicked\ngo to [front v] layer\nhide\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.001)\nshow\ngo to [front v] layer\ngo to x: (0) y: (375)\nrepeat until <(y position) = [0]>\n    change y by (((y position) / (5)) * (-1))\nend\n\n@detector\n\nwhen flag clicked\nhide\nset [faved___ v] to [0]\nset [loved__ v] to [0]\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 (1) seconds\nshow\ngo to x: (0) y: (50)\nreset timer\nswitch costume to (pick random (1) to (4))\nset [ghost v] effect to (100)\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            set [loved__ v] to [1]\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            set [faved___ v] to [1]\n        end\n    end\nend\n\n@Player\n\nwhen I receive [next level v]\nbroadcast (Restart v)\n\nwhen I receive [restart v]\ngo to x: (-220) y: (-30)\nset [y v] to [0]\n\nwhen [r v] key pressed\nbroadcast (Restart v)\n\nwhen flag clicked\nbroadcast (Restart v)\nswitch costume to (earth v)\nshow\nset [x v] to [0]\nset [y v] to [0]\nforever\n    go to [front v] layer\n    if <touching (ladders v)?> then\n        set [y v] to [0]\n        if  then\n            change [y v] by (8)\n        end\n        if <<key (down arrow v) pressed?> or <<mouse down?> and <(y position) > (mouse y)>>> then\n            change [y v] by (-8)\n        end\n        if <not <touching (ladders v)?>> then\n            set [y v] to [15]\n        end\n    else\n        change [y v] by (-1)\n    end\n    if <<key (left arrow v) pressed?> or <<mouse down?> and <(y position) > (mouse y)>>> then\n        change [x v] by (-1)\n        point in direction (-90)\n    end\n    if <<key (right arrow v) pressed?> or <<mouse down?> and <(y position) > (mouse y)>>> then\n        change [x v] by (1)\n        point in direction (90)\n    end\n    set [x v] to ((X) * (0.9))\n    change x by (X)\n    if <touching (platforms v)?> then\n        change y by (1)\n    end\n    if <touching (platforms v)?> then\n        change y by (1)\n    end\n    if <touching (platforms v)?> then\n        change y by (1)\n    end\n    if <touching (platforms v)?> then\n        change y by (1)\n    end\n    if <touching (platforms v)?> then\n        change y by (-4)\n        change x by ((X) * (-1))\n        if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [y v] to [15]\n            if <([abs v] of (X) ) = (X)> then\n                set [x v] to [-10]\n            else\n                set [x v] to [10]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (Y)\n    if <touching (platforms v)?> then\n        change y by ((Y) - ((Y) * (2)))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> and <touching (platforms v)?>> then\n        set [y v] to [15]\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nplay sound [Intryx - Lost in the Dark v] until done\n\nwhen flag clicked\nshow\nforever\n    if <<(x position) > [230]> and <touching (_edge_ v)?>> then\n        broadcast (Next level v)\n    end\n    if <<touching (spikes v)?> or <<touching (lava v)?> or <<(y position) < [-170]> and <touching (_edge_ v)?>>>> then\n        broadcast (Restart v)\n    end\n    if <touching (bounce v)?> then\n        set [y v] to [20]\n    end\nend\n\n@Sprite2\n\n