Beach a multiplayer platformer #Games

Instructions: My best time is 23 seconds comment your best! :)\n\nBeach a multiplayer platformer\n \n-Supports 10 players\n-automatic joining/leaving\n-smooth movement\n-Multiple Levels\n-And more! :)\n-60 seconds time out\n\n\n

@Stage\n\nwhen flag clicked\nforever\n    play sound [Alan Walker - Force v] until done\nend\n\nwhen I receive [next level v]\nnext backdrop\n\nwhen flag clicked\nswitch backdrop to (1 v)\n\n@player\n\nwhen I receive [you win and time c v]\nstop [other scripts in sprite v]\n\ntick\n\ntick\n\ndefine Run Engine\nchange [y v] by (-0.5)\nif <<key (left arrow v) pressed?> or <<(x position) > (mouse x)> and <mouse down?>>> then\n    change [x v] by (-0.9)\n    switch costume to (1 v)\nend\nif <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>> then\n    change [x v] by (0.9)\n    switch costume to (1 v)\nend\nset [x v] to ((x) * (0.9))\nchange x by (x)\nif <<touching (level v)?> or <touching color (#00ff2c)?>> then\n    change y by (1)\n    if <<touching (level v)?> or <touching color (#00ff2c)?>> then\n        change y by (1)\n        if <<touching (level v)?> or <touching color (#00ff2c)?>> then\n            change y by (1)\n            if <<touching (level v)?> or <touching color (#00ff2c)?>> then\n                change y by (1)\n                if <<touching (level v)?> or <touching color (#00ff2c)?>> then\n                    change y by (1)\n                    if <<touching (level v)?> or <touching color (#00ff2c)?>> then\n                        change y by (1)\n                        if <<touching (level v)?> or <touching color (#00ff2c)?>> then\n                            change y by (-6)\n                            change x by ((x) * (-1))\n                            if <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n                                set [y v] to [9]\n                                if <(x) > [0]> then\n                                    set [x v] to [-10]\n                                else\n                                    set [x v] to [10]\n                                end\n                            else\n                                set [x v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange y by (y)\nif <<touching (level v)?> or <touching color (#00ff2c)?>> then\n    change y by ((y) * (-1))\n    set [y v] to [0]\nend\nchange y by (-0.5)\nif <<<<touching (level v)?> or <touching color (#00ff2c)?>> and <key (up arrow v) pressed?>> or <<<touching (level v)?> or <touching color (#00ff2c)?>> and <<(mouse y) > (y position)> and <mouse down?>>>> then\n    switch costume to (4 v)\n    set [y v] to [9.5]\nend\nchange y by (0.5)\nif <touching (cactuses v)?> then\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    go to x: (X Spawn) y: (Y Spawn)\n    repeat (20)\n        change [ghost v] effect by (-5)\n    end\n    set [x v] to [0]\n    set [y v] to [0]\nend\nif <(x position) > [233]> then\n    go to x: (X Spawn) y: (Y Spawn)\n    broadcast (Next Level v)\n    change [level v] by (1)\n    set [x v] to [0]\n    set [y v] to [0]\nend\n\nwhen flag clicked\nset [y spawn v] to [60]\nset [x spawn v] to [-218]\ngo to x: (X Spawn) y: (Y Spawn)\nswitch costume to (player v)\nswitch backdrop to (cavesbackround v)\nshow\nset size to (70) %\nset [x v] to [0]\nset [y v] to [0]\n\ndefine Run block\nRun Engine\n\nwhen flag clicked\nset [max players v] to [4]\nset [my player # v] to [0]\nbroadcast (setups v) and wait\nswitch backdrop to (joining v)\nbroadcast (join game v) and wait\nif <(My Player #) > [0]> then\n    set [☁ p1 v] to [2]\nelse\n    set [☁ p1 v] to [3]\nend\nbroadcast (begin v)\n\ndefine write (val) to encoded\nset [letter # v] to [1]\nrepeat (length of (val))\n    set [encodied v] to (join (encodied) (item # of (letter (letter #) of (val)) in [code v]))\n    change [letter # v] by (1)\nend\nset [encodied v] to (join (encodied) [00])\n\nwhen I receive [begin v]\nforever\n    Run block\n    if <(My Player #) > [0]> then\n        send cloud data\n    end\nend\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                            else\n                                if <(player) = [9]> then\n                                    set [☁ p9 v] to (value)\n                                else\n                                    set [☁ p10 v] to (value)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine send cloud data\nset [encodied v] to []\nwrite (username) to encoded\nwrite (round ((timer) * (10))) to encoded\nwrite (round (x position)) to encoded\nwrite (round (y position)) to encoded\nwrite (costume [number v]) to encoded\nwrite ([costume # v] of [level v]) to encoded\nset cloud # (My Player #) to (encodied)\n\nwhen flag clicked\nset [connecting v] to [1]\n\nwhen flag clicked\nforever\n    if <not <<<key (left arrow v) pressed?> or <<(x position) > (mouse x)> and <mouse down?>>> or <<<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>> or <<<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> or <<<<touching (level v)?> or <touching color (#00ff2c)?>> and <key (up arrow v) pressed?>> or <<<touching (level v)?> or <touching color (#00ff2c)?>> and <<(mouse y) > (y position)> and <mouse down?>>>>>>>> then\n        switch costume to (3 v)\n    end\nend\n\nwhen flag clicked\nforever\n    set [timer v] to ((timer) + (1))\nend\n\nwhen [timer v] > (Timer)\nif <(My Player #) = [1]> then\n    set [☁ p1 v] to []\n    set [my player # v] to []\nelse\n    if <(My Player #) = [2]> then\n        set [☁ p2 v] to []\n        set [my player # v] to []\n    else\n        if <(My Player #) = [3]> then\n            set [☁ p3 v] to []\n            set [my player # v] to []\n        else\n            if <(My Player #) = [4]> then\n                set [☁ p4 v] to []\n                set [my player # v] to []\n            else\n                if <(My Player #) = [5]> then\n                    set [☁ p5 v] to []\n                    set [my player # v] to []\n                else\n                    if <(My Player #) = [6]> then\n                        set [☁ p6 v] to []\n                        set [my player # v] to []\n                    else\n                        if <(My Player #) = [7]> then\n                            set [☁ p7 v] to []\n                            set [my player # v] to []\n                        else\n                            if <(My Player #) = [8]> then\n                                set [☁ p8 v] to []\n                                set [my player # v] to []\n                            else\n                                if <(My Player #) = [9]> then\n                                    set [☁ p9 v] to []\n                                    set [my player # v] to []\n                                else\n                                    set [☁ p10 v] to []\n                                    set [my player # v] to []\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nreset timer\nset [timer v] to [0]\n\nwhen I receive [begin v]\nrepeat (60)\n    if <<<key (left arrow v) pressed?> or <<(x position) > (mouse x)> and <mouse down?>>> or <<<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>> or <<<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> or <<<<touching (level v)?> or <touching color (#00ff2c)?>> and <key (up arrow v) pressed?>> or <<<touching (level v)?> or <touching color (#00ff2c)?>> and <<(mouse y) > (y position)> and <mouse down?>>>>>>> then\n        set [kickout v] to [0]\n    else\n        change [kickout v] by (1)\n    end\n    wait (1) seconds\nend\nif <(Kickout) = [60]> then\n    stop [all v]\nend\n\ndefine Refresh\ngo to x: (-243) y: (-104)\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\nforever\n    show\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    if <touching (saws v)?> then\n        Refresh saws\n    end\nend\n\ndefine Refresh saws\ngo to x: (-228) y: (-30)\n\nwhen flag clicked\nforever\n    if <touching (spikes2 v)?> then\n        Refresh saws\n    end\nend\n\nwhen I receive [the end yay v]\nhide\n\nwhen flag clicked\nplay sound [Unlimited v] until done\n\nwhen flag clicked\nwait (1) seconds\nforever\n    change x by (1)\nend\n\ndefine Talk (input) (wait...)\n\nwhen I receive [begin v]\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nswitch costume to (center 2 v)\nrepeat (10)\n    change [ghost v] effect by (5)\n    change size by (-5)\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    if <touching (enemy v)?> then\n        Refresh\n        play sound [Oops v] until done\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (9. lazers v)?> then\n        Refresh\n        play sound [Oops v] until done\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (t v) pressed?> then\n        hide list [chat v]\n    end\nend\n\nwhen flag clicked\nshow list [chat v]\n\nwhen flag clicked\nforever\n    if <key (1 v) pressed?> then\n        say (item (1) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (2 v) pressed?> then\n        say (item (2) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (3 v) pressed?> then\n        say (item (3) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (4 v) pressed?> then\n        say (item (4) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (5 v) pressed?> then\n        say (item (5) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (6 v) pressed?> then\n        say (item (6) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (7 v) pressed?> then\n        say (item (7) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (8 v) pressed?> then\n        say (item (8) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (9 v) pressed?> then\n        say (item (9) of [chat v]) for (2) seconds\n    end\nend\n\nwhen backdrop switches to [backdrop5 v]\nstop [other scripts in sprite v]\n\nwhen backdrop switches to [backdrop5 v]\nforever\n    hide\n    go to [back v] layer\n    set [ghost v] effect to (100)\nend\n\n@opponents\n\nwhen I receive [begin v]\nforever\n    show\n    go to [front v] layer\nend\n\nwhen I receive [begin v]\nforever\n    show\n    go to [front v] layer\nend\n\nwhen I receive [begin v]\nforever\n    show\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    if <key (8 v) pressed?> then\n        say (item (8) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (9 v) pressed?> then\n        say (item (9) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (9 v) pressed?> then\n        say (item (9) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (9 v) pressed?> then\n        say (item (9) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (9. lazers v)?> then\n        Refresh\n        play sound [Oops v] until done\n    end\nend\n\nwhen I start as a clone\nswitch costume to (center 2 v)\nrepeat (10)\n    change [ghost v] effect by (5)\n    change size by (-5)\nend\ndelete this clone\n\nwhen flag clicked\nwait (1) seconds\nforever\n    change x by (1)\nend\n\nwhen flag clicked\nforever\n    if <touching (saws v)?> then\n        Refresh saws\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [2]> then\n        broadcast (Coustume number is 2 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [2]> then\n        broadcast (Coustume number is 2 v)\n    end\nend\n\ndefine begin decode of (encode)\nset [encodied v] to (encode)\nset [letter # v] to [1]\n\ndefine value=read from encode\nset [value v] to []\nforever\n    set [idx v] to (join (letter (letter #) of (encodied)) (letter ((letter #) + (1)) of (encodied)))\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\nset [offline v] to [100]\nhide\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        hide\n        set [offline v] to [100]\n    else\n        tick\n    end\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                            else\n                                if <(player) = [9]> then\n                                    set [value v] to (☁ P9)\n                                else\n                                    set [value v] to (☁ P10)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [setups 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]\nend\nbegin decode of (value)\nvalue=read from encode\nsay (value)\nvalue=read from encode\nvalue=read from encode\nset x to (value)\nvalue=read from encode\nset y to (value)\nvalue=read from encode\nswitch costume to (value)\nvalue=read from encode\nif <(value) = ([costume # v] of [level v])> then\n    show\nelse\n    hide\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 flag clicked\nset size to (70) %\n\nwhen flag clicked\nforever\n    if <touching (water v)?> then\nend\n\nwhen I receive [the end yay v]\nhide\n\nwhen flag clicked\nforever\n    if <key (8 v) pressed?> then\n        say (item (8) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (7 v) pressed?> then\n        say (item (7) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (6 v) pressed?> then\n        say (item (6) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (5 v) pressed?> then\n        say (item (5) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (4 v) pressed?> then\n        say (item (4) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (3 v) pressed?> then\n        say (item (3) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (2 v) pressed?> then\n        say (item (2) of [chat v]) for (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (1 v) pressed?> then\n        say (item (1) of [chat v]) for (2) seconds\n    end\nend\n\ndefine Refresh saws\n\nwhen flag clicked\nforever\n    if <touching (cactuses v)?> then\n        go to x: (-228) y: (-30)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (9. lazers v)?> then\n        go to x: (-228) y: (-30)\n    end\nend\n\nwhen backdrop switches to [backdrop5 v]\nhide\ngo to [back v] layer\n\nwhen backdrop switches to [backdrop5 v]\nstop [other scripts in sprite v]\n\n@Sun\n\nwhen flag clicked\ngo to [back v] layer\nclear graphic effects\nswitch costume to (rays v)\ngo to x: (210) y: (170)\ncreate clone of (_myself_ v)\nforever\n    turn right (1) degrees\nend\n\nwhen I start as a clone\nswitch costume to (sun v)\n\nwhen I receive [dead v]\nset [brightness v] effect to (-100)\nrepeat (50)\n    change [brightness v] effect by (2)\nend\n\n@Level\n\nwhen flag clicked\nswitch costume to (1 v)\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nshow\ngo to [front v] layer\nswitch costume to (1 v)\ngo to x: (-83) y: (-4)\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nwhen I receive [begin v]\nshow\ngo to [front v] layer\nswitch costume to (1 v)\n\nwhen flag clicked\nclear graphic effects\n\nwhen backdrop switches to [3 v]\nswitch costume to (3 v)\n\nwhen backdrop switches to [backdrop1 v]\nswitch costume to (costume1 v)\n\nwhen backdrop switches to [backdrop2 v]\nswitch costume to (costume2 v)\n\nwhen backdrop switches to [backdrop3 v]\nswitch costume to (costume3 v)\n\nwhen backdrop switches to [backdrop4 v]\nswitch costume to (costume4 v)\n\n@Cactuses\n\nwhen flag clicked\ngo to x: (161) y: (7)\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\nshow\ngo to [back v] layer\nforever\n    if <touching (player v)?> then\n        play sound [Oops v] until done\n    end\nend\n\nwhen backdrop switches to [2 v]\nhide\ngo to [back v] layer\n\nwhen backdrop switches to [1 v]\nshow\ngo to [back v] layer\nswitch costume to (2 v)\n\nwhen backdrop switches to [3 v]\nshow\ngo to [front v] layer\nswitch costume to (3 v)\n\nwhen flag clicked\nshow\ngo to [front v] layer\nswitch costume to (2 v)\n\nwhen backdrop switches to [backdrop2 v]\nhide\ngo to [back v] layer\n\nwhen backdrop switches to [backdrop3 v]\nshow\ngo to [front v] layer\nswitch costume to (costume2 v)\n\nwhen backdrop switches to [backdrop1 v]\nshow\ngo to [front v] layer\nswitch costume to (costume1 v)\n\nwhen backdrop switches to [backdrop4 v]\nshow\ngo to [front v] layer\nswitch costume to (costume3 v)\n\n@Sprite1\n\nwhen flag clicked\nset [costume v] to [0]\nhide\nforever\n    if <not <<(LOVED__) = [1]> and <(FAVED___) = [1]>>> then\n        wait (pick random (20) to (30)) seconds\n        switch costume to (costume1 v)\n        go to x: (0) y: (50)\n        show\n        go to [front v] layer\n        start sound [pop v]\n        repeat (9)\n            change y by (-6)\n        end\n        repeat (5)\n            change y by (3)\n        end\n        repeat (5)\n            change y by (-1)\n        end\n        wait (2) seconds\n        repeat (15)\n            change y by (7)\n        end\n        hide\n    end\n    if <(Costume) > [0]> then\n        hide\n        stop [this script v]\n    end\nend\n\n@detector\n\nwhen flag clicked\nhide\nset [faved___ v] to [0]\nset [loved__ v] to [0]\nset [clone id v] to [0]\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nwait until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\nwait (1) seconds\nbroadcast (Message v)\nshow\ngo to [front v] layer\ngo to x: (0) y: (50)\nreset timer\nswitch costume to (pick random (1) to (4))\nset [ghost v] effect to (100)\nrepeat until <(timer) > [3.5]>\n    change y by ((y position) / (-15))\n    change [ghost v] effect by (-3)\nend\nreset timer\nrepeat until <(timer) > [3.5]>\n    change y by (((y position) - (-100)) / (-15))\n    change [ghost v] effect by (10)\nend\n\nwhen I start as a clone\nif <(clone id) = [0]> then\n    go to x: (-15) y: (0)\n    set [loved__ v] to [0]\n    switch costume to (love v)\n    forever\n        set [love? v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [loved__ v] to [1]\n        end\n    end\nend\nif <(clone id) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (fave v)\n    set [faved___ v] to [0]\n    forever\n        set [fav v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [faved___ v] to [1]\n        end\n    end\nend\n\n@Connection Statements\n\nwhen flag clicked\nforever\n    switch costume to (Connecting)\nend\n\nwhen I receive [begin v]\nhide\n\nwhen flag clicked\nshow\n\n@ clouds\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nset size to (pick random (50) to (80)) %\nshow\ngo to [back v] layer\nset [ghost v] effect to (20)\nswitch costume to (pick random (1) to (4))\nif <(side) = [1]> then\n    go to x: (300) y: (pick random (150) to (100))\n    repeat until <(x position) < [-250]>\n        change x by (-1)\n    end\n    delete this clone\nend\nif <(side) = [2]> then\n    go to x: (-300) y: (pick random (150) to (100))\n    repeat until <(x position) > [250]>\n        change x by (1)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nforever\n    go [backward v] (1) layers\n    go to [back v] layer\nend\n\nwhen flag clicked\nforever\n    set [side v] to (pick random (1) to (2))\n    create clone of (_myself_ v)\n    wait (pick random (3) to (5)) seconds\nend\n\n@particles2\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\nforever\n    wait (.3) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\ngo to [front v] layer\nshow\ngo to x: (230) y: (pick random (-200) to (200))\npoint in direction (pick random (-105) to (-75))\nset [ghost v] effect to (100)\nrepeat (5)\n    change [ghost v] effect by (-10)\nend\nrepeat until <(x position) < [-230]>\n    move (10) steps\nend\nrepeat (5)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen backdrop switches to [backdrop5 v]\nhide\ngo to [back v] layer\n\n@particles\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\nforever\n    wait (.3) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\ngo to [front v] layer\nshow\ngo to x: (230) y: (pick random (-200) to (200))\npoint in direction (pick random (-105) to (-75))\nset [ghost v] effect to (100)\nrepeat (5)\n    change [ghost v] effect by (-10)\nend\nrepeat until <(x position) < [-230]>\n    move (10) steps\nend\nrepeat (5)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen backdrop switches to [backdrop5 v]\nhide\ngo to [back v] layer\n\n@Water\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nwhen backdrop switches to [2 v]\nshow\ngo to [front v] layer\nswitch costume to (costume1 v)\nset [ghost v] effect to (50)\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        play sound [Splash v] until done\n        forever\n            set y to ([sin v] of ((timer) * ((100) * (5))) )\n        end\n    end\nend\n\nwhen backdrop switches to [backdrop7 v]\nhide\ngo to [back v] layer\n\nwhen backdrop switches to [1 v]\nhide\ngo to [back v] layer\n\nwhen backdrop switches to [3 v]\nhide\ngo to [back v] layer\n\n@9. Lazers\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nwhen backdrop switches to [2 v]\nshow\ngo to [front v] layer\nforever\n    wait (1) seconds\n    next costume\nend\n\nwhen backdrop switches to [1 v]\nhide\ngo to [back v] layer\n\nwhen backdrop switches to [3 v]\nhide\ngo to [back v] layer\n\n@You win\n\nwhen flag clicked\nset [your time v] to [0]\n\nwhen flag clicked\nforever\n    wait (1) seconds\n    change [your time v] by (1)\nend\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nwhen backdrop switches to [backdrop5 v]\nshow\ngo to [front v] layer\n\nwhen backdrop switches to [backdrop5 v]\nshow\ngo to [front v] layer\nshow variable [your time v]\nset [your time v] to (Your time)\nstop [other scripts in sprite v]\n\nwhen flag clicked\nhide variable [your time v]\n\n@Thumbnail\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\n