ⓂⒶⓇⓈ - A Scrolling Platformer

Instructions: Oh no! You are trapped in the deep canyons of Mars. Can you find an exit? Arrow keys to move.\n\n\nWant more Platformers? Check out this studio:\nhttps://scratch.mit.edu/studios/27444915/

@Stage\n\n@blank\n\n@square\n\nwhen I receive [start v]\n\nnext costume\n\nif <(costume [number v]) = [1]> then\n    next costume\nend\n\n\n\nset size to (100) %\npoint in direction (90)\nset rotation style [all around v]\nrepeat (10)\n    turn right (1) degrees\n    change size by (-1)\n    move (-0.5) steps\nend\n\nwhen flag clicked\ngo to x: (0) y: (platform ypos)\nset rotation style [left-right v]\npoint in direction (90)\nset size to (75) %\nshow\nforever\n    point in direction ((VelocityX) * (-2))\nend\n\nwait until <touching (platform v)?>\n\n\n\ndefine whoop\n\nwhen I receive [end v]\nhide\n\nwhen flag clicked\nwait (3) seconds\nforever\n    if <touching color (#ffff52)?> then\n        broadcast (end v)\n    end\nend\n\n\n\nturn left (15) degrees\n\n@platform\n\ndefine set size to (dimensions)\nswitch costume to (0 v)\nset size to (dimensions) %\nnext costume\n\nwhen flag clicked\ngo to x: (xpos) y: (130)\nset [xpos v] to [0]\nset [debug y? v] to [false]\nset [platform ypos v] to [0]\nset [jump v] to [0]\nset [jump speed v] to [1]\nset [jump power v] to [15]\nset [jumping? v] to [false]\nset [falling? v] to [false]\npoint in direction (90)\nset size to [600]\nshow\nset [brightness v] effect to (5)\nset [color v] effect to (-8)\nforever\n    if <(y position) > [290]> then\n        wait (0.6) seconds\n        broadcast (whoop v)\n    end\nend\n\nwhen I receive [whoop v]\ngo to x: (xpos) y: ((platform ypos) - (3))\n\ndefine debug ypos\nrepeat until <not <touching (square v)?>>\n    change y by (-1)\nend\n\ndefine jump\nset [jumping? v] to [true]\nset [jump v] to (() - (jump power))\nrepeat (jump power)\n    change [jump v] by (jump speed)\n    change y by (jump)\nend\nset [jumping? v] to [false]\nfall\n\n\n    set [jump v] to [0]\nend\n\n\ndefine fall\nset [falling? v] to [true]\nrepeat until <touching (square v)?>\n    change [jump v] by (() - (jump speed))\n    change y by (() - (jump))\nend\nset [falling? v] to [false]\n\nset [color v] effect to (0)\n\nwhen flag clicked\nforever\n    play sound [Vexento - Syndrome v] until done\nend\n\nforever\n    if <<not <key (up arrow v) pressed?>> and <(jumping?) = <[0] = [1]>>> then\n        fall\n    end\nend\n\nfall\n\nwhen flag clicked\nforever\n    if <key (up arrow v) pressed?> then\n        jump\n    end\nend\n\n\n\nwhen flag clicked\nset [speed v] to [1.8]\nforever\n    if <key (left arrow v) pressed?> then\n        change [velocityx v] by (Speed)\n    end\n    if <key (right arrow v) pressed?> then\n        change [velocityx v] by (() - (Speed))\n    end\n    set [velocityx v] to ((VelocityX) * (0.75))\n    change x by (VelocityX)\nend\n\nbroadcast (whoop v)\n\nwhen I receive [end v]\nhide\n\n\n\nwait until \n\nwhen flag clicked\ndebug ypos\n\nforever\n\ndebug ypos\n\ndefine change size by (var)\nswitch costume to (0 v)\nchange size by (var)\nnext costume\n\nset size to (100) %\n\nset y to (-386)\n\ndebug ypos 2\n\ndefine debug ypos 2\nrepeat until <touching (square v)?>\n    change y by (1)\nend\n\ndebug ypos\n\nwait (0.1) seconds\nfall\n\nwait (0.2) seconds\n\nwait (0.2) seconds\n\nfall\n\ndebug ypos\n\ndebug ypos\nfall\n\nwait until <touching (square v)?>\n\nwhen flag clicked\nforever\n    if <<(falling?) = <[0] = [1]>> and <(jumping?) = <[0] = [1]>>> then\n        debug ypos 2\n        debug ypos\n    end\nend\n\nturn right (() / (6)) degrees\n\nwait (0.05) seconds\n\nfall\n\nif <touching (square v)?> then\nelse\nend\n\ndebug ypos\n\nwait (0.2) seconds\n\n@room\n\nwhen I start as a clone\n\ncreate clone of (_myself_ v)\n\nrepeat (10)\n\nwhen flag clicked\nshow\ngo to [back v] layer\nset [sensitivity v] to [7]\nset size to [250]\nset [brightness v] effect to (0)\nshow\nset [brightness v] effect to (-10)\npoint in direction (90)\nforever\n    glide (0.05) secs to x: (round (([x position v] of [platform v]) / (sensitivity))) y: (round (([y position v] of [platform v]) / (sensitivity)))\nend\n\nturn left (VelocityX) degrees\n\ndefine set size to (dimensions)\nswitch costume to (0 v)\nset size to (dimensions) %\nnext costume\n\nwhen I receive [end v]\nhide\n\npoint in direction (90)\n\n@Sprite1\n\nwhen I receive [end v]\nshow\nset [brightness v] effect to (-100)\nrepeat (20)\n    change [brightness v] effect by (5)\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\n@thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nset [ghost v] effect to (100)\n\n