Diamond Planet | Scrolling Platformer

Instructions: --------------------->     Diamond Planet\nYou have a single task, parkour to the end of the obstacles to get back to your home          How to play↴\n\nHow to play: To move use WASD or arrow keys, don't fall off the platform or you will lose. Parkour all the way to the other side to beat the game, THERE ARE CHECKPOINTS because many people were asking for that in the last game. This is a scrolling platformer. \n  ----------> CLICK SPACE TO SKIP INTRO <----------\n   \nThe things you should do: Love and favorite this game maybe even a follow :D... why? because It took a lot of time and effort to make this game. If don't want to that's fine! Tell me your score in the comments!\n\nJOIN THE STUDIO!!: https://scratch.mit.edu/studios/27975986/projects/\n\nCredits:\n@Thepugmen (me): All Art, Gameplay, and 60% of code \n\n@noodlebot743: for the other 40% of code\n\ndimrain47: intro music\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n------------------------------------------->\n#game #Game #GAME #Fun #FUN #happy #HAPPY #Moon #space #unstoppable #project #Thepugmen #Play #platfomer #Platfomer #Mobile #LOVE #Favrote #Now #trending #dimrain47 #Music #Art #Animation #Games #Scratch #Dodge #Ar #Music #Enemy #Enemies #Space #Orange #Playing #Dodging #Play #Square #Cube #Thumbnail #Colors  #Cool #Awesome #Good #Great #Walking #Moving #Comment #Sequel #Difficulty #Wave  #Hard #Animations #All  #Art #Music #Stories #Tutorials

@Stage\n\nwhen I receive [flag v]\nwait (0.45) seconds\nforever\n    play sound [Art of Silence - Dramatic _ Cinematic \[Free to use\]2 v] until done\nend\n\n@back\n\nwhen flag clicked\nhide\n\nwhen I receive [flag v]\nshow\nforever\n    go to (player v)\nend\n\nwhen flag clicked\nforever\n    point in direction (direction)\nend\n\nwhen I receive [flag v]\nforever\n    go to (player v)\n    go to (player v)\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [hide v]\nhide\n\n@Player\n\nif <(X) > [0]> then\n    set [x v] to [5]\nelse\n    set [x v] to [-5]\nend\nset [y v] to [10]\n\nchange [playerx v] by \n\nchange [playerx v] by \n\nwhen I receive [flag v]\nset rotation style [left-right v]\nclear graphic effects\nset [playerx v] to (Checkpoint)\nset [x v] to [0]\npoint in direction (90)\nset size to (100) %\nshow\ngo to x: (0) y: (180)\nset [y v] to [0]\nset y to (180)\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [x v] by (.9)\n        point in direction (90)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [x v] by (-.9)\n        point in direction (-90)\n    end\n    set [x v] to ((X) * (0.9))\n    change [playerx v] by (X)\n    if <touching (ground v)?> then\n        change y by (1)\n        if <touching (ground v)?> then\n            change y by (1)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (1)\n                        if <touching (ground v)?> then\n                            change y by (-4)\n                            change [playerx v] by ((X) * (-2))\n                            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                                if <(X) < [0]> then\n                                    set [x v] to [5]\n                                else\n                                    set [x v] to [-5]\n                                end\n                                set [y v] to [10]\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 (ground v)?> then\n        change y by ((Y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <touching (ground v)?> then\n        if <<<key (up arrow v) pressed?> or <[] = [1]>> or <key (w v) pressed?>> then\n            set [y v] to [14]\n        end\n    end\n    if <<(y position) < [-179]> or <touching (knifes >:\) v)?>> then\n        broadcast (die v)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        repeat until <(round (PlayerX)) = (Checkpoint)>\n            change [playerx v] by (((Checkpoint) - (PlayerX)) / (7))\n        end\n        set [playerx v] to (Checkpoint)\n        point in direction (90)\n        set size to (100) %\n        show\n        go to x: (0) y: (180)\n        set [x v] to [0]\n        set [y v] to [0]\n        set y to (180)\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n    end\n    if <[7300] < (PlayerX)> then\n        broadcast (end v)\n    end\nend\n\nwhen flag clicked\nset [first? v] to [0]\nset [checkpoint v] to [0]\nhide\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ndelete this clone\n\nwhen I receive [flag v]\nforever\n    set [direction v] to (direction)\nend\n\nwhen I receive [hide v]\nhide\n\n@Ground\n\nwhen I receive [flag v]\nclear graphic effects\nswitch costume to (costume2 v)\nrepeat (16)\n    next costume\n    create clone of (_myself_ v)\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ndelete this clone\n\nwhen flag clicked\nhide\n\ndefine set x to (number1) (number2)\nforever\n    if <<(PlayerX) > ((number1) - (960))> or <((number1) + (960)) > (PlayerX)>> then\n        switch costume to (costume2 v)\n        go to x: ((0) - ((PlayerX) + ((0) - (number1)))) y: (0)\n        switch costume to (number2)\n        show\n    else\n        hide\n    end\nend\n\nwhen I start as a clone\nshow\nset x to (((costume [number v]) - (2)) * (480)) (costume [number v])\n\n@Checkpoint\n\nwhen I start as a clone\nif <not <(First?) = [0]>> then\n    set [ghost v] effect to (100)\n    hide\nend\nforever\n    set y to (by)\n    if <touching (player v)?> then\n        change [first? v] by (1)\n        set [checkpoint v] to (bx)\n        repeat (10)\n            change [ghost v] effect by (10)\n            change y by (-1)\n        end\n        delete this clone\n    end\nend\n\nwhen I receive [flag v]\nswitch costume to (costume1 v)\nset [checkpointx v] to [3551]\nset [checkpointy v] to [148]\ncreate clone of (_myself_ v)\n\nwhen I receive [end v]\nset [checkpoint v] to [0]\nset [first? v] to [0]\nhide\ndelete this clone\n\nwhen flag clicked\nset [ghost v] effect to (0)\nhide\n\ndefine set x to (number1) (number2) set y to (number3)\ngo to [front v] layer\nforever\n    turn left (1) degrees\n    if <<(PlayerX) > ((number1) - (960))> or <((number1) + (960)) > (PlayerX)>> then\n        switch costume to (costume2 v)\n        set x to ((0) - ((PlayerX) + ((0) - (number1))))\n        switch costume to (number2)\n        show\n    else\n        hide\n    end\nend\n\nwhen I start as a clone\nset [bx v] to (CheckpointX)\nset [by v] to (CheckpointY)\nshow\nset x to (bx) (costume [number v]) set y to (by)\n\n@Tumbnaill\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    reset timer\n    hide\nend\n\nwhen [timer v] > (0.002)\ngo to [front v] layer\nbroadcast (hide v)\ngo to x: (0) y: (200)\nset [brightness v] effect to (45)\nstart sound [ding v]\nshow\nrepeat (45)\n    change y by (((0) - (y position)) / (7))\n    change [brightness v] effect by (-1)\nend\n\n@introduction \n\nwhen flag clicked\nwait (2.9) seconds\nforever\n    repeat (10)\n        change size by (3)\n    end\n    repeat (3)\n        change size by (-3)\n    end\nend\n\nwhen I receive [end v]\nbroadcast (love and fav  v)\ngo to x: (0) y: (100)\nswitch costume to (costume40 v)\npoint in direction (90)\nset size to (4) %\ngo to [front v] layer\nshow\nrepeat (25)\n    change size by (4)\n    turn right (14.4) degrees\nend\nset size to (100) %\n\nwhen I receive [menu v]\nswitch costume to (costume2 v)\ngo to [front v] layer\nhide\n\ndefine intro\ngo to [front v] layer\ngo to [front v] layer\nshow\nstart sound [intro song v]\nrepeat until <(costume [number v]) = [16]>\n    next costume\nend\nswitch costume to (costume17 v)\nrepeat until <(costume [number v]) = [32]>\n    wait (.0003) seconds\n    next costume\nend\nswitch costume to (costume33 v)\nrepeat until <(costume [number v]) = [38]>\n    wait (.0003) seconds\n    next costume\nend\nwait (6) seconds\nbroadcast (flag v)\nhide\nstop [other scripts in sprite v]\n\nwhen flag clicked\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\npoint in direction (90)\nset size to (100) %\nintro\n\nwhen flag clicked\nforever\n    if <key (space v) pressed?> then\n        stop all sounds\n        stop [other scripts in sprite v]\n        broadcast (flag v)\n        hide\n        stop [this script v]\n    end\nend\n\n@loves, favs\n\nwhen I receive [end v]\nhide\nforever\n    wait (.3) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nswitch costume to (pick random (1) to (2))\nset size to (0) %\ngo to (random position v)\npoint in direction (pick random (-180) to (180))\nset [ghost v] effect to (50)\nrepeat (20)\n    change size by (2)\nend\nwait (2) seconds\nrepeat (15)\n    change size by (-2)\nend\ndelete this clone\n\nbroadcast (THE END :\) v)\n\nwhen I receive [love and fav  v]\nhide\nforever\n    wait (.3) seconds\n    create clone of (_myself_ v)\nend\n\n@Scrolling BG\n\nwhen I receive [flag v]\nclear graphic effects\nswitch costume to (costume2 v)\nrepeat (16)\n    next costume\n    create clone of (_myself_ v)\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ndelete this clone\n\nwhen flag clicked\nhide\n\ndefine set x to (number1) (number2)\nforever\n    if <<(PlayerX) > ((number1) - (960))> or <((number1) + (960)) > (PlayerX)>> then\n        switch costume to (costume2 v)\n        go to x: ((0) - ((PlayerX) + ((0) - (number1)))) y: (0)\n        go to [back v] layer\n        switch costume to (number2)\n        show\n    else\n        hide\n    end\nend\n\nwhen I start as a clone\nshow\nset x to (((costume [number v]) - (2)) * (480)) (costume [number v])\n\n