☁ Sunset II Multiplayer Platformer
@Stage\n\nwhen flag clicked\nforever\n    set volume to (10) %\n    wait (0.1) seconds\n    play sound [Ikson - Waves \(Official\) v] until done\n    wait (0.1) seconds\n    play sound [Ikson - Last Summer \(Official\) v] until done\nend\n\n@player\n\nwhen flag clicked\nbroadcast (Connecting v)\nshow\nswitch costume to (front v)\ngo to x: (-200) y: (0)\nset [x v] to [0]\nset [y v] to [0]\nset [max players v] to [8]\nset [#my player v] to [0]\ndelete all of [buffer v]\nbroadcast (setup - opponents v) and wait\nbroadcast (join game v) and wait\nif <(#my Player) > [0]> then\n    broadcast (Connected v)\n    broadcast (Joined v)\n    wait (3) seconds\nelse\n    broadcast (Full v)\nend\nbroadcast (Begin v)\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\nwhen I receive [begin v]\nforever\n    player tick\n    send cloud data\nend\n\ndefine set cloud # (player) to (value)\nif <(player) = [1]> then\n    set [☁ player1 v] to (value)\nelse\n    if <(player) = [2]> then\n        set [☁ player2 v] to (value)\n    else\n        if <(player) = [3]> then\n            set [☁ player3 v] to (value)\n        else\n            if <(player) = [4]> then\n                set [☁ player4 v] to (value)\n            else\n                if <(player) = [5]> then\n                    set [☁ player5 v] to (value)\n                else\n                    if <(player) = [6]> then\n                        set [☁ player6 v] to (value)\n                    else\n                        if <(player) = [7]> then\n                            set [☁ player7 v] to (value)\n                        else\n                            set [☁ player8 v] to (value)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine send cloud data\nif <(#my Player) < [1]> then\n    stop [this script v]\nend\nadd (x position) to [buffer v]\nadd (y position) to [buffer v]\nchange [cloud timer v] by (1)\nif <(Cloud timer) < [3]> then\n    stop [this script v]\nend\nset [cloud timer v] to [0]\nset [encoded v] to []\nwrite (username) to encoded\nwrite (round ((timer) * (10))) to encoded\nrepeat (length of [buffer v])\n    write (item (1) of [buffer v]) to encoded\n    delete (1) of [buffer v]\nend\nset cloud # (#my Player) to (encoded)\nset cloud # (#my Player) to (encoded)\n\ndefine player tick\ncreate clone of (_myself_ v)\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [x v] by (.9)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [x v] by (-.9)\nend\nset [x v] to ((x) * (.9))\nchange x by (x)\nif <<touching (level v)?> or <touching (block v)?>> then\n    change y by (1)\n    if <<touching (level v)?> or <touching (block v)?>> then\n        change y by (1)\n        if <<touching (level v)?> or <touching (block v)?>> then\n            change y by (1)\n            if <<touching (level v)?> or <touching (block v)?>> then\n                change y by (1)\n                if <<touching (level v)?> or <touching (block v)?>> then\n                    change y by (1)\n                    if <<touching (level v)?> or <touching (block v)?>> then\n                        change y by (-5)\n                        change x by ((x) * (-1))\n                        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (10))>>> then\n                            if <(x) > [0]> then\n                                set [x v] to [-5]\n                            else\n                                set [x v] to [5]\n                            end\n                            set [y v] to [12]\n                        else\n                            set [x v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange [y v] by (-1)\nchange y by (y)\nif <<touching (level v)?> or <touching (block v)?>> then\n    change y by ((y) * (-1))\n    set [y v] to [0]\nend\nchange y by (-1)\nif <<touching (level v)?> or <touching (block v)?>> then\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (10))>>> then\n        change [y v] by (12)\n    end\nend\nchange y by (1)\nif <<touching (spikes v)?> or <touching (saws v)?>> then\n    broadcast (respawn v)\nend\nif <touching (trampoline v)?> then\n    change [y v] by (15)\nend\nif  then\n    set [y v] to [-2]\nend\n\nwhen flag clicked\nforever\n    if <not <<<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>>> or <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (10))>>>>> then\n        switch costume to (front v)\n    end\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        switch costume to (right v)\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        switch costume to (left v)\n    end\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (10))>>> then\n        switch costume to (up v)\n    end\n    if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> and <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (10))>>>> then\n        switch costume to (up right v)\n    end\n    if <<<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> and <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (10))>>>> then\n        switch costume to (up left v)\n    end\nend\n\nwhen I receive [next level v]\nset [x v] to [0]\nset [y v] to [0]\ngo to x: (-200) y: (0)\nif <(_ LEVEL) = [6]> then\n    go to x: (-200) y: (-34)\nend\nif <(_ LEVEL) = [7]> then\n    go to x: (-200) y: (-34)\nend\nif <(_ LEVEL) = [1]> then\n    go to x: (-200) y: (0)\nend\nif <(_ LEVEL) = [11]> then\n    go to x: (-250) y: (-34)\nend\nif <(_ LEVEL) = [3]> then\n    go to x: (-250) y: (0)\nend\nif <(_ LEVEL) = [15]> then\n    go to x: (-250) y: (0)\nend\nwait (1) seconds\n\nwhen I receive [respawn v]\npoint in direction (90)\ngo to x: (-200) y: (0)\nset [x v] to [0]\nset [y v] to [0]\nif <(_ LEVEL) = [6]> then\n    go to x: (-200) y: (-34)\nend\nif <(_ LEVEL) = [7]> then\n    go to x: (-200) y: (-34)\nend\nif <(_ LEVEL) = [3]> then\n    go to x: (-250) y: (0)\nend\nwait (1) seconds\n\nwhen I start as a clone\nswitch costume to (1 v)\nrepeat (10)\n    change [color v] effect by (25)\n    change size by (-2)\nend\ndelete this clone\n\nwhen I receive [connected v]\nforever\n    if <[237] < (x position)> then\n        broadcast (NEXT LEVEL v)\n    end\n    if <(x position) < [-245]> then\n        go to x: (-244) y: (y position)\n    end\n    if <(y position) < [-160]> then\n        broadcast (respawn v)\n    end\nend\n\nwhen I receive [connected v]\nforever\n    if <(#my Player) = [1]> then\n        set [☁ @ count? v] to [1]\n    else\n        if <(#my Player) = [2]> then\n            set [☁ @ count? v] to [2]\n        else\n            if <(#my Player) = [3]> then\n                set [☁ @ count? v] to [3]\n            else\n                if <(#my Player) = [4]> then\n                    set [☁ @ count? v] to [4]\n                else\n                    if <(#my Player) = [5]> then\n                        set [☁ @ count? v] to [5]\n                    else\n                        if <(#my Player) = [6]> then\n                            set [☁ @ count? v] to [6]\n                        else\n                            if <(#my Player) = [7]> then\n                                set [☁ @ count? v] to [7]\n                            else\n                                if <(#my Player) = [8]> then\n                                    set [☁ @ count? v] to [8]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwait (1) seconds\n\nwhen I receive [begin v]\n\n    delete all of [@level v]\n    add (_ LEVEL) to [@level v]\nend\n\n@other players\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\ndefine setup players\ndelete all of [buffer v]\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 [begin 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 value =cloud # (player)\nif <(player) = [1]> then\n    set [value v] to (☁ player1)\nelse\n    if <(player) = [2]> then\n        set [value v] to (☁ player2)\n    else\n        if <(player) = [3]> then\n            set [value v] to (☁ player3)\n        else\n            if <(player) = [4]> then\n                set [value v] to (☁ player4)\n            else\n                if <(player) = [5]> then\n                    set [value v] to (☁ player5)\n                else\n                    if <(player) = [6]> then\n                        set [value v] to (☁ player6)\n                    else\n                        if <(player) = [7]> then\n                            set [value v] to (☁ player7)\n                        else\n                            set [value v] to (☁ player8)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [setup - opponents v]\nsetup players\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]\n    begin decode of (value)\n    value =read from encoded\n    say (join (player #) (join [:] (value)))\n    value =read from encoded\n    value =read from encoded\n    repeat until <(value) = []>\n        add (value) to [buffer v]\n        value =read from encoded\n    end\nend\nif <(length of [buffer v]) > [0]> then\n    set x to (item (1) of [buffer v])\n    delete (1) of [buffer v]\n    set y to (item (1) of [buffer v])\n    delete (1) of [buffer v]\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\nwhen I receive [begin v]\nforever\nend\n\n@cloud\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nswitch costume to (connecting v)\ngo to [front v] layer\n\nwhen I receive [joined v]\nshow\nswitch costume to (connected v)\ngo to [front v] layer\n\nwhen I receive [full v]\nshow\nswitch costume to (server full v)\ngo to [front v] layer\n\nwhen I receive [begin v]\nhide\nif <(username) = []> then\n    show\n    switch costume to (no ac v)\nend\n\n@Level\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\ngo [backward v] (2) layers\nswitch costume to (level1 v)\nforever\n    go to x: (0) y: (0)\n    set [_ level v] to (costume [number v])\nend\n\nwhen I receive [next level v]\nnext costume\n\nswitch costume to ((costume [number v]) - (1))\n\n@Spikes\n\nwhen flag clicked\ngo to x: (28) y: (52)\nhide\nswitch costume to (1 v)\ngo to [back v] layer\nforever\n    show\n    repeat (10)\n        change y by (1)\n    end\n    repeat (10)\n        change y by (-1)\n    end\n    switch costume to (costume9 v)\nend\n\nwhen I receive [next level v]\n\nwhen flag clicked\ngo to x: (28) y: (52)\nhide\nswitch costume to (1 v)\ngo to [back v] layer\nforever\n    switch costume to (_ LEVEL)\nend\n\nshow\nrepeat (10)\n    change y by (1)\nend\nrepeat (10)\n    change y by (-1)\nend\n\n@Clouds\n\nwhen flag clicked\nset [ghost v] effect to (0)\nforever\n    hide\n    create clone of (_myself_ v)\n    wait (pick random (1.5) to (3)) seconds\nend\n\nwhen I start as a clone\nshow\nswitch costume to (pick random (1) to (5))\nif <(pick random (1) to (2)) = [2]> then\n    set [d v] to [-250]\nelse\n    set [d v] to [250]\nend\ngo to x: (d) y: (pick random (-130) to (170))\nset [ghost v] effect to (pick random (40) to (70))\nif <(d) = [250]> then\n    repeat until <(x position) < [-267]>\n        change x by (pick random (-1) to (-3))\n        go to [back v] layer\n        go to [back v] layer\n        go [backward v] (999) layers\n    end\nelse\n    repeat until <(x position) > [267]>\n        change x by (pick random (1) to (3))\n        go to [back v] layer\n        go to [back v] layer\n        go [backward v] (999) layers\n    end\nend\ndelete this clone\n\nwhen I receive [setup v]\ndelete this clone\n\n@Loading\n\nwhen flag clicked\ngo [forward v] (213) layers\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    go to [front v] layer\n    create clone of (_myself_ v)\n    turn right (40) degrees\nend\n\nwhen I receive [connected v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\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@ birds\n\nwhen I start as a clone\ngo to [front v] layer\nshow\nif <(costume [name v]) = [1]> then\n    forever\n        set size to (60) %\n        go to x: (-150) y: (0)\n        repeat (4)\n            bird inamation\n            switch costume to (2 v)\n            bird inamation\n            switch costume to (1 v)\n        end\n        repeat (6)\n            bird outamation\n            switch costume to (2 v)\n            bird outamation\n            switch costume to (1 v)\n        end\n        repeat (20)\n            change [ghost v] effect by (5)\n            change x by (2)\n        end\n        wait (3) seconds\n    end\nend\n\ndefine bird inamation\nrepeat (10)\n    change size by (1)\n    change x by (1)\n    change [ghost v] effect by (-2)\nend\n\ndefine bird outamation\nrepeat (10)\n    change x by (2)\n    change y by (0.2)\nend\ngo to [back v] layer\n\nwhen flag clicked\nhide\n\nwhen I receive [connected v]\nwait (1) seconds\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nwait (5) seconds\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\n\n@SFX\n\nwhen flag clicked\nset volume to (100) %\nforever\n    set volume to (100) %\n    play sound [Outdoor Ambience v] until done\nend\n\nwhen flag clicked\nset volume to (100) %\nforever\n    set volume to (100) %\n    play sound [Tropical Birds v] until done\nend\n\nwhen flag clicked\nset volume to (100) %\nforever\n    set volume to (50) %\n    play sound [Liquid-SoundBible v] until done\nend\n\n@Saws\n\nwhen I receive [start v]\ngo to [back v] layer\nhide\nswitch costume to (1 v)\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen flag clicked\nforever\n    hide\n    go to [back v] layer\n    if <(_ LEVEL) = [3]> then\n        go to [back v] layer\n        show\n        set size to (85) %\n        go to x: (-138) y: (-100)\n    end\n    if <(_ LEVEL) = [4]> then\n        go to x: (-24) y: (6)\n        go to [back v] layer\n        show\n        set size to (85) %\n    end\n    if <(_ LEVEL) = [12]> then\n        go to x: (152) y: (-94)\n        go to [back v] layer\n        show\n        set size to (85) %\n    end\n    if <(_ LEVEL) = [7]> then\n        go to x: (-71) y: (-92)\n        show\n        set size to (85) %\n    end\n    if <(_ LEVEL) = [13]> then\n        go to x: (-33) y: (-84)\n        show\n        set size to (85) %\n    end\n    if <(_ LEVEL) = [14]> then\n        show\n        set size to (85) %\n        go to x: (110) y: (118)\n    end\nend\n\nwhen I receive [end v]\nhide\n\nwhen flag clicked\nforever\n    turn right (10) degrees\nend\n\ngo [forward v] (1) layers\n\n@skip\n\nwhen flag clicked\nset [skips v] to [0]\nhide\n\nwhen this sprite clicked\nbroadcast (NEXT LEVEL v)\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (5))\n        set [brightness v] effect to (10)\n    else\n        change size by (((100) - (size)) / (5))\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I receive [doneee v]\nhide\n\nwhen I receive [begin v]\nset [color v] effect to (150)\nclear graphic effects\nset size to (100) %\nshow\ngo to x: (165) y: (161)\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nclear graphic effects\n\nwhen flag clicked\nforever\n    if <(_ LEVEL) = [17]> then\n        hide\n    else\n        show\n    end\nend\n\n@Trampoline\n\nhide\n\nwhen flag clicked\nhide\nforever\n    if <(_ LEVEL) = [1]> then\n        hide\n    end\n    hide\n    if <(_ LEVEL) = [7]> then\n        show\n        go to x: (5) y: (-70)\n    end\n    if <(_ LEVEL) = [13]> then\n        go to x: (-157) y: (-100)\n        show\n    end\nend\n\nwhen I receive [kill script v]\nhide\nstop [other scripts in sprite v]\n\n@block\n\nwhen flag clicked\nhide\n\ndefine Execute block (x) (y)\nswitch costume to (costume1 v)\nshow\ngo to x: (x) y: (y)\nrepeat (11)\n    create clone of (_myself_ v)\n    change x by (8)\nend\n\nwhen I start as a clone\nforever\n    if <<<[0] < (round (distance to [player v]))> and <[30] > (round (distance to [player v]))>> or <(round (distance to [player v])) = [28]>> then\n        wait (0.3) seconds\n        hide\n        wait (5) seconds\n        show\n    end\n    if <(_ LEVEL) = [12]> then\n        delete this clone\n    end\nend\n\nwhen I receive [begin v]\nforever\n    if <(_ LEVEL) = [10]> then\n        switch costume to (costume1 v)\n        Execute block [-81] [-40]\n        Execute block [66] [-40]\n        stop [this script v]\n    end\nend\n\nwhen I receive [begin v]\nforever\n    if <(_ LEVEL) = [11]> then\n        switch costume to (costume1 v)\n        show\n        Execute block [-214] [-140]\n        Execute block [-70] [-90]\n        stop [this script v]\n    end\nend\n\nwhen I receive [begin v]\nforever\n    if <(_ LEVEL) = [12]> then\n        hide\n    end\n    if <(_ LEVEL) = [13]> then\n        hide\n    end\n    if <(_ LEVEL) = [15]> then\n        hide\n    end\nend\n\nwhen I receive [begin v]\nforever\n    if <(_ LEVEL) = [14]> then\n        switch costume to (xy v)\n        show\n        go to x: (-1) y: (-100)\n        repeat (40)\n            change y by (4)\n        end\n        repeat (40)\n            change y by (-4)\n        end\n    end\nend\n\nhide\n\nwhen I start as a clone\nforever\n    if <(_ LEVEL) = [12]> then\n        delete this clone\n    end\n    if <(_ LEVEL) = [13]> then\n        delete this clone\n    end\nend\n\n@Water\n\nwhen flag clicked\nset [water? v] to [0]\npoint in direction (1)\nbroadcast (setup without waiting v)\nbroadcast (main game v)\nhide\nforever\n    broadcast (Tick v)\nend\n\nwhen I start as a clone\nshow\n\nwhen I receive [tick v]\nset [ghost v] effect to (75)\ngo to [back v] layer\ngo [backward v] (3) layers\nset y to ((([cos v] of (((tic) * (0.5)) + ((direction) * (100))) ) * (10)) + (((y) - (190)) - (SCROLL Y)))\nset rotation style [don't rotate v]\nset x to (([cos v] of (((tic) * (0.5)) + (((direction) + (2)) * (100))) ) * (200))\n\nwhen I receive [setup without waiting v]\nset [y v] to [0]\nrepeat (3)\n    create clone of (_myself_ v)\n    change [y v] by (10)\n    turn right (1) degrees\nend\n\nwhen I receive [main game v]\nset [tic v] to [0]\nforever\n    change [tic v] by (10)\nend\n\nwhen flag clicked\nforever\n    if <(mute) = [1]> then\n        set volume to (0) %\n    else\n        set volume to (100) %\n    end\nend\n\n@TB\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (1000)\n    show\n    go to [front v] layer\nend\n\n
Hi friends Welcome to my new game.\nArrow keys/WASD Keys to move\nMobile Friendly !!\nHope you all have fun XD\nIt's multiplayer so you can play with other scratchers online. Leave a love and fav if you enjoyed the game \nThat's all\n\n\n\n\n\n\n\nSupports 8 PLAYERS\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nHave Fun\n\n\n\n\n\nNothing more :)\n\n\n\n\n\n\n\n\n\n\n\n\nOk then Love and fav the project XD\n\n\n\n\n\n\n\n\nLOL\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEnjoy The SUNSET WITH OTHER PLAYERS XD\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nStill not satisfied\n\n\n\n\n\n\n\nComment  _meow_ if you liked it