ONLINE New Year World | platformer #games #all

Instructions: Merry Christmas and new year everyone! (if you celebrate it) here's a platformer that took me a month to make, so enjoy!\n\n> Collect gifts and spend them at the shop (pc only)\n> a UNIQUE punch feature, push other players to their doom!\n> 3 possible skins!\n> a chat feature to talk with other players\n> NOTE that if you are a 'new scratcher' you cannot see other players\n> Remix = heart + fave\n> Jump on enemies to defeat them!\n> P is to punch!\n> C to chat!\n> Fixed big cloud bug!\n\n> Credits:\n@griffpatch for insane #tutorials\n@stratfordjames (my inspo) for shop icon\n@gentlex for thumbnail inspo\n@scratchathon_ for everything else (#animations, #games, #art)\n@-xaf- for music\n(no stories)\n\n#Games #all #2023 #hi #comment:woah #platformer #online #scrolling #trending #all\n\n\n\n\n\n\n\n\n\n\n\ncomment: "Christmas has passed!"

@Stage\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\nstop all sounds\n\nwhen I receive [play game v]\nforever\n    play sound [Treenan v] until done\nend\n\n@g\n\nwhen I receive [green flag v]\nset [.punch timer v] to [0]\nhide\nset [@chat? v] to []\ngo to [front v] layer\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    start game\n    broadcast (reset v) and wait\n    broadcast (setup v) and wait\n    repeat until <(EXIT) > []>\n        tick\n        broadcast (TICK v) and wait\n    end\n    Game-death\nend\n\ndefine start game\npoint in direction (90)\nset [sx v] to [0]\nset [x v] to (item (Czeckpoint) of [checkpoint x v])\nset [y v] to (item (Czeckpoint) of [checkpoint y v])\nset [sy v] to [0]\nset [scroll y v] to (item (Czeckpoint) of [checkpoint y v])\nset [in air v] to [0]\nset [exit v] to []\nset [scroll x v] to (item (Czeckpoint) of [checkpoint x v])\nclear graphic effects\nshow\n\ndefine tick\nswitch costume to (n v)\nsay (@CHAT?)\nchange [.punch timer v] by (0.04)\nif <<(.punch timer) > [8]> and <key (p v) pressed?>> then\n    if <(item (3) of [bought v]) = [3]> then\n        set [punch? v] to [Y]\n        set [.punch timer v] to [0]\n        broadcast (local punch v)\n    end\nelse\n    if <(local punch) = []> then\n        set [punch? v] to [N]\n    end\nend\nif <(STICK X) < [-0.3]> then\n    change [sx v] by (-2)\nend\nif <[0.3] < (STICK X)> then\n    change [sx v] by (2)\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    change player x by (round (sx))\nend\nif <(STICK BUTTOn) > [0]> then\n    if <(in air) < [3]> then\n        change [sy v] by (9)\n    end\nend\nchange [sy v] by (-2)\nchange player y by (sy)\ntest-death?\nchange [scroll x v] by (round (((x) - (SCROLL X)) / (5)))\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by ((round (((y) - (SCROLL Y)) / (5))) + (0))\nif <((SCROLL Y) - (y)) > [30]> then\n    change [scroll y v] by ((round (((y) - (SCROLL Y)) / (5))) + (0))\nend\nif <(SCROLL Y) < [50]> then\n    set [scroll y v] to [50]\nend\nposition\nif <(y) < [-80]> then\n    set [exit v] to [f]\n    play sound [Oops v] until done\nend\nif <touching (end v)?> then\n    broadcast (WIN v)\nend\nif <touching (fan v)?> then\n    change [sy v] by (7)\nend\nif <<(Stared?) = [1]> and <(Loved?) = [1]>> then\n    switch costume to (y v)\nend\nif <(item (2) of [bought v]) = [2]> then\n    switch costume to (2 v)\nend\nif <touching (spring v)?> then\n    if <[-15] > (sy)> then\n        start sound [Big Boing v]\n        set [sy v] to [40]\n        change player y by (sy)\n        change [scroll y v] by ((round (((y) - (SCROLL Y)) / (5))) + (0))\n    end\nend\nset [...all player y v] to (y)\nchange y by (-1)\nif <touching (moving v)?> then\n    change [x v] by ((PLATFORM SPEED) * (2))\nend\nchange y by (1)\nsend cloud data\n\ndefine change player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nposition\nrepeat until <not <<touching (platform v)?> or <touching (moving v)?>>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    position\n    set [sy v] to [0]\nend\n\ndefine position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine change player x by (sx)\nchange [x v] by (sx)\nposition\nif <<touching (platform v)?> or <touching (moving v)?>> then\n    repeat (12)\n        change [y v] by (1)\n        position\n        if <not <<touching (platform v)?> or <touching (moving v)?>>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    repeat until <not <<touching (platform v)?> or <touching (moving 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\ndefine Game-death\nset [exit v] to []\nset [lift \(animation\) v] to [10]\nrepeat (20)\n    change y by (lift \(animation\))\n    turn right (18) degrees\n    change [lift \(animation\) v] by (-1)\n    change [ghost v] effect by (5)\n    send cloud data\nend\nwait (0.5) seconds\n\ndefine test-death?\nif <<touching (danger v)?> or <touching (lava v)?>> then\n    set [exit v] to [ow]\n    start sound [ow v]\nend\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\nwhen I receive [initiate cloud join v]\nset [my player # v] to [0]\nset [max players v] to [8]\nbroadcast (setup others v) and wait\nbroadcast (CLOUD JOIN v) and wait\nif <(MY PLAYER #) > [0]> then\n    broadcast (CLOUD JOINED v) and wait\nelse\n    broadcast (CLOUD FAIL v) and wait\nend\nbroadcast (Play Game v)\n\ndefine send cloud data\nif <[0] > (MY PLAYER #)> then\n    stop [this script v]\nend\nadd (x) to [buffer v]\nadd (y) to [buffer v]\nchange [cloud timer v] by (1)\nif <(cloud timer) < [3]> then\n    stop [this script v]\nend\nset [encoded v] to []\nwrite (PUNCH?) to encoded\nwrite (direction) to encoded\nwrite (join (username) (@CHAT?)) to encoded\nwrite (round ((timer) * (10))) to encoded\nwrite (costume [name v]) 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)\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                            set [☁ p8 v] to (value)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine write (value) to encoded\nset [# v] to [1]\nrepeat (length of (value))\n    set [encoded v] to (join (encoded) (item # of (letter (#) of (value)) in [code v]))\n    change [# v] by (1)\nend\nset [encoded v] to (join (encoded) [00])\n\nwhen I receive [green flag v]\ndelete all of [buffer v]\n\nwhen I receive [pushed v]\nchange [sx v] by (10)\n\nwhen I receive [local punch v]\nset [local punch v] to [.]\nrepeat (25)\n    set [punch? v] to [Y]\nend\nset [local punch v] to []\n\nwhen I receive [dead v]\nset [sy v] to [15]\n\nchange y by (2)\nif <touching (enemy v)?> then\n    if <(DEATH LOCK?) = [0]> then\n        set [exit v] to [o]\n        start sound [ow v]\n    end\nend\nchange y by (-2)\n\nwhen I receive [a v]\nset [exit v] to [o]\n\nset [all clear v] to []\n\n@platform\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]\nwait (0.1) seconds\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level 1 1 v)\ncreate clone of (_myself_ v)\nset [x v] to [480]\nset [y v] to [0]\nswitch costume to (level 1 2 v)\ncreate clone of (_myself_ v)\nset [x v] to [730]\nset [y v] to [-100]\nswitch costume to (level 1 3 v)\ncreate clone of (_myself_ v)\nset [x v] to [900]\nset [y v] to [300]\nswitch costume to (level 1 4 v)\ncreate clone of (_myself_ v)\nset [x v] to [1350]\nset [y v] to [300]\nswitch costume to (level 1 5 v)\ncreate clone of (_myself_ v)\nset [x v] to [1350]\nset [y v] to [700]\nswitch costume to (level 1 7 v)\ncreate clone of (_myself_ v)\nset [x v] to [700]\nset [y v] to [700]\nswitch costume to (level 1 8 v)\ncreate clone of (_myself_ v)\nset [x v] to [448]\nset [y v] to [448]\nswitch costume to (level 1 9 v)\ncreate clone of (_myself_ v)\nset [x v] to [405]\nset [y v] to [900]\nswitch costume to (level 1 10 v)\ncreate clone of (_myself_ v)\nset [x v] to [150]\nset [y v] to [1000]\nswitch costume to (level 1 11 v)\ncreate clone of (_myself_ 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\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\nwhen I start as a clone\n\nif <touching (g v)?> then\nif <touching (g v)?> then\n\nset [x v] to [1180]\nset [y v] to [700]\nswitch costume to (level 1 8 v)\ncreate clone of (_myself_ v)\n\nif <(costume [number v]) = [9]> then\n    forever\n        set [platform speed v] to [-4]\n        repeat (50)\n            change [x v] by (-4)\n        end\n        set [platform speed v] to [4]\n        repeat (50)\n            change [x v] by (4)\n        end\n    end\nend\n\nset [x v] to [450]\nset [y v] to [450]\nswitch costume to (level 1 9 v)\ncreate clone of (_myself_ v)\nset [x v] to [9999]\n\n@deco\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\npostion ((x) - (SCROLL X)) ((y) - (SCROLL Y))\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 [setup v]\nhide\npoint in direction (90)\nset [x v] to [360]\nset [y v] to [200]\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nset [x v] to [860]\nset [y v] to [150]\nswitch costume to (up1 v)\ncreate clone of (_myself_ v)\nset [x v] to [750]\nset [y v] to [850]\nswitch costume to (costume2 v)\ncreate clone of (_myself_ v)\nset [x v] to [448]\nset [y v] to [700]\nswitch costume to (up1 v)\npoint in direction (-90)\ncreate clone of (_myself_ v)\nset [x v] to [404]\nset [y v] to [1020]\nswitch costume to (costume3 v)\npoint in direction (90)\ncreate clone of (_myself_ v)\nset [x v] to [9999]\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\nwhen I start as a clone\nif <(costume [name v]) = [UP1]> then\n    switch costume to (up1 v)\n    forever\n        repeat (2)\n            next costume\n            wait (0.2) seconds\n        end\n        switch costume to (up1 v)\n        wait (0.2) seconds\n    end\nend\n\nset [.var v] to [1]\n\n@tn\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (100)\n\n@danger\n\nwhen I receive [setup v]\npoint in direction (90)\nset [x v] to [645]\nset [y v] to [120]\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nset [x v] to [1325]\nset [y v] to [800]\ncreate clone of (_myself_ v)\npoint in direction (-90)\nset [x v] to [400]\nset [y v] to [835]\ncreate clone of (_myself_ v)\n\nwhen I receive [tick v]\npostion ((x) - (SCROLL X)) ((y) - (SCROLL Y))\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 [green flag v]\nhide\n\nwhen I receive [reset v]\nhide\ndelete this clone\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\n@W\n\nwhen flag clicked\nhide\n\nwhen I receive [win v]\nwait (0.3) seconds\ngo to [front v] layer\nshow\nset [shake v] to (pick random (-50) to (50))\nset [shake y v] to (pick random (-50) to (50))\nstart sound [Win v]\nrepeat (20)\n    go to x: (shake) y: (shake y)\n    set [shake v] to ((shake) / (-1.2))\n    set [shake y v] to ((shake y) / (-1.2))\nend\ngo to [front v] layer\nstop [all v]\n\n@End\n\nwhen I receive [setup v]\nset [x v] to [175]\nset [y v] to [1175]\n\nwhen I receive [tick v]\npostion ((x) - (SCROLL X)) ((y) - (SCROLL Y))\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 [green flag v]\nhide\n\nwhen I receive [reset v]\nhide\ndelete this clone\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\n@intro\n\nwhen flag clicked\nbroadcast (Green Flag v) and wait\nshow\ngo to x: (0) y: (0)\nclear graphic effects\npoint in direction (90)\nhide\nset [id v] to [0]\ncreate clone of (_myself_ v)\nchange [id v] by (1)\ncreate clone of (_myself_ v)\nshow\nswitch costume to (costume1 v)\n\nwhen I start as a clone\nif <(id) = [0]> then\n    show\n    switch costume to (costume2 v)\n    go to [back v] layer\nelse\n    show\n    switch costume to (costume3 v)\n    set [ghost v] effect to (30)\n    go to [front v] layer\n    go to x: (-200) y: (0)\n    turn right (50) degrees\n    start sound [Low Whoosh v]\n    repeat (25)\n        change x by (20)\n    end\n    hide\n    broadcast (INITIATE CLOUD JOIN v) and wait\nend\n\nwhen I receive [initiate cloud join v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\n@detector\n\nwhen flag clicked\nwait until <<(Loved?) = [1]> and <(Stared?) = [1]>>\nstop [other scripts in sprite v]\nset [lock v] to [1]\nswitch costume to (costume2 v)\nclear graphic effects\ngo to x: (150) y: (250)\nshow\nrepeat (10)\n    change y by (-3)\nend\nwait (5) seconds\nrepeat (10)\n    change y by (3)\nend\nhide\nstop [this script v]\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [play game v]\nset [lock v] to [0]\nforever\n    if <not <<(Loved?) = [1]> and <(Stared?) = [1]>>> then\n        switch costume to (costume1 v)\n        go to x: (150) y: (100)\n        show\n        go to [front v] layer\n        set [ghost v] effect to (100)\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        wait (3) seconds\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        wait (20) seconds\n    else\n        stop [this script v]\n    end\nend\n\nwhen I receive [skiin v]\nstop [other scripts in sprite v]\nhide\n\nforever\n    if <not <<(Loved?) = [1]> and <(Stared?) = [1]>>> then\n        switch costume to (costume1 v)\n        go to x: (150) y: (100)\n        show\n        go to [front v] layer\n        set [ghost v] effect to (100)\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        wait (3) seconds\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        wait (20) seconds\n    else\n        stop [this script v]\n    end\nend\n\n@Detector\n\nwhen flag clicked\nset [both??? v] to [0]\nset [star v] to [false]\nset [heart v] to [false]\nshow\nset [stared? v] to [0]\nset [loved? v] to [0]\n\nwhen flag clicked\nset [detector di v] to [1]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(detector DI) = [1]> then\n    switch costume to (fave v)\n    set [detector di v] to [2]\n    create clone of (_myself_ v)\n    go to x: (-15) y: (0)\n    forever\n        set [star v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [stared? v] to [1]\n        end\n    end\nelse\n    switch costume to (love v)\n    go to x: (-15) y: (0)\n    show\n    forever\n        set [heart v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [loved? v] to [1]\n        end\n    end\nend\n\n@OTHERS\n\ndefine point towards x: (x) y: (y)\nif <not <(y) < (y position)>> then\n    point in direction ([atan v] of (((x) - (x position)) / ((y) - (y position))) )\nelse\n    point in direction ((180) + ([atan v] of (((x) - (x position)) / ((y) - (y position))) ))\nend\n\ndefine begin decode of (encoded)\nset [encoded v] to (encoded)\nset [# v] to [1]\n\ndefine value = read from encoded\nset [value v] to []\nforever\n    set [idx v] to (join (letter (#) of (encoded)) (letter ((#) + (1)) of (encoded)))\n    change [# 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 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                            set [value v] to (☁ P8)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine clone\nset [offline v] to [100]\nset [player # v] to [1]\ndelete all of [buffer v]\nhide\nrepeat ((MAX PLAYERS) - (1))\n    create clone of (_myself_ v)\n    change [player # v] by (1)\nend\n\nwhen I receive [setup others v]\nclone\ndelete all of [arrows v]\ndelete all of [arrow what to read? v]\nlist\n\ndefine TICK\nvalue = cloud # (player #)\nif <(join [A] (value)) = (last value)> then\n    change [offline v] by (1)\n    if <(offline) > [99]> then\n        hide\n        stop [this script v]\n    end\nelse\n    set [last value v] to (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    if <(value) = [Y]> then\n        if <(distance to [g v]) < [50]> then\n            broadcast (PUSHED v)\n        end\n    end\n    value = read from encoded\n    point in direction (value)\n    value = read from encoded\n    say (value)\n    value = read from encoded\n    value = read from encoded\n    switch costume to (value)\n    value = read from encoded\n    repeat until <(value) = []>\n        add (value) to [buffer v]\n        value = read from encoded\n    end\nend\nbuffer\n\nwhen flag clicked\nset [11debug v] to [0]\nhide\n\nwhen I receive [cloud join 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 [tick v]\nif <(MY PLAYER #) = (player #)> then\n    set [offline v] to [100]\n    hide\nelse\n    TICK\nend\n\ndefine buffer\nif <(length of [buffer v]) > [0]> then\n    set x to ((item (1) of [buffer v]) - (SCROLL X))\n    set [x previous for relocation v] to ((item (1) of [buffer v]) - (SCROLL X))\n    delete (1) of [buffer v]\n    set y to ((item (1) of [buffer v]) - (SCROLL Y))\n    if <<(x previous for relocation) = (x position)> and <((item (1) of [buffer v]) - (SCROLL Y)) = (y position)>> then\n        show\n    else\n        arrows\n    end\n    delete (1) of [buffer v]\nend\n\ndefine arrows\nif <(x position) > [234]> then\n    set x to (235)\n    switch costume to (real v)\n    set [point v] to (y position)\n    set y to ((point) / (2))\n    point towards x: (357) y: (point)\nelse\n    if <[-234] > (x position)> then\n        set x to (-235)\n        switch costume to (real v)\n        set [point v] to (y position)\n        set y to ((point) / (2))\n        point towards x: (-357) y: (point)\n    else\n        if <(y position) > [174]> then\n            set y to (175)\n            switch costume to (real v)\n            set [point v] to (x position)\n            set x to ((point) / (2))\n            point towards x: (point) y: (177)\n        else\n            if <[-174] > (y position)> then\n                set y to (-175)\n                switch costume to (real v)\n                set [point v] to (x position)\n                set x to ((point) / (2))\n                point towards x: (point) y: (-177)\n            end\n        end\n    end\nend\nsay []\n\ndefine list\nrepeat (16)\n    add [] to [arrows v]\nend\nrepeat (8)\n    add [] to [arrow what to read? v]\nend\n\ndefine move\nswitch costume to (sens v)\nrepeat until <touching (_edge_ v)?>\n    move (10) steps\nend\nswitch costume to (real v)\n\n@CLOUD UI\n\nwhen I receive [cloud join v]\ngo to x: (0) y: (0)\nshow\nswitch costume to (connecting v)\ngo to [front v] layer\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\ngo to [front v] layer\ngo to x: (0) y: (-170)\nswitch costume to (cloud v)\nshow\nrepeat (40)\n    change y by ([abs v] of ((y position) / (12)) )\nend\n\nwhen I receive [cloud joined v]\nnext costume\nwait (2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [cloud fail v]\nnext costume\nnext costume\nwait (4) seconds\nstop [all v]\n\nwhen I receive [green flag v]\nhide\n\n@lava\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 [tick v]\npostion ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [reset v]\nhide\ndelete this clone\n\nwhen I receive [setup v]\ngo to [back v] layer\nshow\nset [x v] to [225]\nset [y v] to [26]\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nset [x v] to [500]\nset [y v] to [12]\nswitch costume to (2 v)\ncreate clone of (_myself_ v)\nset [x v] to [1000]\nset [y v] to [-65]\nswitch costume to (3 v)\ncreate clone of (_myself_ v)\nset [x v] to [9999]\n\nwhen I start as a clone\nforever\n    repeat (20)\n        change [y v] by (0.25)\n    end\n    repeat (20)\n        change [y v] by (-0.25)\n    end\nend\n\n@spring\n\nwhen I receive [setup v]\nshow\nset [x v] to [733]\nset [y v] to [8]\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nset [x v] to [1435]\nset [y v] to [408]\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nset [x v] to [448]\nset [y v] to [556]\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nset [x v] to [99999]\n\nwhen I receive [tick v]\npostion ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nset [all clear v] to []\n\ndefine postion (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\n    if <touching (g v)?> then\n        if <(...ALL PLAYER Y) > ((y) + (40))> then\n            set [.\(initiate\) v] to [1]\n        end\n    end\nelse\n    hide\nend\n\nwhen I receive [reset v]\nhide\ndelete this clone\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\nwhen I start as a clone\nforever\n    if <(.\(initiate\)) = [1]> then\n        set [cost v] to [0]\n        repeat (7)\n            change [cost v] by (1)\n            switch costume to (cost)\n        end\n        repeat (6)\n            change [cost v] by (-1)\n            switch costume to (cost)\n        end\n        set [.\(initiate\) v] to [0]\n    end\nend\n\nif <touching (g v)?> then\nend\n\n@Czechpoint\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\nwhen I receive [green flag v]\nset [czeckpoint v] to [1]\nhide\n\nwhen I receive [play game v]\nset [czeckpoint v] to [1]\nshow\n\nwhen I receive [reset v]\nhide\ndelete this clone\n\ndefine postion (x) (y)\nif <<(id) = (Czeckpoint)> or <(Czeckpoint) > (id)>> then\n    switch costume to (y v)\nend\nif <touching (g v)?> then\n    if <(costume [number v]) = [1]> then\n        start sound [pixabay v]\n        switch costume to (y v)\n        change [czeckpoint v] by (1)\n    end\nend\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 [tick v]\npostion ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nswitch costume to (n v)\nset [id v] to [2]\nset [x v] to [930]\nset [y v] to [456]\ncreate clone of (_myself_ v)\nset [id v] to [3]\nset [x v] to [650]\nset [y v] to [855]\ncreate clone of (_myself_ v)\n\n@enemy\n\nwhen I receive [setup v]\nset [@local v] to [0]\nset [x v] to [1200]\nset [range v] to [25]\nset [y v] to [398]\nset [death lock? v] to [0]\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nset [x v] to [745]\nset [range v] to [10]\nset [y v] to [798]\ncreate clone of (_myself_ v)\nset [x v] to [99999]\n\nwhen I receive [tick v]\npostion ((x) - (SCROLL X)) ((y) - (SCROLL Y))\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\nif <touching (g v)?> then\n    if <(...ALL PLAYER Y) > ((y) + (15))> then\n        set [death lock? v] to [v]\n        set [@local v] to [1]\n        broadcast (dead v)\n    else\n        broadcast (A v)\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [reset v]\nhide\ndelete this clone\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\nwhen I start as a clone\nforever\n    repeat (range)\n        change [x v] by (5)\n    end\n    repeat (round ((range) / (2)))\n        change [x v] by (3)\n    end\n    repeat (round ((range) / (4)))\n        change [x v] by (1)\n    end\n    repeat (range)\n        change [x v] by (-5)\n    end\n    repeat (round ((range) / (2)))\n        change [x v] by (-3)\n    end\n    repeat (round ((range) / (4)))\n        change [x v] by (-1)\n    end\nend\n\nwhen I receive [dead v]\nif <(@local) > [0]> then\n    repeat (7)\n        next costume\n    end\n    change [gift counter v] by (1)\n    set [death lock? v] to [0]\n    delete this clone\nend\n\n@presents\n\nwhen I receive [green flag v]\nset [gift counter v] to [0]\nhide\n\nwhen I receive [tick v]\npostion ((x) - (SCROLL X)) ((y) - (SCROLL Y))\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\nif <touching (g v)?> then\n    change [gift counter v] by (1)\n    start sound [pop v]\n    delete this clone\nend\n\nwhen I receive [setup v]\nhide\nswitch costume to (1 v)\npoint in direction (90)\nset [x v] to [70]\nset [y v] to [145]\nset [@id v] to (y)\ncreate clone of (_myself_ v)\nset [x v] to [734]\nset [y v] to [400]\nset [@id v] to (y)\ncreate clone of (_myself_ v)\nset [x v] to [1274]\nset [y v] to [450]\nset [@id v] to (y)\ncreate clone of (_myself_ v)\nset [x v] to [1348]\nset [y v] to [850]\nset [@id v] to (y)\ncreate clone of (_myself_ v)\nset [x v] to [404]\nset [y v] to [1100]\nset [@id v] to (y)\ncreate clone of (_myself_ v)\nset [x v] to [582]\nset [y v] to [120]\nset [@id v] to (y)\ncreate clone of (_myself_ v)\nset [x v] to [734]\nset [y v] to [300]\nset [@id v] to (y)\ncreate clone of (_myself_ v)\nset [x v] to [1100]\nset [y v] to [800]\nset [@id v] to (y)\ncreate clone of (_myself_ v)\nset [x v] to [9999]\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\nwhen I start as a clone\nforever\n    set [y v] to ((@id) + ([sin v] of ((timer) * (700)) ))\nend\n\n@moving\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]\nset [x v] to [1180]\nset [y v] to [700]\nswitch costume to (level 1 8 v)\ncreate clone of (_myself_ v)\nset [x v] to [9999]\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\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    forever\n        set [platform speed v] to [-4]\n        repeat (50)\n            change [x v] by (-4)\n        end\n        set [platform speed v] to [4]\n        repeat (50)\n            change [x v] by (4)\n        end\n    end\nend\n\nif <touching (g v)?> then\nif <touching (g v)?> then\n\n@control\n\nwhen flag clicked\nhide\n\nwhen I receive [play game v]\nshow\ngo to [front v] layer\nset size to (80) %\nset [ghost v] effect to (70)\nset [@pc? v] to [0]\nset [@radius v] to ((size) / (2.5))\nforever\n    switch costume to (base v)\n    go to x: (-180) y: (-120)\n    repeat until <not <mouse down?>>\n        keyboard controls\n    end\n    repeat until <mouse down?>\n        keyboard controls\n    end\n    if <(distance to [mouse-pointer v]) < (size)> then\n        stick activated\n    end\nend\n\ndefine stick activated\ngo to (mouse-pointer v)\nswitch costume to (ready v)\ncreate clone of (_myself_ v)\nswitch costume to (stick v)\ncreate clone of (_myself_ v)\nswitch costume to (base active v)\nset [stick button v] to []\nrepeat until <(distance to [mouse-pointer v]) > ((size) * (1.1))>\n    detect stick movement\n    detect stick button\nend\nbroadcast (@ignore v)\n\ndefine detect stick movement\nset [stick x v] to (((mouse x) - (x position)) / (@radius))\nset [stick y v] to (((mouse y) - (y position)) / (@radius))\nif <([abs v] of (STICK X) ) > [1]> then\n    set [stick x v] to ((STICK X) / ([abs v] of (STICK X) ))\nend\nif <([abs v] of (STICK Y) ) > [1]> then\n    set [stick y v] to ((STICK Y) / ([abs v] of (STICK Y) ))\nend\n\ndefine detect stick button\nif <mouse down?> then\n    if <(STICK BUTTOn) > []> then\n        change [stick button v] by (1)\n    end\nelse\n    set [stick button v] to [0]\nend\n\ndefine keyboard controls\nset [stick x v] to <<key (right arrow v) pressed?> or <key (d v) pressed?>>\nchange [stick x v] by ((0) - <<key (left arrow v) pressed?> or <key (a v) pressed?>>)\nset [stick y v] to <<key (up arrow v) pressed?> or <key (w v) pressed?>>\nchange [stick y v] by ((0) - <<key (down arrow v) pressed?> or <key (s v) pressed?>>)\nif <<key (space v) pressed?> or <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n    change [stick button v] by (1)\n    set [@pc? v] to [1]\n    hide\nelse\n    set [stick button v] to [0]\nend\n\nwhen I receive [@ignore v]\ndelete this clone\n\nwhen I start as a clone\nif <(costume [name v]) = [stick]> then\n    go [forward v] (1) layers\n    set [ghost v] effect to (0)\n    forever\n        go to (control v)\n        change x by ((STICK X) * (@radius))\n        change y by ((STICK Y) * (@radius))\n    end\nend\ngo to x: (180) y: (-120)\nswitch costume to (base active v)\nforever\n    if <mouse down?> then\n        set [ghost v] effect to (25)\n    else\n        set [ghost v] effect to (75)\n    end\nend\n\nstop [other scripts in sprite v]\nbroadcast (@ignore v)\nstop [this script v]\n\nif <key (any v) pressed?> then\n    hide\n    set [11debug v] to [5]\nelse\n    show\n    set [11debug v] to [0]\nend\n\n@Sprite1\n\nwhen flag clicked\nset [purchased? v] to [1]\nset [..shop open? v] to [N]\ndelete all of [bought v]\nrepeat (3)\n    add [] to [bought v]\nend\nhide\n\nwhen I receive [tick v]\nif <(@PC?) = [0]> then\n    hide\n    stop [this script v]\nend\nswitch costume to (..SHOP OPEN?)\nif <(costume [name v]) = [Y]> then\n    switch costume to (join [Y] (join (item (1) of [bought v]) (join (item (2) of [bought v]) (item (3) of [bought v]))))\nend\nshow\ngo to [front v] layer\nif <(..SHOP OPEN?) = [N]> then\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (70)\n        if <mouse down?> then\n            set [..shop open? v] to [Y]\n            set [wait v] to (timer)\n            set [ghost v] effect to (0)\n        end\n    else\n        set [ghost v] effect to (0)\n    end\nend\nif <(..SHOP OPEN?) = [Y]> then\n    if <<(mouse x) > [20]> and <<(mouse y) > [50]> and <<(mouse x) < [64]> and <<(mouse y) < [80]> and <mouse down?>>>>> then\n        if <(GIFT COUNTER) > [2]> then\n            if <(item (1) of [bought v]) = []> then\n                change [gift counter v] by (-3)\n                replace item (1) of [bought v] with [1]\n                switch costume to (join [Y] (join (item (1) of [bought v]) (join (item (2) of [bought v]) (item (3) of [bought v]))))\n            end\n        end\n    end\n    if <<(mouse x) > [20]> and <<(mouse y) > [-20]> and <<(mouse x) < [64]> and <<(mouse y) < [10]> and <mouse down?>>>>> then\n        if <(GIFT COUNTER) > [4]> then\n            if <(item (2) of [bought v]) = []> then\n                broadcast (skiin v)\n                change [gift counter v] by (-5)\n                replace item (2) of [bought v] with [2]\n                switch costume to (join [Y] (join (item (1) of [bought v]) (join (item (2) of [bought v]) (item (3) of [bought v]))))\n            end\n        end\n    end\n    if <<(mouse x) > [20]> and <<(mouse y) > [-76]> and <<(mouse x) < [64]> and <<(mouse y) < [-50]> and <mouse down?>>>>> then\n        if <(GIFT COUNTER) > [9]> then\n            if <(item (3) of [bought v]) = []> then\n                change [gift counter v] by (-10)\n                replace item (3) of [bought v] with [3]\n                switch costume to (join [Y] (join (item (1) of [bought v]) (join (item (2) of [bought v]) (item (3) of [bought v]))))\n            end\n        end\n    end\nend\nif <(timer) > ((wait) + (1))> then\n    if <<mouse down?> and <not <touching (mouse-pointer v)?>>> then\n        set [..shop open? v] to [N]\n    end\nend\n\nclone quick\n\ndefine clone quick\nswitch costume to (5 v)\nrepeat (3)\n    create clone of (_myself_ v)\n    next costume\nend\n\nwhen I start as a clone\n\nwhen I receive [play game v]\n\nset [@count v] to [1]\n\nforever\n\nforever\n    if <(..SHOP OPEN?) = [N]> then\n        delete this clone\n    end\n    if <(costume [number v]) > (PURCHASED?)> then\n        switch costume to (3 v)\n    else\n        if <touching (mouse-pointer v)?> then\n            set [ghost v] effect to (70)\n            if <mouse down?> then\n                change [purchased? v] by (1)\n            end\n        else\n            set [ghost v] effect to (0)\n        end\n    end\nend\n\n@chat\n\nwhen flag clicked\ngo to x: (400) y: (0)\nset [@active v] to [0]\nhide\n\nwhen [c v] key pressed\nif <(item (1) of [bought v]) = [1]> then\n    if <(@active) = [0]> then\n        set [@active v] to [1]\n        show\n        repeat (12)\n            change x by (-10)\n        end\n        forever\n            if <key (1 v) pressed?> then\n                set [@chat? v] to (item (1) of [chats! v])\n                set [@active v] to [0]\n                repeat (12)\n                    change x by (10)\n                end\n                broadcast (msg v)\n                stop [this script v]\n            end\n            if <key (2 v) pressed?> then\n                set [@chat? v] to (item (2) of [chats! v])\n                set [@active v] to [0]\n                repeat (12)\n                    change x by (10)\n                end\n                broadcast (msg v)\n                stop [this script v]\n            end\n            if <key (3 v) pressed?> then\n                set [@chat? v] to (item (3) of [chats! v])\n                set [@active v] to [0]\n                repeat (12)\n                    change x by (10)\n                end\n                broadcast (msg v)\n                stop [this script v]\n            end\n            if <key (4 v) pressed?> then\n                set [@chat? v] to (item (4) of [chats! v])\n                set [@active v] to [0]\n                repeat (12)\n                    change x by (10)\n                end\n                broadcast (msg v)\n                stop [this script v]\n            end\n            if <key (5 v) pressed?> then\n                set [@chat? v] to (item (5) of [chats! v])\n                set [@active v] to [0]\n                repeat (12)\n                    change x by (10)\n                end\n                broadcast (msg v)\n                stop [this script v]\n            end\n            if <key (6 v) pressed?> then\n                set [@chat? v] to (item (6) of [chats! v])\n                set [@active v] to [0]\n                repeat (12)\n                    change x by (10)\n                end\n                broadcast (msg v)\n                stop [this script v]\n            end\n            if <key (7 v) pressed?> then\n                set [@chat? v] to (item (7) of [chats! v])\n                set [@active v] to [0]\n                repeat (12)\n                    change x by (10)\n                end\n                broadcast (msg v)\n                stop [this script v]\n            end\n            if <key (8 v) pressed?> then\n                set [@chat? v] to (item (8) of [chats! v])\n                set [@active v] to [0]\n                repeat (12)\n                    change x by (10)\n                end\n                broadcast (msg v)\n                stop [this script v]\n            end\n            if <mouse down?> then\n                if <not <touching (mouse-pointer v)?>> then\n                    set [@active v] to [0]\n                    repeat (12)\n                        change x by (10)\n                    end\n                    stop [this script v]\n                end\n            end\n        end\n    end\n    show\nend\n\nset [@chat? v] to (item (8) of [chats! v])\nrepeat (10)\n    change x by (25)\n    stop [this script v]\nend\n\nwhen I receive [msg v]\nwait (7) seconds\nset [@chat? v] to []\n\nwhen this sprite clicked\nif <(item (1) of [bought v]) = [1]> then\n    if <(@active) = [0]> then\n        set [@active v] to [1]\n        show\n        repeat (12)\n            change x by (-10)\n        end\n        forever\n            if <key (1 v) pressed?> then\n                set [@chat? v] to (item (1) of [chats! v])\n                set [@active v] to [0]\n                repeat (12)\n                    change x by (10)\n                end\n                broadcast (msg v)\n                stop [this script v]\n            end\n            if <key (2 v) pressed?> then\n                set [@chat? v] to (item (2) of [chats! v])\n                set [@active v] to [0]\n                repeat (12)\n                    change x by (10)\n                end\n                broadcast (msg v)\n                stop [this script v]\n            end\n            if <key (3 v) pressed?> then\n                set [@chat? v] to (item (3) of [chats! v])\n                set [@active v] to [0]\n                repeat (12)\n                    change x by (10)\n                end\n                broadcast (msg v)\n                stop [this script v]\n            end\n            if <key (4 v) pressed?> then\n                set [@chat? v] to (item (4) of [chats! v])\n                set [@active v] to [0]\n                repeat (12)\n                    change x by (10)\n                end\n                broadcast (msg v)\n                stop [this script v]\n            end\n            if <key (5 v) pressed?> then\n                set [@chat? v] to (item (5) of [chats! v])\n                set [@active v] to [0]\n                repeat (12)\n                    change x by (10)\n                end\n                broadcast (msg v)\n                stop [this script v]\n            end\n            if <key (6 v) pressed?> then\n                set [@chat? v] to (item (6) of [chats! v])\n                set [@active v] to [0]\n                repeat (12)\n                    change x by (10)\n                end\n                broadcast (msg v)\n                stop [this script v]\n            end\n            if <key (7 v) pressed?> then\n                set [@chat? v] to (item (7) of [chats! v])\n                set [@active v] to [0]\n                repeat (12)\n                    change x by (10)\n                end\n                broadcast (msg v)\n                stop [this script v]\n            end\n            if <key (8 v) pressed?> then\n                set [@chat? v] to (item (8) of [chats! v])\n                set [@active v] to [0]\n                repeat (12)\n                    change x by (10)\n                end\n                broadcast (msg v)\n                stop [this script v]\n            end\n            if <mouse down?> then\n                if <not <touching (mouse-pointer v)?>> then\n                    set [@active v] to [0]\n                    repeat (12)\n                        change x by (10)\n                    end\n                    stop [this script v]\n                end\n            end\n        end\n    end\n    show\nend\n\n@text engine\n\nwhen flag clicked\nhide\n\nwhen I receive [play game v]\nhide\ngo to x: (150) y: (154)\nset [@index v] to [1]\nrepeat (4)\n    create clone of (_myself_ v)\n    change x by ((size) / (4))\n    change [@index v] by (1)\nend\n\nset [gift counter v] to [99]\n\nwhen I start as a clone\nshow\n\nwhen I receive [tick v]\nset x to ((((@index) - (0.5)) - ((length of (GIFT COUNTER)) / (2))) * ((size) / (4)))\nanimation (letter (@index) of (GIFT COUNTER))\nchange size by ((0.2) * ((100) - (size)))\n\ndefine animation (costume)\nif <not <(costume) = (costume [name v])>> then\n    switch costume to (costume)\n    set size to (120) %\nend\n\n