Dash 2! | A Multiplayer Mobile Friendly Platformer!

Instructions: *NEW GAME*\nhttps://scratch.mit.edu/projects/621959765/\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nTurbowarp Link: https://turbowarp.org/605485608/fullscreen?interpolate&hqpen\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nWelcome To Dash 2!\nThis Is a Remake Of My First and Most Liked Game, Dash!\nA Like and Favorite Would Be Appreciated!\nMaybe Even A Follow? XD\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nAnyway, Here is Everything That This Platformer Has To Give:\nMultiplayer With Up To 8 People\nMobile Friendly\nJoystick Visual\nEnemies\nSpikes\nLava\nWalljumping\nAnd More!\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nExtra:\nOne Level Was Designed By My Friend At School\nFont For Text Is Comfortaa\nMultiplayer is by Griffpatch\nGriffpatch For Shadow And Outline Code\n\n

@Stage\n\nwhen flag clicked\nset [max players v] to [8]\nset [my player # v] to [0]\nbroadcast (Connecting v)\nbroadcast (Setup Others v) and wait\nbroadcast (Join Game v) and wait\nif <(MY PLAYER #) > [0]> then\n    broadcast (Connected v)\n    start sound [Connect v]\nelse\n    broadcast (Full v)\n    start sound [Disconnect v]\nend\nbroadcast (Setup v) and wait\nbroadcast (Play Game v) and wait\n\nwhen I receive [connected v]\nwait (1) seconds\nforever\n    set volume to (60) %\n    play sound [TA-OpeningTheme v] until done\nend\n\nwhen flag clicked\nforever\n    switch backdrop to (join [backdrop] (Level))\nend\n\n@Blank\n\n@Player\n\ndefine Platformer Physics\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<(mouse x) > (x position)> and <mouse down?>>> then\n    switch costume to (right v)\n    change [xvel v] by (0.8)\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<(mouse y) > ((y position) + (30))> and <mouse down?>>> then\n        switch costume to (right up v)\n    end\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<(x position) > (mouse x)> and <mouse down?>>> then\n    switch costume to (left v)\n    change [xvel v] by (-0.8)\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<(mouse y) > ((y position) + (30))> and <mouse down?>>> then\n        switch costume to (left up v)\n    end\nend\nset [xvel v] to ((Xvel) * (0.9))\nchange x by (Xvel)\nif <<touching (level v)?> or <touching color (#000000)?>> then\n    change y by (1)\n    if <<touching (level v)?> or <touching color (#000000)?>> then\n        change y by (1)\n        if <<touching (level v)?> or <touching color (#000000)?>> then\n            change y by (1)\n            if <<touching (level v)?> or <touching color (#000000)?>> then\n                change y by (1)\n                if <<touching (level v)?> or <touching color (#000000)?>> then\n                    change y by (1)\n                    if <<touching (level v)?> or <touching color (#000000)?>> then\n                        change x by ((Xvel) * (-1))\n                        change y by (-5)\n                        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<(mouse y) > ((y position) + (30))> and <mouse down?>>> then\n                            if <(Xvel) > [0]> then\n                                set [xvel v] to [-5]\n                            else\n                                set [xvel v] to [5]\n                            end\n                            set [yvel v] to [12]\n                        else\n                            set [xvel v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange [yvel v] by (-1)\nchange y by (Yvel)\nif <<touching (level v)?> or <touching color (#000000)?>> then\n    change y by ((Yvel) * (-1))\n    set [yvel v] to [0]\nend\nchange y by (-1)\nif <<touching (level v)?> or <touching color (#000000)?>> then\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<(mouse y) > ((y position) + (30))> and <mouse down?>>> then\n        set [yvel v] to [14]\n        if <not <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<(mouse x) > (x position)> and <mouse down?>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<(x position) > (mouse x)> and <mouse down?>>>>> then\n            switch costume to (up v)\n        end\n    end\nend\nchange y by (1)\nif <(x position) > [239]> then\n    if <not <(Level) = [11]>> then\n        broadcast (Level Change v)\n        change [level v] by (1)\n        set [yvel v] to [0]\n        set [xvel v] to [0]\n        go to x: (-205) y: (-35)\n    end\nend\nif <<<touching (spikes v)?> or <touching (lava v)?>> or <touching (enemies v)?>> then\n    start sound [Crunch v]\n    go to x: (-205) y: (-35)\n    set [yvel v] to [0]\n    set [xvel v] to [0]\nend\nif <not <<<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<(mouse x) > (x position)> and <mouse down?>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<(x position) > (mouse x)> and <mouse down?>>>> or <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<(mouse y) > ((y position) + (30))> and <mouse down?>>>>> then\n    switch costume to (idle v)\nend\n\nwhen I receive [setup v]\ngo to x: (-205) y: (-35)\nset [xvel v] to [0]\nset [yvel v] to [0]\nset [chat v] to (username)\nswitch costume to (idle v)\nshow\n\nwhen I receive [play game v]\nforever\n    Platformer Physics\n    if <(MY PLAYER #) > [0]> then\n        send cloud data\n    end\nend\n\nwhen flag clicked\nhide\n\ndefine send cloud data\nset [encoded v] to []\nwrite (chat) to encoded\nwrite (round ((timer) * (10))) to encoded\nwrite (x position) to encoded\nwrite (y position) to encoded\nwrite (costume [number v]) to encoded\nwrite ([costume # v] of [level v]) to encoded\nset cloud # (MY PLAYER #) to (encoded)\n\ndefine write (val) to encoded\nset [letter # v] to [1]\nrepeat (length of (val))\n    set [encoded v] to (join (encoded) (item # of (letter (letter #) of (val)) in [code v]))\n    change [letter # v] by (1)\nend\nset [encoded v] to (join (encoded) [00])\n\ndefine set cloud # (player) to (value)\nif <(player) = [1]> then\n    set [☁ p1 v] to (value)\nelse\n    if <(player) = [2]> then\n        set [☁ p2 v] to (value)\n    else\n        if <(player) = [3]> then\n            set [☁ p3 v] to (value)\n        else\n            if <(player) = [4]> then\n                set [☁ p4 v] to (value)\n            else\n                if <(player) = [5]> then\n                    set [☁ p5 v] to (value)\n                else\n                    if <(player) = [6]> then\n                        set [☁ p6 v] to (value)\n                    else\n                        if <(player) = [7]> then\n                            set [☁ p7 v] to (value)\n                        else\n                            if <(player) = [8]> then\n                                set [☁ p8 v] to (value)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [play game v]\nforever\n    if <not <(chat) = (username)>> then\n        say (chat) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (bouncer v)?> then\n        set [yvel v] to [20]\n    end\nend\n\n@Others\n\nwhen I receive [play game v]\nset [names v] to [1]\nforever\n    if <key (n v) pressed?> then\n        if <(names) = [1]> then\n            wait until <not <key (n v) pressed?>>\n            set [names v] to [0]\n        else\n            wait until <not <key (n v) pressed?>>\n            set [names v] to [1]\n        end\n    end\nend\n\nwhen I receive [setup others v]\nsetup others\n\ndefine setup others\nhide\nset [offline v] to [100]\nset [player # v] to [1]\nrepeat ((MAX PLAYERS) - (1))\n    create clone of (_myself_ v)\n    change [player # v] by (1)\nend\n\nwhen I receive [join game v]\nvalue = cloud # (player #)\nset [last value v] to (join [A] (value))\nwait (3) seconds\nvalue = cloud # (player #)\nif <(join [A] (value)) = (last value)> then\n    set [my player # v] to (player #)\nend\n\ndefine value = cloud # (player)\nif <(player) = [1]> then\n    set [value v] to (☁ P1)\nelse\n    if <(player) = [2]> then\n        set [value v] to (☁ P2)\n    else\n        if <(player) = [3]> then\n            set [value v] to (☁ P3)\n        else\n            if <(player) = [4]> then\n                set [value v] to (☁ P4)\n            else\n                if <(player) = [5]> then\n                    set [value v] to (☁ P5)\n                else\n                    if <(player) = [6]> then\n                        set [value v] to (☁ P6)\n                    else\n                        if <(player) = [7]> then\n                            set [value v] to (☁ P7)\n                        else\n                            if <(player) = [8]> then\n                                set [value v] to (☁ P8)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [play game v]\nforever\n    if <(MY PLAYER #) = (player #)> then\n        set [offline v] to [100]\n        hide\n    else\n        Tick\n    end\nend\n\ndefine Tick\nvalue = cloud # (player #)\nif <(join [A] (value)) = (last value)> then\n    change [offline v] by (1)\n    if <(offline) = [100]> then\n        hide\n    end\nelse\n    set [last value v] to (join [A] (value))\n    if <(offline) > [99]> then\n        show\n    end\n    set [offline v] to [0]\nend\nbegin decode of (value)\nvalue = read from encoded\nif <(names) = [1]> then\n    say (value)\nelse\n    say []\nend\nvalue = read from encoded\nvalue = read from encoded\nset x to (value)\nvalue = read from encoded\nset y to (value)\nvalue = read from encoded\nswitch costume to (value)\nvalue = read from encoded\nif <([costume # v] of [level v]) = (value)> then\n    if <[100] > (offline)> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\nvalue = read from encoded\n\ndefine begin decode of (encoded)\nset [encoded v] to (encoded)\nset [letter # v] to [1]\n\ndefine value = read from encoded\nset [value v] to []\nforever\n    set [idx v] to (join (letter (letter #) of (encoded)) (letter ((letter #) + (1)) of (encoded)))\n    change [letter # v] by (2)\n    if <(idx) < [1]> then\n        stop [this script v]\n    end\n    set [value v] to (join (value) (item (idx) of [code v]))\nend\n\n@Level\n\nwhen I receive [setup v]\nset [level v] to [1]\n\nwhen I receive [play game v]\nshow\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\ndefine Stamp Shadow\nerase all\nset [brightness v] effect to (-100)\nset [ghost v] effect to (90)\nchange y by (-23.7)\nstamp\nchange y by (23.5)\nclear graphic effects\n\ndefine Stamp Outline\nset rotation style [don't rotate v]\nset [brightness v] effect to (-100)\nrepeat (8)\n    move (3) steps\n    stamp\n    move (-3) steps\n    turn right (45) degrees\nend\nclear graphic effects\n\nwhen I receive [finished v]\nforever\n    switch costume to (Level)\n    Stamp Shadow\n    Stamp Outline\nend\n\nwhen flag clicked\nerase all\n\nwhen I receive [level change v]\nerase all\n\n@Spikes\n\nwhen I receive [play game v]\nshow\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\ndefine Stamp Outline\nset rotation style [don't rotate v]\nset [brightness v] effect to (-60)\nrepeat (8)\n    move (3) steps\n    stamp\n    move (-3) steps\n    turn right (45) degrees\nend\nclear graphic effects\n\ndefine Stamp Shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (90)\nchange y by (-20)\nstamp\nchange y by (20)\nclear graphic effects\n\nwhen I receive [finished v]\nforever\n    switch costume to (Level)\n    Stamp Outline\n    Stamp Shadow\nend\n\n@Lava\n\nwhen I receive [play game v]\ngo to x: (0) y: (0)\nshow\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\ngo to [back v] layer\nhide\n\ndefine Stamp Outline\nset rotation style [don't rotate v]\nset [brightness v] effect to (-96)\nrepeat (8)\n    move (3) steps\n    stamp\n    move (-3) steps\n    turn right (45) degrees\nend\nclear graphic effects\n\ndefine Stamp Shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (90)\nchange y by (-20)\nstamp\nchange y by (20)\nclear graphic effects\n\nwhen I receive [finished v]\nforever\n    switch costume to (Level)\n    Stamp Outline\n    Stamp Shadow\nend\n\n@Loading\n\nwhen flag clicked\ngo to [front v] layer\nset size to (100) %\nhide\npoint in direction (90)\nclear graphic effects\ngo to x: (0) y: (-80)\n\nwhen I receive [connecting v]\nrepeat (11)\n    create clone of (_myself_ v)\n    turn right (40) degrees\nend\n\nwhen I receive [connected v]\nhide\ndelete this clone\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (100)\nforever\n    repeat (20)\n        turn right (7.5) degrees\n        change [ghost v] effect by (-6)\n        change size by (1)\n    end\n    repeat (20)\n        turn right (7.5) degrees\n        change [ghost v] effect by (6)\n        change size by (-1)\n    end\nend\n\n@Joining\n\nwhen I receive [connected v]\ngo to [front v] layer\ngo [backward v] (1) layers\nswitch costume to (connected v)\nshow\nwait (1) seconds\nbroadcast (Finished v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\ngo to x: (0) y: (40)\nhide\n\nwhen I receive [connecting v]\nshow\nswitch costume to (joining v)\n\nwhen I receive [full v]\nswitch costume to (full  v)\nshow\n\n@Bouncer\n\nwhen I receive [play game v]\nshow\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\ndefine Stamp Shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (90)\nchange y by (-40)\nstamp\nchange y by (40)\nclear graphic effects\n\ndefine Stamp Outline\nset rotation style [don't rotate v]\nset [brightness v] effect to (-92)\nrepeat (8)\n    move (3) steps\n    stamp\n    move (-3) steps\n    turn right (45) degrees\nend\nclear graphic effects\n\nwhen I receive [finished v]\nforever\n    switch costume to (Level)\n    Stamp Outline\n    Stamp Shadow\nend\n\n@Enemies\n\ndefine move back and forth. To X1: (x1 glide) To X2 (x2 glide) At Y: (y) Level: (level) Speed: (speed)\nset y to (y)\nset x to (x2 glide)\nswitch costume to (left v)\nshow\nrepeat until <not <(level) = (Level)>>\n    if <(level) = (Level)> then\n        point in direction (-90)\n        glide (speed) secs to x: (x1 glide) y: (y)\n        wait (1) seconds\n        point in direction (90)\n        glide (speed) secs to x: (x2 glide) y: (y)\n        wait (1) seconds\n    else\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [8]> then\n        move back and forth. To X1: [-123] To X2 [123] At Y: [-68] Level: [8] Speed: [2]\n    end\n    if <(Level) = [9]> then\n        move back and forth. To X1: [123] To X2 [213] At Y: [-68] Level: [9] Speed: [1]\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(Level) = [1]> or <<(Level) = [2]> or <<(Level) = [3]> or <<(Level) = [4]> or <<(Level) = <(Level) = [9]>> or <<(Level) = [6]> or <<(Level) = [7]> or <<(Level) = [9]> or <<(Level) = [10]> or <(Level) = [11]>>>>>>>>>> then\n        repeat (2)\n            hide\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(Level) = [8]> or <(Level) = []>> then\n        repeat (2)\n            show\n        end\n    end\nend\n\ngo to x: (213) y: (-68)\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\n@Joystick sprite\n\ndefine Joystick Max distance: (m)\ngo to x: (Center X) y: (Center Y)\npoint towards (mouse-pointer v)\nif <(distance to [mouse-pointer v]) > (m)> then\n    set [distance v] to (m)\nelse\n    set [distance v] to (distance to [mouse-pointer v])\nend\nmove (Distance) steps\nset [move input x v] to ((x position) - (Center X))\nset [move input y v] to ((y position) - (Center Y))\n\nwhen I receive [delete joystick clone v]\ndelete this clone\n\nwhen I start as a clone\nif <(ID) = [2]> then\n    forever\n        go to x: (((Center X) + ([x position v] of [joystick sprite v])) / (2)) y: (((Center Y) + ([y position v] of [joystick sprite v])) / (2))\n        go to [front v] layer\n    end\nend\n\nwhen I receive [play game v]\nset [ghost v] effect to (50)\nset [id v] to [0]\nforever\n    switch costume to (2 v)\n    if <mouse down?> then\n        show\n        go to (mouse-pointer v)\n        set [center x v] to (mouse x)\n        set [center y v] to (mouse y)\n        set [id v] to [1]\n        create clone of (_myself_ v)\n        set [id v] to [2]\n        create clone of (_myself_ v)\n        set [id v] to [2]\n        create clone of (_myself_ v)\n        set [id v] to [0]\n        repeat until <not <mouse down?>>\n            switch costume to (1 v)\n            Joystick Max distance: [200]\n            go to [front v] layer\n        end\n        broadcast (Delete joystick clone v)\n    else\n        hide\n        set [move input x v] to [0]\n        set [move input y v] to [0]\n    end\nend\n\nif <(mouse x) < [0]> then\n\n