BIEDRONKA - a scrolling platformer in 1h

Instructions: speedrunning: on !!!\n\nThis project was made in 1h, consider it while commenting.\n\nTen projekt został zrobiony w godzinę, weź to pod uwagę podczas komentowania.\n\nw,a,s,d / strzałki - sterowanie\nzbieraj mleka aby wygrać!\n\nteż możecie zrobić takie wyzwanie na projekt w godzinę c:, napiszcie w komentarzach czy chcecie takie globalne wyzwanie!

@Stage\n\nwhen flag clicked\nset [brightness v] effect to (-30)\n\nwhen flag clicked\nforever\n    play sound [touhou-155-aocf-ost-tonight-stars-an-easygoing-egoist-live-ver-egoistic-flowers v] until done\nend\n\n@gracz\n\nwhen flag clicked\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game 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) and wait\n    end\n    if <(EXIT) = [win]> then\n        Game - Win\n    else\n        Game - Die\n    end\nend\n\ndefine Game On\nset [y v] to [0]\nset [x v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset [ghost v] effect to (0)\nset size to (100) %\nshow\n\ndefine Tick\nswitch costume to (player v)\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [sx v] by (-2)\n    point in direction (-90)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [sx v] by (2)\n    point in direction (90)\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 <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    if <(in air) < [4]> then\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\nset [scroll x v] to (x)\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (10)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(y) < [-180]> then\n    set [exit v] to [die]\nend\nswitch costume to (biedronka v)\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    switch costume to (chodzenie)\nelse\n    switch costume to (biedronka v)\nend\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (poziom 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 (poziom v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (poziom v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <key (up arrow 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 [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (poziom 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 - Die\nset [exit v] to []\nrepeat (5)\n    hide\n    wait (.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\n\ndefine Test - Die\nif <touching (danger v)?> then\n    set [exit v] to [die]\nend\n\ndefine Game - Win\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\nwhen flag clicked\nforever\n    set [chodzenie v] to [2]\n    wait (0.2) seconds\n    set [chodzenie v] to [3]\n    wait (0.2) seconds\n    set [chodzenie v] to [4]\n    wait (0.2) seconds\nend\n\nwhen I receive [zakończ grę v]\nhide\n\nset [☁ highscore v] to [12.111]\n\n@poziom\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\npozycja ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nswitch costume to (poziom 0 0 v)\nhide\nset [x v] to [0]\nset [y v] to [0]\nTWÓRZ KLONY WRY x: [0] y: [0]\nTWÓRZ KLONY WRY x: [360] y: [0]\nTWÓRZ KLONY WRY x: ((360) * (2)) y: [0]\nTWÓRZ KLONY WRY x: ((360) * (3)) y: [0]\nTWÓRZ KLONY WRY x: ((360) * (4)) y: [0]\nTWÓRZ KLONY WRY x: ((360) * (5)) y: [180]\nTWÓRZ KLONY WRY x: ((360) * (7)) y: [0]\nTWÓRZ KLONY WRY x: ((360) * (8)) y: [0]\nTWÓRZ KLONY WRY x: ((360) * (9)) y: [0]\nTWÓRZ KLONY WRY x: ((360) * (10)) y: [0]\nTWÓRZ KLONY WRY x: ((360) * (11)) y: [0]\nTWÓRZ KLONY WRY x: ((360) * (12)) y: [0]\nTWÓRZ KLONY WRY x: ((360) * (13)) y: [180]\nset [x v] to []\nset [y v] to []\nbroadcast (setap v.2 v)\n\ndefine pozycja (x) (y)\nif <<(x) = []> and <(y) = []>> then\n    hide\nelse\n    go to x: (x) y: (y)\n    if <<(x) = (x position)> and <(y) = (y position)>> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine TWÓRZ KLONY WRY x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nnext costume\n\nnext costume\nnext costume\n\n@tło\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\npozycja ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setap v.2 v]\nswitch costume to (poziom 0 0 v)\nset [ghost v] effect to (30)\nhide\nset [x v] to [0]\nset [y v] to [0]\nTWÓRZ KLONY WRY x: [0] y: [0]\nTWÓRZ KLONY WRY x: [360] y: [0]\nTWÓRZ KLONY WRY x: ((360) * (2)) y: [0]\nTWÓRZ KLONY WRY x: ((360) * (3)) y: [0]\nTWÓRZ KLONY WRY x: ((360) * (4)) y: [0]\nTWÓRZ KLONY WRY x: ((360) * (5)) y: [180]\nTWÓRZ KLONY WRY x: ((360) * (7)) y: [0]\nTWÓRZ KLONY WRY x: ((360) * (8)) y: [0]\nTWÓRZ KLONY WRY x: ((360) * (9)) y: [0]\nTWÓRZ KLONY WRY x: ((360) * (10)) y: [0]\nTWÓRZ KLONY WRY x: ((360) * (11)) y: [0]\nTWÓRZ KLONY WRY x: ((360) * (12)) y: [0]\nTWÓRZ KLONY WRY x: ((360) * (13)) y: [180]\nset [x v] to []\nset [y v] to []\n\ndefine pozycja (x) (y)\nif <<(x) = []> and <(y) = []>> then\n    hide\nelse\n    go to x: (x) y: (y)\n    if <<(x) = (x position)> and <(y) = (y position)>> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine TWÓRZ KLONY WRY x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nnext costume\n\nnext costume\nnext costume\n\n@mleczko\n\nwhen [space v] key pressed\nadd (((SCROLL X) + ([x position v] of [gracz v])) + (mouse x)) to [x i y mleczka v]\nadd (((SCROLL Y) + ([y position v] of [gracz v])) + (mouse y)) to [x i y mleczka v]\n\nwhen flag clicked\nTWÓRZ KLONY PAJACU\n\ndefine TWÓRZ KLONY PAJACU\nset [id v] to [0]\nrepeat ((length of [x i y mleczka v]) / (2))\n    switch costume to (kostium1 v)\n    change [id v] by (1)\n    set [x v] to (item (id) of [x i y mleczka v])\n    change [id v] by (1)\n    set [y v] to (item (id) of [x i y mleczka v])\n    create clone of (_myself_ v)\nend\nset [id v] to [0]\n\nwhen I receive [tick v]\npozycja ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine pozycja (x) (y)\nif <(id) = [0]> then\n    hide\nelse\n    go to x: (x) y: (y)\n    if <<(x) = (x position)> and <(y) = (y position)>> then\n        show\n        if <touching (gracz v)?> then\n            start sound [Coin v]\n            change [zebrane mleka v] by (1)\n            delete this clone\n        end\n        if <(id) = [18]> then\n            switch costume to (kostium2 v)\n        else\n            switch costume to (kostium1 v)\n        end\n    else\n        hide\n    end\nend\n\ndelete all of [x i y mleczka v]\n\nwhen flag clicked\nset [zebrane mleka v] to [0]\nwait until <(zebrane mleka) = [9]>\nbroadcast (zakończ grę v)\n\n@wgrałeś pog cham,p\n\nwhen flag clicked\nhide variable [☁ highscore v]\nhide variable [your score v]\nswitch costume to (gra zatrzymana v)\nset [ghost v] effect to (100)\ngo to [front v] layer\nforever\n    set [your score v] to (timer)\nend\n\nwhen I receive [zakończ grę v]\nswitch costume to (kostium1 v)\nshow variable [☁ highscore v]\nshow variable [your score v]\nif <(☁ HIGHSCORE) > (YOUR SCORE)> then\n    set [☁ highscore v] to (YOUR SCORE)\nend\nstop [all v]\n\ngo to [front v] layer\n\n@Duszek1\n\nwhen flag clicked\nset [zebrane mleka v] to [0]\nhide\n\n