Platformer rush

Instructions: New game!!!\nhttps://scratch.mit.edu/projects/494798727/\nWelcome to my new platform game !!\nPlatformer rush !!\nTry to pass only 10 levels as fast as possible and beat other people's world records !!\n\n\n--Instructions--\n-Use the directional keys to move the player.\n- Avoids spikes and lava.\n-You can walljumping !!\n-On level 10 to open the door, touch the yellow button with the player.\n\n--Credits--\n- @amazingQ for some codes, for the idea and title !!!\n- Art-me !!!\n\nPlease love and fave !!!!\nAnd if you like my projects follow me !!\n\nAnd, That's all!!

@Stage\n\nwhen flag clicked\nRestart\nshow\nset [level v] to [1]\nforever\n    Physics\n    if <touching (next level v)?> then\n        broadcast (message1 v) and wait\n        Restart\n        change [level v] by (1)\n    end\n    if <touching (lava v)?> then\n        Restart\n    end\nend\n\ndefine Physics\nif <key (right arrow v) pressed?> then\n    change [x v] by (2)\n    switch costume to (traje 1 v)\nend\nif <key (left arrow v) pressed?> then\n    change [x v] by (-2)\n    switch costume to (traje 2 v)\nend\nchange x by (x)\nif <touching (level v)?> then\n    change x by ((x) * (-1))\n    if <key (up arrow v) pressed?> then\n        if <[0] < (x)> then\n            set [x v] to [-10]\n            set [y v] to [10]\n        else\n            set [x v] to [10]\n            set [y v] to [10]\n        end\n    else\n        set [x v] to [0]\n    end\nelse\n    set [x v] to ((x) * (0.8))\nend\nchange y by (y)\nif <touching (level v)?> then\n    change y by ((y) * (-1))\n    set [y v] to [0]\n    if <key (up arrow v) pressed?> then\n        if <(Jumping?) = [y]> then\n            set [y v] to [12]\n            set [jumping? v] to [n]\n        end\n    end\nelse\n    change [y v] by (-1)\n    set [jumping? v] to [y]\nend\n\ndefine Slope Detection\nset [slope v] to [0]\nrepeat until <<(Slope) = [8]> or <not <touching (level v)?>>>\n    change y by (1)\n    change [slope v] by (1)\nend\nif <touching (level v)?> then\n    change y by (-8)\nend\n\ndefine Restart\nswitch costume to (traje 1 v)\nset [x v] to [0]\nset [y v] to [0]\ngo to x: (-125) y: (20)\n\n@level\n\nwhen flag clicked\nshow\n\nwhen I receive [end v]\nchange [level v] by (1)\nnext costume\n\nwhen flag clicked\nset [level v] to [1]\nswitch costume to (costume1 v)\n\nwhen flag clicked\ngo to [back v] layer\nclear graphic effects\nforever\n    if <(level) = [11]> then\n        broadcast (super end v)\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [Video Game 2 v] until done\nend\n\n@Next Level\n\n@player\n\ndefine Platformer Physics (speed) (friction) (jump height)\nchange [y vel v] by (-1)\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [x vel v] by (speed)\n    switch costume to (costume1 v)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [x vel v] by ((speed) * (-1))\n    switch costume to (effect v)\nend\nset [x vel v] to ((X vel) * (friction))\nchange x by (X vel)\nset [slope v] to [0]\nif <<touching (sprite1 v)?> or <touching (level v)?>> then\n    repeat until <<not <<touching (sprite1 v)?> or <touching (level v)?>>> or <(slope) = [-8]>>\n        change [slope v] by (-1)\n        change y by (1)\n    end\nend\nif <<touching (sprite1 v)?> or <touching (level v)?>> then\n    change y by (slope)\n    repeat until <not <<touching (sprite1 v)?> or <touching (level v)?>>>\n        change x by ((([abs v] of (X vel) ) / (X vel)) * (-1))\n    end\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        if <(X vel) > [0]> then\n            set [x vel v] to [-12]\n        else\n            set [x vel v] to [12]\n        end\n        set [y vel v] to [12]\n    else\n        set [x vel v] to [0]\n    end\nend\nchange y by (Y vel)\nif <<touching (sprite1 v)?> or <touching (level v)?>> then\n    repeat until <not <<touching (sprite1 v)?> or <touching (level v)?>>>\n        change y by ((([abs v] of (Y vel) ) / (Y vel)) * (-1))\n    end\n    set [y vel v] to [0]\nend\nchange y by (-1)\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <touching (level v)?>> then\n    set [y vel v] to (jump height)\nend\nchange y by (1)\n\nwhen flag clicked\n\nwhen I receive [end v]\ngo to x: (-198) y: (-10)\n\nwhen I receive [hurt v]\ngo to x: (-198) y: (-10)\n\nwhen I start as a clone\nswitch costume to (effect v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-5)\nend\ndelete this clone\n\nwhen flag clicked\nclear graphic effects\nshow\ngo to [front v] layer\nset [level v] to [1]\nset [x vel v] to [0]\nset [y vel v] to [0]\nswitch costume to (costume1 v)\ngo to x: (-198) y: (-10)\npoint in direction (90)\nforever\n    Platformer Physics [1] [0.9] [13]\n    if <<<<touching (danger v)?> or <touching (lava v)?>> or <touching (snow monsters v)?>> or <touching (imposter v)?>> then\n        go to x: (-198) y: (-10)\n    end\n    if <touching ( ice trampoline v)?> then\n        set [y vel v] to [20]\n    end\n    if <touching (golden diamond v)?> then\n        broadcast (enter v)\n    end\n    if <touching (next level v)?> then\n        go to x: (-198) y: (-10)\n        broadcast (end v)\n    end\n    if <touching (button v)?> then\n        broadcast (button v)\n    end\n    if <not <touching (button v)?>> then\n        broadcast (button 2 v)\n    end\nend\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\n@danger\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [end v]\nnext costume\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    glide (0.75) secs to x: (-9) y: (-37)\n    glide (0.75) secs to x: (-9) y: (-42)\nend\n\n@Lava\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    glide (0.75) secs to x: (38) y: (33)\n    glide (0.75) secs to x: (38) y: (27)\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [end v]\nnext costume\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (188) y: (-27)\nswitch costume to (costume1 v)\n\nwhen I receive [end v]\nnext costume\n\nwhen I receive [button v]\nglide (3) secs to x: (188) y: (26)\n\nwhen I receive [button 2 v]\nglide (3) secs to x: (188) y: (-27)\n\n@button\n\nwhen flag clicked\nhide\nforever\n    if <(level) = [10]> then\n        go to x: (90) y: (53)\n        show\n    end\nend\n\nwhen I receive [button v]\nswitch costume to (costume2 v)\n\nwhen I receive [button 2 v]\nswitch costume to (costume1 v)\n\nwhen I receive [end v]\nhide\n\n@o actor 1\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(level) = [11]> then\n        show\n        go to x: (-17) y: (5)\n        glide (1) secs to x: (-15) y: (321)\n        stop [this script v]\n    end\nend\n\n@o actor 2\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(level) = [11]> then\n        wait (2) seconds\n        show\n        go to x: (312) y: (36)\n        glide (1) secs to x: (-36) y: (39)\n        stop [this script v]\n    end\nend\n\n@o actor 3\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(level) = [11]> then\n        wait (6) seconds\n        show\n        go to x: (389) y: (1)\n        glide (1) secs to x: (16) y: (1)\n        stop [this script v]\n    end\nend\n\n@Money\n\nwhen flag clicked\nset [digits v] to [1]\nrepeat (30)\n    create clone of (_myself_ v)\n    change [digits v] by (1)\nend\nhide\n\nwhen I start as a clone\nshow\nforever\n    go to [front v] layer\n    set size to (100) %\n    go to x: (((Digits) * (14)) - (183)) y: (147)\n    if <(length of (time)) < (Digits)> then\n        hide\n    else\n        show\n        switch costume to (letter (Digits) of (time))\n    end\nend\n\nwhen flag clicked\nset [☁ world record v] to [94]\nhide variable [☁ world record v]\nhide variable [time v]\nset [time v] to [0]\nrepeat until <(level) = [11]>\n    change [time v] by (1)\n    wait (0.25) seconds\nend\nif <(level) = [11]> then\n    hide\n    wait (2.5) seconds\n    show variable [time v]\n    wait (2.5) seconds\n    show variable [☁ world record v]\nend\nif <(time) < (☁ World record)> then\n    set [☁ world record v] to (time)\nend\n\n@TB\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n