Scratch Blocks Platformer

Instructions: Instructions\n-Up Arrow - To Jump\n-Left Arrow - To Move Left\n-Right Arrow - To Move Right\n-m - mute music\n-u - unmute music

@Stage\n\n@Player2\n\nwhen flag clicked\npoint in direction (90)\nforever\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n        switch costume to (r1 v)\n        wait (.01) seconds\n        switch costume to (r2 v)\n        wait (.01) seconds\n        switch costume to (r3 v)\n        wait (.01) seconds\n        switch costume to (r4 v)\n        wait (.01) seconds\n        switch costume to (r5 v)\n        wait (.01) seconds\n        switch costume to (r6 v)\n        wait (.01) seconds\n        switch costume to (r7 v)\n        wait (.01) seconds\n        switch costume to (run_r5 v)\n        wait (.01) seconds\n        switch costume to (run_r6 v)\n        wait (.01) seconds\n        switch costume to (run_r7 v)\n        wait (.01) seconds\n        switch costume to (run_r8 v)\n        wait (.01) seconds\n        switch costume to (run_r9 v)\n        wait (.01) seconds\n        switch costume to (r8 v)\n        wait (.01) seconds\n        switch costume to (r9 v)\n        wait (.01) seconds\n        switch costume to (r10 v)\n        wait (.01) seconds\n        switch costume to (r11 v)\n        wait (.01) seconds\n        switch costume to (r12 v)\n        wait (.01) seconds\n        switch costume to (r13 v)\n        wait (.01) seconds\n        switch costume to (r14 v)\n        wait (.01) seconds\n    end\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n        switch costume to (r1 v)\n        wait (.01) seconds\n        switch costume to (r2 v)\n        wait (.01) seconds\n        switch costume to (r3 v)\n        wait (.01) seconds\n        switch costume to (r4 v)\n        wait (.01) seconds\n        switch costume to (r5 v)\n        wait (.01) seconds\n        switch costume to (r6 v)\n        wait (.01) seconds\n        switch costume to (r7 v)\n        wait (.01) seconds\n        switch costume to (run_r5 v)\n        wait (.01) seconds\n        switch costume to (run_r6 v)\n        wait (.01) seconds\n        switch costume to (run_r7 v)\n        wait (.01) seconds\n        switch costume to (run_r8 v)\n        wait (.01) seconds\n        switch costume to (run_r9 v)\n        wait (.01) seconds\n        switch costume to (r8 v)\n        wait (.01) seconds\n        switch costume to (r9 v)\n        wait (.01) seconds\n        switch costume to (r10 v)\n        wait (.01) seconds\n        switch costume to (r11 v)\n        wait (.01) seconds\n        switch costume to (r12 v)\n        wait (.01) seconds\n        switch costume to (r13 v)\n        wait (.01) seconds\n        switch costume to (r14 v)\n        wait (.01) seconds\n    end\nend\n\nwhen flag clicked\nswitch costume to (1 v)\nforever\n    if <(x position) > [239]> then\n        broadcast (Next Level v)\n        Re-Pos\n    end\n    if <[-165] > (y position)> then\n        Re-Pos\n    end\nend\n\nwhen flag clicked\nshow\nforever\n    Platform Gravity [-1] Jump Height [16] Side Movement Speed [3] Friction [0.7] Slope [8]\nend\n\ndefine Re-Pos\ngo to x: (-200) y: (-80)\n\nwhen flag clicked\nswitch costume to (1 v)\nshow\nset size to (50) %\nswitch costume to (purple 1 v)\nset [y velocity v] to [0]\nset [x velocity v] to [0]\nRe-Pos\n\ndefine Platform Gravity (gravity) Jump Height (jump height) Side Movement Speed (side movement) Friction (friction) Slope (slope)\nchange [y velocity v] by (gravity)\nchange y by (Y Velocity)\nif <touching (levels v)?> then\n    repeat until <not <touching (levels v)?>>\n        change y by ((([abs v] of (Y Velocity) ) / (Y Velocity)) * (-1))\n    end\n    set [y velocity v] to (<<key (up arrow v) pressed?> and <(([abs v] of (Y Velocity) ) / (Y Velocity)) = [-1]>> * (jump height))\nend\nset [x velocity v] to (((X Velocity) + ((<key (left arrow v) pressed?> * ((side movement) * (-1))) + (<key (right arrow v) pressed?> * (side movement)))) * (friction))\nchange x by (X Velocity)\nset [my variable v] to [0]\nif <touching (levels v)?> then\n    change y by (1)\n    repeat until <not <touching (levels v)?>>\n        change x by ((([abs v] of (X Velocity) ) / (X Velocity)) * (-1))\n    end\nend\n\nwait (.01) seconds\n\nwhen flag clicked\nset rotation style [left-right v]\n\n@Levels\n\nwhen flag clicked\nswitch costume to (costume1 v)\nforever\n    go to x: (0) y: (-5)\nend\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [25]> then\n        broadcast (GAME OVER v)\n    end\nend\n\n@Music\n\nwhen flag clicked\nforever\n    play sound [Tones and I - Dance Monkey v] until done\n    wait (.5) seconds\n    play sound [DANCE MONKEY  STREET SAX PERFORMANCE v] until done\n    wait (.5) seconds\n    play sound [TONES AND I  NEVER SEEN THE RAIN OFFICIAL VIDEO v] until done\n    wait (.5) seconds\n    play sound [TONES AND I  CANT BE HAPPY ALL THE TIME ANIMATED LYRIC VIDEO v] until done\n    wait (.5) seconds\nend\n\nwhen flag clicked\nset volume to (100) %\nforever\n    if <key (m v) pressed?> then\n        set volume to (0) %\n    end\n    if <key (u v) pressed?> then\n        set volume to (100) %\n    end\nend\n\n@Time\n\nwhen flag clicked\nset [m v] to [0]\nset [s10 v] to [0]\nset [s1 v] to [0]\nforever\n    wait (1) seconds\nend\n\nwhen flag clicked\nforever\n    wait (1) seconds\n    change [s1 v] by (1)\nend\n\nwhen flag clicked\nforever\n    if <(S1) = [10]> then\n        set [s1 v] to [0]\n        change [s10 v] by (1)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(S10) = [6]> then\n        set [s10 v] to [0]\n        change [m v] by (1)\n    end\nend\n\nwhen flag clicked\nforever\n    set [time v] to (join (M) (join [.] (join (S10) (S1))))\nend\n\nwhen I receive [game over v]\nstop [other scripts in sprite v]\n\n@Thumbnail\n\nwhen flag clicked\nshow variable [time v]\nhide\n\n