Earth - a Multiplayer Scrolling Platformer                   #games #Berger_Boy

Instructions: Use WASD or the arrow keys to move and press "t" to go in and out of chat.\nYOU CAN NOT PLAY WITH OTHERS IF YOU ARE A NEW SCRATCHER!!!!!!!!!!!!!!\nYou might be kicked out because of inactivity.\nTo toggle names, press "n". \nYou can't chat in mobile.\nHave Fun!\n

@Stage\n\nwhen [m v] key pressed\nif <(username) = [Berger_Boy]> then\n    set [mouse thing v] to (join ((mouse x) + (SCROLL X)) (join [, ] ((mouse y) + (SCROLL Y))))\n    show variable [mouse thing v]\nend\n\nwhen I receive [begin v]\nstop all sounds\nset [realm type v] to [Grasslands]\nwait (1) seconds\nrepeat until <not <(Realm Type) = [Grasslands]>>\n    play sound [Logic - 5am \(Instrumental\) \(online-audio-converter.com\) v] until done\n    if <(Realm Type) = [Wetlands]> then\n        stop all sounds\n    end\nend\n\nwhen I receive [tick v]\nif <[4540] < (SCROLL X)> then\n    set [realm type v] to [Wetlands]\n    set [respawn x v] to [4840]\n    set [respawn y v] to [333]\nend\nif <(SCROLL X) < [4540]> then\n    set [realm type v] to [Grasslands]\nend\nif <[8520] < (SCROLL X)> then\n    set [realm type v] to [Wastelands]\n    set [respawn x v] to [8754]\n    set [respawn y v] to [-24]\nend\n\nwhen flag clicked\nset [respawn x v] to [0]\nset [respawn y v] to [0]\nset [realm type v] to [Grasslands]\nwait until <(Realm Type) = [Wetlands]>\nif <(Realm Type) = [Wetlands]> then\n    stop all sounds\nend\n\nstop all sounds\n\nwhen flag clicked\nforever\n    if <(Realm Type) = [Grasslands]> then\n        switch backdrop to (backdrop1 v)\n    end\n    if <(Realm Type) = [Wetlands]> then\n        switch backdrop to (backdrop2 v)\n    end\n    if <(Realm Type) = [Wastelands]> then\n        switch backdrop to (backdrop3 v)\n        play sound [u got roasted and toasted v] until done\n    end\nend\n\n@Sprite3\n\n@player\n\ndefine Chat\nif <(is the chat open) = [1]> then\n    if <key (1 v) pressed?> then\n        set [chat v] to [1]\n        say (item (Chat) of [chat v])\n        wait (2) seconds\n        say []\n        set [chat v] to [0]\n    else\n        if <key (2 v) pressed?> then\n            set [chat v] to [2]\n            say (item (Chat) of [chat v])\n            wait (2) seconds\n            say []\n            set [chat v] to [0]\n        else\n            if <key (3 v) pressed?> then\n                set [chat v] to [3]\n                say (item (Chat) of [chat v])\n                wait (2) seconds\n                say []\n                set [chat v] to [0]\n            else\n                if <key (4 v) pressed?> then\n                    set [chat v] to [4]\n                    say (item (Chat) of [chat v])\n                    wait (2) seconds\n                    say []\n                    set [chat v] to [0]\n                else\n                    if <key (5 v) pressed?> then\n                        set [chat v] to [5]\n                        say (item (Chat) of [chat v])\n                        wait (2) seconds\n                        say []\n                        set [chat v] to [0]\n                    else\n                        if <key (6 v) pressed?> then\n                            set [chat v] to [6]\n                            say (item (Chat) of [chat v])\n                            wait (2) seconds\n                            say []\n                            set [chat v] to [0]\n                        else\n                            if <key (7 v) pressed?> then\n                                set [chat v] to [7]\n                                say (item (Chat) of [chat v])\n                                wait (2) seconds\n                                say []\n                                set [chat v] to [0]\n                            else\n                                if <key (8 v) pressed?> then\n                                    set [chat v] to [8]\n                                    say (item (Chat) of [chat v])\n                                    wait (2) seconds\n                                    say []\n                                    set [chat v] to [0]\n                                else\n                                    if <key (9 v) pressed?> then\n                                        set [chat v] to [9]\n                                        say (item (Chat) of [chat v])\n                                        wait (2) seconds\n                                        say []\n                                        set [chat v] to [0]\n                                    else\n                                        set [chat v] to [0]\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\nwhen flag clicked\nset [scroll y v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nset [scroll x v] to [0]\nshow list [chat v]\nbroadcast (GREEN FLAG v) and wait\nbroadcast (PLAY GAME v) and wait\n\ndefine CHANGE PLAYER Y BY (sy)\nchange [y v] by (sy)\nchange [inair v] by (1)\nPosition\nrepeat until <not <touching (thing platformer v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [inair v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine GAME ON\nset [x v] to (respawn x)\nset [y v] to (respawn y)\nset [sy v] to [0]\nset [sx v] to [0]\nset [scroll x v] to (respawn x)\nset [scroll y v] to (respawn y)\nset [inair v] to [0]\nset [exit v] to []\nset size to (100) %\nset [ghost v] effect to (0)\nshow\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\ndefine Game-Win\n\nrepeat (50)\n    point towards (exit v)\n    turn right (65) degrees\n    move ((distance to [exit v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nhide\nchange [level v] by (1)\nwait (1) seconds\n\ndefine TICK\nif <<<(mouse x) < (x position)> and <mouse down?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n    switch costume to (cool kid a;sldkfj4 v)\n    change [sx v] by (-2)\nend\nif <<<(x position) < (mouse x)> and <mouse down?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    switch costume to (cool kid a;sldkfj3 v)\n    change [sx v] by (2)\nend\nset [sx v] to ((SX) * (0.8))\nif <[0.9] < ([abs v] of (SX) )> then\n    CHANGE PLAYER X By (round (SX))\nend\nif <<<(y position) < (mouse y)> and <mouse down?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n    if <(inair) < [5]> then\n        switch costume to (cool kid a;sldkfj5 v)\n        set [sy v] to [16]\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-2)\nend\nCHANGE PLAYER Y BY (sy)\nTEST-DIE\nchange [scroll x v] by (round (((x) - (SCROLL X)) / (8)))\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nif <[555555] < (SCROLL X)> then\n    set [scroll x v] to [55555]\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (8)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <not <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<key (d v) pressed?> or <<key (right arrow v) pressed?> or <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <mouse down?>>>>>>> then\n    switch costume to (cool kid a;sldkfj v)\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n    switch costume to (cool kid a;sldkfj7 v)\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    switch costume to (cool kid a;sldkfj6 v)\nend\n\nif <(y) < [-175]> then\n    set [exit v] to [die]\nend\n\nwhen I receive [begin v]\nset [is the chat open v] to [0]\nshow list [chat v]\nforever\n    Chat\nend\n\ndefine GAME - DIE\nset [exit v] to []\nhide\n\ndefine TEST-DIE\nif <<touching (u are die v)?> or <touching (water swim in v)?>> then\n    set [exit v] to [die]\nend\n\ndefine CHANGE PLAYER X By (sx)\nchange [x v] by (sx)\nPosition\nif <touching (thing platformer v)?> then\n    repeat (18)\n        change [y v] by (1)\n        Position\n        if <not <touching (thing platformer v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-18)\n    if <<<(y position) < (mouse y)> and <mouse down?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        if <(sx) > [0]> then\n            set [sx v] to [-16]\n        else\n            set [sx v] to [16]\n        end\n        set [inair v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (thing platformer v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\nwhen flag clicked\nset [max players v] to [9]\nset [my player # v] to [0]\nbroadcast (setups v) and wait\nbroadcast (joining v)\nbroadcast (join game v) and wait\nif <(My Player #) > [0]> then\n    start sound [Connect v]\n    broadcast (joined v)\nelse\n    start sound [Disconnect v]\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 [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]\nset [level v] to [1]\nforever\n    broadcast (reset v) and wait\n    broadcast (SETUP v) and wait\n    GAME ON\n    repeat until <(EXIT) > []>\n        TICK\n        broadcast (tick v)\n        if <(My Player #) > [0]> then\n            send cloud data\n        end\n    end\n    if <(EXIT) = [win]> then\n        Game-Win\n    else\n        GAME - DIE\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                                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 (x) to encoded\nwrite (y) to encoded\nwrite (Chat) to encoded\nset cloud # (My Player #) to (encodied)\n\nwhen I receive [begin v]\nwait (5) seconds\nswitch backdrop to (blank v)\n\nhide\n\n@hi\n\ndefine Decode chat (chat)\nif <(chat) = [0]> then\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 [color v] effect to (90)\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\n    go to [back v] layer\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                                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\nif <(names) = [1]> then\n    say (value)\nelse\n    say []\nend\nvalue=read from encode\nvalue=read from encode\nset x to ((value) - (SCROLL X))\nvalue=read from encode\nset y to ((value) - (SCROLL Y))\nvalue=read from encode\nbroadcast (Decode chat v)\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 [decode chat v]\nDecode chat (value)\n\nwhen I receive [begin 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\n@yas it is\n\nwhen flag clicked\nset [u win v] to [nono]\nhide variable [timer2 v]\ngo to x: (0) y: (0)\nset [moved? v] to [1000]\nhide\n\nwhen I receive [begin v]\nhide\n\nwhen I receive [joining v]\nswitch costume to (joining v)\nshow\n\nwhen I receive [joined v]\ncreate clone of (_myself_ v)\nhide\n\nswitch costume to (costume1 v)\n\nshow\n\nwhen I receive [full v]\nswitch costume to (joined2 v)\nshow\n\nwhen I receive [tick v]\nif <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<key (d v) pressed?> or <<key (right arrow v) pressed?> or <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <mouse down?>>>>>> then\n    set [moved? v] to [1000]\nelse\n    change [moved? v] by (-1)\nend\nif <(Moved?) < [1]> then\n    stop [all v]\nend\nif <(username) = [Berger_Boy]> then\n    set [moved? v] to [1000]\nend\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nforever\n    if <(Realm Type) = [Grasslands]> then\n        switch costume to (costume1 v)\n    end\n    if <(Realm Type) = [Wetlands]> then\n        switch costume to (costume2 v)\n    end\n    if <(Realm Type) = [Wastelands]> then\n        switch costume to (costume3 v)\n    end\nend\n\nwhen I receive [you winnn!!!!!!!! v]\nset [u win v] to [yaya]\nshow\nswitch costume to (joined3 v)\ngo to [front v] layer\nwait (5) seconds\nstop [all v]\n\nforever\nend\n\nbroadcast (You winnn!!!!!!!! v)\n\nhide\n\n@THing platformer\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPOSTION ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level 1-1 v)\nCLONE AT X [550] Y [0]\nCLONE AT X [550] Y [150]\nCLONE AT X [550] Y [0]\nCLONE AT X [800] Y [100]\nCLONE AT X [900] Y [0]\nCLONE AT X [750] Y [100]\nCLONE AT X [750] Y [0]\nCLONE AT X [750] Y [0]\nCLONE AT X [750] Y [-300]\nCLONE AT X [750] Y [-250]\nCLONE AT X [550] Y [450]\nCLONE AT X [600] Y [100]\nCLONE AT X [750] Y [-300]\nCLONE AT X [900] Y [50]\nCLONE AT X [650] Y [50]\nCLONE AT X [900] Y [50]\n\ndefine POSTION (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine CLONE AT X (x) Y (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@U are DIE\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPOSTION ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level 1-1 v)\nCLONE AT X [550] Y [0]\nCLONE AT X [550] Y [150]\nCLONE AT X [550] Y [0]\nCLONE AT X [800] Y [100]\nCLONE AT X [900] Y [0]\nCLONE AT X [750] Y [100]\nCLONE AT X [750] Y [0]\nCLONE AT X [750] Y [0]\nCLONE AT X [750] Y [-300]\nCLONE AT X [750] Y [-250]\nCLONE AT X [550] Y [450]\nCLONE AT X [600] Y [100]\nCLONE AT X [750] Y [-300]\nCLONE AT X [900] Y [50]\n\ndefine POSTION (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine CLONE AT X (x) Y (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@Water swim in\n\nClone at x: [150] y: [-100]\n\nClone at x: [930] y: [0]\nClone at x: [360] y: [0]\nClone at x: [580] y: [0]\nClone at x: [480] y: [0]\nClone at x: [0] y: [360]\n\nClone at x: [-600] y: [1140]\nClone at x: [400] y: [175]\nClone at x: [490] y: [0]\nClone at x: [400] y: [-20]\nClone at x: [550] y: [-200]\nClone at x: [0] y: [-160]\nClone at x: [520] y: [450]\nClone at x: [400] y: [0]\nClone at x: [300] y: [-50]\n\nClone at x: [360] y: [0]\n\nClone at x: [0] y: [0]\n\nClone at x: [360] y: [0]\n\nClone at x: [840] y: [0]\n\nwhen I receive [yay! v]\nchange [level v] by (1)\n\nif <(LEVEL) = [4]> then\n    broadcast (level 4 v)\n    switch costume to (level 4 1 v)\nelse\n    if <(LEVEL) = [5]> then\n        broadcast (level 5 v)\n        switch costume to (level 5 1 v)\n    else\n        if <(LEVEL) = [77]> then\n    end\nend\n\nbroadcast (Level 77 v)\n\ngo to [back v] layer\n\nwhen I start as a clone\n\ngo to [back v] layer\n\nbroadcast (Reset v)\nbroadcast (Setup v)\n\nwhen I receive [tick v]\nPosition ((round ((x) - (SCROLL X))) + (menu x)) ((round ((y) - (SCROLL Y))) + (([sin v] of ((timer) * (250)) ) * (5)))\n\nwhen I receive [setup v]\nhide\nset [y v] to [-100]\nset [x v] to [-300]\nset [p timer v] to [0]\nswitch costume to (agua a;lskdfj v)\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\nClone at x: [480] y: [0]\n\ndefine Position (x) (y)\nback\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\n    back\nelse\n    hide\n    back\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen flag clicked\nhide\n\nset [whirl v] effect to (50)\n\nchange [brightness v] effect by (5)\n\nwhen flag clicked\nhide\n\ndefine back\ngo to [back v] layer\n\n@Sprite1\n\nwhen [t v] key pressed\nset [is the chat open v] to [1]\nshow\nwait (0.5) seconds\nrepeat until <key (t v) pressed?>\nhide\nset [is the chat open v] to [0]\n\nwhen flag clicked\nhide\ngo to x: (-120) y: (0)\nforever\n    if <(Realm Type) = [Grasslands]> then\n        switch costume to (costume2 v)\n    end\n    if <(Realm Type) = [Wetlands]> then\n        switch costume to (costume3 v)\n    end\nend\n\n@wordsrsdsd\n\nwhen I receive [green flag v]\nhide variable [mouse thing v]\nhide\n\nwhen I receive [tick v]\nPOSTION ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (grasslands v)\nCLONE AT X [1956] Y [550]\nCLONE AT X [4389] Y [638]\nCLONE AT X [8816] Y [110]\n\ndefine POSTION (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine CLONE AT X (x) Y (y)\ncreate clone of (_myself_ v)\nset [x v] to (x)\nset [y v] to (y)\nnext costume\ngo to [front v] layer\n\nchange [x v] by (360)\nchange [y v] by (360)\n\nCLONE AT X [550] Y [0]\nCLONE AT X [800] Y [100]\n\nif <(LEVEL) = [1]> then\n\n@THUNDERSTORM\n\ndefine Draw Afterflash\nset [flash v] to [10]\nset [r v] to [1]\nrepeat until <(r) > (length of [afterflash v])>\n    go to x: (item (r) of [afterflash v]) y: (item ((r) + (1)) of [afterflash v])\n    point in direction (item ((r) + (2)) of [afterflash v])\n    set pen size to (1)\n    set pen color to (#ffffff)\n    pen down\n    move (10) steps\n    pen up\n    change [r v] by (3)\n    change [flash v] by (0.5)\nend\nif <(pick random (0) to (3)) = [0]> then\n    delete (all) of [afterflash v]\nend\n\nwhen I start as a clone\nwait (pick random (0.5) to (5.000000000232831)) seconds\nset volume to (Lightning Delay) %\nplay sound (pick random (2) to (14)) until done\ndelete this clone\n\nset pen color to (#5cb712)\n\nDraw Clouds\n\ndefine Draw Background\nset y to (180)\nrepeat (90)\n    set pen color to (#8257ad)\n    set pen shade to (flash)\n    set x to (-240)\n    pen down\n    set x to (240)\n    pen up\n    change y by (-4)\nend\n\nif <(y position) > [-100]> then\n\ndefine Draw Lightning\nif <(pick random (Lightning Intensity) to (2)) = (Lightning Intensity)> then\n    set [flash v] to [10]\n    set [r v] to (((pick random (1) to (Cloud Cover)) * (4)) - (3))\n    add (item (r) of [cloud info v]) to [lightning info v]\n    add (item ((r) + (1)) of [cloud info v]) to [lightning info v]\n    add (pick random (160) to (200)) to [lightning info v]\n    add (item (1) of [lightning info v]) to [afterflash v]\n    add (item (2) of [lightning info v]) to [afterflash v]\n    add (item (3) of [lightning info v]) to [afterflash v]\n    set [r v] to [1]\n    repeat until <(length of [lightning info v]) = [0]>\n        go to x: (item (r) of [lightning info v]) y: (item ((r) + (1)) of [lightning info v])\n        if <<(x position) = [0]> and <(y position) = [0]>> then\n            delete (all) of [lightning info v]\n        else\n            point in direction (item ((r) + (2)) of [lightning info v])\n            move (10) steps\n            if <<touching (_edge_ v)?> or <(pick random (0) to (10)) = [0]>> then\n                delete (r) of [lightning info v]\n                delete (r) of [lightning info v]\n                delete (r) of [lightning info v]\n            else\n                change [flash v] by (1)\n                if <(pick random (0) to (10)) = [0]> then\n                    add (x position) to [lightning info v]\n                    add (y position) to [lightning info v]\n                    add ((direction) + (pick random (-10) to (10))) to [lightning info v]\n                    add (x position) to [afterflash v]\n                    add (y position) to [afterflash v]\n                    add (item (last) of [lightning info v]) to [afterflash v]\n                else\n                    replace item (r) of [lightning info v] with (x position)\n                    replace item ((r) + (1)) of [lightning info v] with (y position)\n                    replace item ((r) + (2)) of [lightning info v] with ((direction) + (pick random (-10) to (10)))\n                    add (item (r) of [lightning info v]) to [afterflash v]\n                    add (item ((r) + (1)) of [lightning info v]) to [afterflash v]\n                    add (item ((r) + (2)) of [lightning info v]) to [afterflash v]\n                end\n                if <(r) > ((length of [lightning info v]) - (3))> then\n                    set [r v] to [1]\n                else\n                    change [r v] by (3)\n                end\n            end\n        end\n    end\n    set [lightning delay v] to (flash)\n    create clone of (_myself_ v)\nend\nif <(flash) < [20]> then\n    delete (all) of [afterflash v]\nend\n\nset pen size to (1)\nset pen color to (#ffffff)\npen down\n\npen up\n\ndefine Draw Rain\nset [r v] to [1]\nrepeat (Rain Intensity)\n    go to x: (item (r) of [rain info v]) y: (item ((r) + (1)) of [rain info v])\n    point in direction ((180) + (Wind Direction))\n    pen down\n    move (10) steps\n    pen up\n    if <(y position) < [-160]> then\n        set [pickcloud v] to (((pick random (1) to (Cloud Cover)) * (4)) - (3))\n        replace item (r) of [rain info v] with ((item (pickcloud) of [cloud info v]) + (pick random (-20) to (20)))\n        replace item ((r) + (1)) of [rain info v] with ((item ((pickcloud) + (1)) of [cloud info v]) + (pick random (-20) to (20)))\n        replace item ((r) + (2)) of [rain info v] with (pick random (1) to (3))\n    else\n        replace item (r) of [rain info v] with ((x position) + ((item ((r) + (2)) of [rain info v]) * ([sin v] of (direction) )))\n        replace item ((r) + (1)) of [rain info v] with ((y position) + ((item ((r) + (2)) of [rain info v]) * ([cos v] of (direction) )))\n        replace item ((r) + (2)) of [rain info v] with ((item ((r) + (2)) of [rain info v]) * (1.1))\n    end\n    change [r v] by (3)\nend\n\nwhen flag clicked\nset [cloud cover v] to [100]\nset [lightning intensity v] to [100]\nset [rain intensity v] to [100]\nset [mute rain? v] to [36]\nset [wind direction v] to [10]\nset [flash v] to [0]\nset [t v] to [0]\ndelete (all) of [lightning info v]\ndelete (all) of [rain info v]\ndelete (all) of [afterflash v]\nforever\n    if <(Realm Type) = [Wetlands]> then\n        erase all\n        if <not <((Cloud Cover) * (4)) = (length of [cloud info v])>> then\n            delete (all) of [cloud info v]\n            repeat (Cloud Cover)\n                add (pick random (-220) to (220)) to [cloud info v]\n                add (pick random (100) to (180)) to [cloud info v]\n                add (pick random (20) to (50)) to [cloud info v]\n                add (pick random (10) to (30)) to [cloud info v]\n            end\n        end\n        if <not <((Rain Intensity) * (3)) = (length of [rain info v])>> then\n            delete (all) of [rain info v]\n            repeat (Rain Intensity)\n                set [pickcloud v] to (((pick random (1) to (Cloud Cover)) * (4)) - (3))\n                add ((item (pickcloud) of [cloud info v]) + (pick random (-20) to (20))) to [rain info v]\n                add ((item ((pickcloud) + (1)) of [cloud info v]) + (pick random (-20) to (20))) to [rain info v]\n                add (pick random (1) to (3)) to [rain info v]\n            end\n        end\n        if <<(Mute Rain?) = [0]> and <(Rain Intensity) > [0]>> then\n            set volume to (Rain Intensity) %\n            start sound [rain v]\n        end\n        point in direction (90)\n        set pen size to (4)\n        Draw Background\n        set pen color to (#dbdcdc)\n        set pen size to (1)\n        set pen color to (#3900a5)\n        Draw Rain\n        set pen color to (#ffffff)\n        set pen shade to (100)\n        set [flash v] to ((0.3) * (flash))\n        if <(length of [afterflash v]) = [0]> then\n            set [t v] to [0]\n            if <(Lightning Intensity) > [0]> then\n                Draw Lightning\n            end\n        else\n            change [t v] by (1)\n            if <((t) mod (2)) = [0]> then\n                Draw Afterflash\n            end\n        end\n    else\n        erase all\n    end\nend\n\nif <(Realm Type) = [Grasslands]> then\n\nrepeat until <not <(Realm Type) = [Wetlands]>>\n\ndefine Draw Clouds\nset [r v] to [1]\nrepeat (Cloud Cover)\n    go to x: (item (r) of [cloud info v]) y: (item ((r) + (1)) of [cloud info v])\n    set pen size to (item ((r) + (2)) of [cloud info v])\n    set pen shade to (item ((r) + (3)) of [cloud info v])\n    pen down\n    pen up\n    if <not <(Wind Direction) = [0]>> then\n        change x by ((Cloud Cover) - ((Wind Direction) / (item ((r) + (2)) of [cloud info v])))\n        if <([abs v] of (x position) ) < [240]> then\n            replace item (r) of [cloud info v] with (x position)\n        else\n            replace item (r) of [cloud info v] with ((x position) * (-0.99))\n            replace item ((r) + (1)) of [cloud info v] with (pick random (60) to (180))\n            replace item ((r) + (2)) of [cloud info v] with (pick random (20) to (50))\n            replace item ((r) + (3)) of [cloud info v] with (pick random (10) to (30))\n        end\n    end\n    change [r v] by (4)\nend\n\n@THing platformer2\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPOSTION ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [11713]\nset [y v] to [155]\nswitch costume to (flag1 v)\n\ndefine POSTION (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine CLONE AT X (x) Y (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen flag clicked\nwait until <touching (player v)?>\nbroadcast (You winnn!!!!!!!! v)\n\n@Sprite2\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [tick v]\nshow variable [time v]\nif <(u win) = [nono]> then\n    set [time v] to ((round ((timer) * (10))) / (10))\nelse\n    set [time v] to (TIME)\nend\n\nwhen I receive [joined v]\nreset timer\n\n