My Platformer

Instructions: Use arrow keys \nCollect coins before time runs out\nSorry not mobile friendly

@Stage\n\n@player\n\nwhen flag clicked\nset rotation style [left-right v]\nset [yvelocity v] to [0]\nset [frames v] to [0]\nset [framespercoustume v] to [4]\nforever\n    change [yvelocity v] by (-2)\n    change y by (Yvelocity)\n    change [inair v] by (1)\n    HandleGround <(Yvelocity) > [0]>\nend\n\nwhen flag clicked\nforever\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        point in direction (-90)\n        Walk [-6]\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        point in direction (90)\n        Walk [6]\n    end\n    if <<not <<key (left arrow v) pressed?> or <key (a v) pressed?>>> and <<not <key (right arrow v) pressed?>> or <key (d v) pressed?>>> then\n        set [frames v] to [0]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(y position) < [-170]> then\n        set [yvelocity v] to [0]\n        set y to (170)\n    end\nend\n\nset x to (170)\n\ndefine HandleGround <movingup>\nswitch costume to (hitboxxxx v)\nrepeat until <not <touching (platformerbackdrophitbox v)?>>\n    if <movingup> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [inair v] to [0]\n    end\n    set [yvelocity v] to [0]\nend\nSetCorrectCoustume\n\nHandleGround <>\n\ndefine Walk (steps)\nswitch costume to (hitboxxxx v)\nchange x by (steps)\nset [groundlift v] to [0]\nrepeat until <<not <touching (platformerbackdrophitbox v)?>> or <(GROUNdLIFT) = [8]>>\n    change y by (1)\n    change [groundlift v] by (1)\nend\nif <(GROUNdLIFT) = [8]> then\n    change x by ((-1) * (steps))\n    change y by (-8)\nend\nchange [frames v] by ((1) / (FramesPerCoustume))\nSetCorrectCoustume\n\nchange x by (-6)\n\nset [yvelocity v] to [0]\n\nHandleGround <>\n\nHandleGround <>\nchange x by (10)\n\nwhen flag clicked\nforever\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(InAir) < [8]>> then\n        set [yvelocity v] to [14]\n    end\nend\n\nrepeat until <not <touching (sprite1 v)?>>\n    set [yvelocity v] to [0]\n    change y by (1)\nend\n\nset [yvelocity v] to [0]\n\n\n    point in direction (-90)\n    Walk [-6]\nend\n\npoint in direction (90)\nWalk [6]\n\ndefine SetCorrectCoustume\nif <(InAir) < [3]> then\n    if <(Frames) = [0]> then\n        switch costume to (stand v)\n    else\n        switch costume to ([floor v] of ((4) + ((Frames) mod (8))) )\n    end\nelse\n    if <(Yvelocity) > [0]> then\n        switch costume to (jump v)\n    else\n        switch costume to (fall v)\n    end\nend\n\n\n\nwhen flag clicked\nforever\n    if <(x position) < [-230]> then\n        set x to (230)\n        if <(y position) < [5]> then\n            set y to (5)\n        end\n    else\n        if <(x position) > [230]> then\n            set x to (-230)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    say (username)\nend\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen I receive [message1 v]\nstop [other scripts in sprite v]\n\nset [☁ coin high score v] to [0]\n\nchange [☁ coin high score v] by (1)\n\n\n\n@coin\n\nwhen flag clicked\nset [coinscollected v] to [0]\nset size to (50) %\nforever\n    set [ghost v] effect to (100)\n    go to x: (pick random (-240) to (240)) y: (pick random (-180) to (80))\n    repeat until <not <touching (platformerbackdrophitbox v)?>>\n        go to x: (pick random (-240) to (240)) y: (pick random (-180) to (80))\n    end\n    set [ghost v] effect to (0)\n    repeat until <touching (player v)?>\n        next costume\n    end\n    wait until <touching (player v)?>\n    start sound [Coin v]\n    change [coinscollected v] by (1)\nend\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen I receive [message1 v]\nstop [other scripts in sprite v]\n\nwhen flag clicked\nforever\n    if <(☁ Coin High score) < (CoinsCollected)> then\n        set [☁ coin high score v] to (CoinsCollected)\n    end\nend\n\nset [coinscollected v] to [70]\n\n@PlatformerBackdrop\n\n@PlatformerBackdropHitbox\n\nplay sound [Itty Bitty 8 Bit v] until done\n\nplay sound [Itty Bitty 8 Bit v] until done\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\n\nwhen flag clicked\nset [☁ coin high score v] to (☁ Coin High score)\nset [time v] to [60]\nforever\n    repeat until <(Time) = [0]>\n        change [time v] by (-1)\n        wait (1) seconds\n    end\n    if <(Time) = [0]> then\n        broadcast (message1 v)\n    end\nend\n\nwhen I receive [message1 v]\nif <(☁ Coin High score) < (CoinsCollected)> then\n    set [☁ coin high score v] to (CoinsCollected)\nend\nsay (join [you have: ] (join (CoinsCollected) (username)))\nwait (1) seconds\nbroadcast (yes v)\n\nwhen flag clicked\nrepeat until <(Time) = [0]>\n    play sound [Star Wars Cantina Song v] until done\nend\n\nwhen I receive [yes v]\nforever\n    if <(CoinsCollected) > (☁ Coin High score)> then\n        set [☁ highscore holder v] to (username)\n        say (join [Congrats! you have set the highscore!] (username))\n        wait (1) seconds\n        stop [all v]\n    else\n        stop [all v]\n    end\nend\n\nwhen flag clicked\n\nset [☁ coin high score v] to [1]\n\nset [coinscollected v] to [110]\n\n