Scrolling platformer (hard)

Instructions: Moving: left arrow, up arrow, right arrow or W, A, S, D\n\nThanks @griffpatch for some scripts\n\n\nplease love and follow. I worked on this project for many hours.\n\n200 like= new version\n\nlink to my yt channel\n\nhttps://www.youtube.com/channel/UCuNIninYPcXMIlwN4z8EgUw

@Stage\n\nwhen [m v] key pressed\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [, ] ((mouse y) + (SCROLL Y))))\nshow variable [mouse v]\n\n@Player\n\nwhen flag clicked\nset [your time v] to [0]\n\nwhen flag clicked\nhide variable [your time v]\nwait until <<key (up arrow v) pressed?> or <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>>>\nshow variable [your time v]\nrepeat until <(LEVEL) = [4]>\n    change [your time v] by (0.1)\n    wait (0.1) seconds\nend\nif <[] > (your time)> then\n    wait (5) seconds\n    set [your time v] to [0]\n    stop [this script v]\nelse\n    set [your time v] to [0]\n    wait (5) seconds\n    stop [this script v]\nend\n\ndefine game on\nset [x v] to [0]\nset [y v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset size to (50) %\npoint in direction (90)\nset [ghost v] effect to (0)\nshow\n\ndefine tick\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [sx v] by (-2.5)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [sx v] by (2.5)\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)\nposition\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)) / (9)))\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\nif <touching (trampoline v)?> then\n    set [sy v] to [35]\nend\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) > [0]>\n        tick\n        broadcast (tick v)\n    end\n    if <(EXIT) = [win]> then\n        Game- win\n    else\n        game die\n    end\nend\n\nwhen flag clicked\nhide\nswitch backdrop to (tło3 v)\nhide variable [points all v]\nhide variable [collected v]\nwait (6.5) seconds\nhide variable [collected v]\nswitch backdrop to (dzień v)\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\ndefine change player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nposition\nrepeat until <not <<touching (platforms v)?> or <touching (moving platforms 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 (platforms v)?> then\n    repeat (12)\n        change [y v] by (1)\n        position\n        if <not <<touching (platforms v)?> or <touching (moving platforms v)?>>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<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 [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <<touching (platforms v)?> or <touching (moving platforms 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 (15)\n    change [ghost v] effect by (7)\nend\nhide\nwait (0.5) seconds\n\nhide\nwait (0.1) seconds\nshow\nwait (0.1) 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\nwait (6.5) seconds\nforever\n    play sound [Closer - The Chainsmokers, Halsey \(320kbps\).mp3 v] until done\nend\n\nwhen flag clicked\nif <(username) = [slonslonslon777]> then\n    broadcast (slonslonslon777 v)\nend\n\nwhen I receive [slonslonslon777 v]\nchange [☁ slonslonslon777 v] by (1)\n\nwhen flag clicked\nif <(username) = [griffpatch]> then\n    broadcast (griffpatch v)\nend\n\nwhen I receive [griffpatch v]\nchange [☁ griffpatch v] by (1)\n\nwhen flag clicked\nforever\n    set [points all v] to (join (COLLECTED) (join [ / ] (COLLECTED MAX.)))\nend\n\nwhen flag clicked\nforever\n    hide variable [mouse v]\nend\n\n@Platforms\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    clone at x: [500] y: [0]\n    clone at x: [360] y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        clone at x: [-87] y: [298]\n        clone at x: [100] y: [600]\n        clone at x: [1000] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            clone at x: [1200] y: [0]\n            clone at x: [500] y: [0]\n            clone at x: [600] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n            end\n        end\n    end\nend\n\ndefine position (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]\nposition ((X) - (SCROLL X)) ((y) - (SCROLL Y))\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\nwhen I receive [noc v]\nset [brightness v] effect to (-30)\n\nwhen I receive [dzień v]\nset [brightness v] effect to (-12)\n\n@Danger\n\nwhen I receive [green flag v]\nhide\ngo [forward v] (2) layers\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    clone at x: [119] y: [-108]\n    clone at x: [704] y: [-69]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        clone at x: [-142] y: [590]\n        clone at x: [100] y: [250]\n        clone at x: [900] y: [0]\n        clone at x: [600] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            clone at x: [700] y: [-100]\n            clone at x: [500] y: [0]\n            clone at x: [700] y: [0]\n        else\n            switch costume to (level 3 5 v)\n        end\n    end\nend\n\ndefine position (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]\nposition ((X) - (SCROLL X)) ((y) - (SCROLL Y))\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\nwhen flag clicked\ngo to [back v] layer\n\nwhen I receive [dzień v]\nclear graphic effects\n\n@points\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [collected max. v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (dot v)\n    clone at x: [120] y: [-40]\n    clone at x: [170] y: [-40]\n    clone at x: [473] y: [68]\n    clone at x: [530] y: [310]\n    clone at x: [700] y: [-30]\n    clone at x: [900] y: [-30]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (dot v)\n        clone at x: [-85] y: [75]\n        clone at x: [140] y: [-10]\n        clone at x: [-100] y: [250]\n        clone at x: [-30] y: [570]\n        clone at x: [-150] y: [930]\n        clone at x: [137] y: [930]\n        clone at x: [337] y: [930]\n        clone at x: [545] y: [930]\n        clone at x: [943] y: [930]\n        clone at x: [1117] y: [930]\n        clone at x: [1188] y: [1210]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (dot v)\n            clone at x: [85] y: [-25]\n            clone at x: [200] y: [-25]\n            clone at x: [330] y: [-25]\n            clone at x: [500] y: [-25]\n            clone at x: [700] y: [40]\n            clone at x: [900] y: [-40]\n            clone at x: [1000] y: [50]\n            clone at x: [1685] y: [301]\n            clone at x: [1930] y: [301]\n            clone at x: [2200] y: [301]\n            clone at x: [2460] y: [301]\n        end\n    end\nend\nset [x v] to [-99999]\n\ndefine position (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]\nposition ((X) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    change [collected v] by (1)\n    if <(COLLECTED) = (COLLECTED MAX.)> then\n        broadcast (open portal v)\n    end\n    delete this clone\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\nchange [collected max. v] by (1)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\nwhen I receive [noc v]\nset [brightness v] effect to (-15)\n\nwhen I receive [dzień v]\nclear graphic effects\n\n@exit\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (close v)\n    clone at x: [1100] y: [-20]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (close v)\n        clone at x: [1450] y: [1060]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (close v)\n            clone at x: [2700] y: [40]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (close v)\n                clone at x: [2700] y: [10000]\n            end\n        end\n    end\nend\n\ndefine position (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]\nposition ((X) - (SCROLL X)) ((y) - (SCROLL Y))\nif <<(costume [number v]) = [2]> and <touching (player v)?>> then\n    set [exit v] to [win]\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\n\nwhen I receive [open portal v]\nswitch costume to (open v)\n\nwhen flag clicked\nhide\n\nwhen I receive [noc v]\nset [brightness v] effect to (-15)\n\nwhen I receive [dzień v]\nclear graphic effects\n\nwhen flag clicked\ngo to [back v] layer\n\n@Clouds\n\nwhen flag clicked\ngo [forward v] (4) layers\nwait (6.5) seconds\nset [ghost v] effect to (0)\nforever\n    hide\n    create clone of (_myself_ v)\n    wait (pick random (1.5) to (3)) seconds\nend\n\nwhen I start as a clone\nshow\nswitch costume to (pick random (1) to (5))\nif <(pick random (1) to (2)) = [2]> then\n    set [d v] to [-250]\nelse\n    set [d v] to [250]\nend\ngo to x: (d) y: (pick random (-130) to (170))\nset [ghost v] effect to (pick random (40) to (70))\nif <(d) = [250]> then\n    repeat until <(x position) < [-267]>\n        change x by (pick random (-1) to (-3))\n        go to [back v] layer\n        go to [back v] layer\n        go [forward v] (5) layers\n    end\nelse\n    repeat until <(x position) > [267]>\n        change x by (pick random (1) to (3))\n        go to [back v] layer\n        go to [back v] layer\n        go [backward v] (999) layers\n    end\nend\ndelete this clone\n\nwhen I receive [setup v]\ndelete this clone\n\nwhen flag clicked\nhide\n\n@moving platforms\n\nwhen I receive [green flag v]\nhide\nswitch costume to (level 1 3 v)\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <(LEVEL) = [1]> then\n    if <<(x) = (x position)> and <(y) = (y position)>> then\n        hide\n    else\n        hide\n    end\nelse\n    if <(LEVEL) = [2]> then\n        if <<(x) = (x position)> and <(y) = (y position)>> then\n            hide\n        else\n            hide\n        end\n    else\n        if <(LEVEL) = [3]> then\n            if <<(x) = (x position)> and <(y) = (y position)>> then\n                show\n            else\n                hide\n            end\n        else\n            if <(LEVEL) = [4]> then\n                if <<(x) = (x position)> and <(y) = (y position)>> then\n                    hide\n                else\n                    hide\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [tick v]\nposition (((([sin v] of ((timer) * (30)) ) * (300)) + (X)) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [3]> then\n        set [x v] to [750]\n        set [y v] to [-45]\n    end\nend\n\nwhen I receive [noc v]\nset [brightness v] effect to (-30)\n\nwhen I receive [dzień v]\nset [brightness v] effect to (-12)\n\n@trampoline\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 1 1 v)\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 1 2 v)\n            clone at x: [1250] y: [0]\n        else\n            switch costume to (level 1 1 v)\n        end\n    end\nend\n\ndefine position (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]\nposition ((X) - (SCROLL X)) ((y) - (SCROLL Y))\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 I receive [noc v]\nset [brightness v] effect to (-15)\n\nwhen I receive [dzień v]\nset [brightness v] effect to (0)\n\n@Intro\n\nwhen I start as a clone\nif <(Clone) = [Particles]> then\n    switch costume to (pick random (29) to (31))\n    set size to (pick random (50) to (150)) %\n    set [ghost v] effect to (pick random (0.) to (5.))\n    set [brightness v] effect to (pick random (-25.) to (100.))\n    go to x: (0) y: (0)\n    point in direction (pick random (-180) to (180))\n    set [x v] to (pick random (10.) to (12.))\n    set [i v] to (pick random (2.) to (9.))\n    go to [front v] layer\n    show\n    repeat until <touching (_edge_ v)?>\n        move (X) steps\n        change y by (I)\n        change [i v] by (-0.4)\n        set [x v] to ((X) * (0.95))\n    end\n    delete this clone\nend\n\ndefine Particles\nset [clone v] to [Particles]\nrepeat (50)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <(Clone) = [Name]> then\n    switch costume to (name v)\n    set size to (50) %\n    clear graphic effects\n    go to [front v] layer\n    go to x: (0) y: (-100)\n    point in direction (0)\n    show\n    repeat (50)\n        go to [front v] layer\n        change size by (((130) - (size)) / (8))\n        change y by (((0) - (y position)) / (8))\n        turn right (((90) - (direction)) / (8)) degrees\n    end\n    set [i v] to [-1]\n    repeat (10)\n        go to [front v] layer\n        change size by (I)\n        change [i v] by (join [-] (([abs v] of (I) ) / (2)))\n        turn right (I) degrees\n    end\n    switch costume to (logo v)\n    repeat (40)\n        go to [front v] layer\n        change size by (((130) - (size)) / (8))\n        turn right (((90) - (direction)) / (8)) degrees\n    end\n    set [i v] to [-1]\n    repeat (20)\n        go to [front v] layer\n        change size by ((I) / (3))\n        change [i v] by (join [-] (([abs v] of (I) ) / (4)))\n        turn right ((I) / (-3)) degrees\n    end\n    delete this clone\nend\n\nwhen flag clicked\nreset timer\nhide\nclear graphic effects\nset size to (100) %\nstart sound [Dance Snare Beat2 v]\nset volume to (500) %\npoint in direction (90)\ngo to x: (0) y: (0)\nset [clone v] to [Square]\ncreate clone of (_myself_ v)\nwait (1) seconds\nset [clone v] to [Name]\ncreate clone of (_myself_ v)\nwait (0) seconds\nrepeat (2)\n    Spiral spline explosion\n    Particles\n    Rect\n    Spiral spline explosion\nend\nCircle\nrepeat (3)\n    Spiral spline explosion\n    Particles\n    Rect\n    Spiral spline explosion\nend\nCircle\nrepeat (2)\n    Spiral spline explosion\n    Rect\n    Spiral spline explosion\nend\n\nwhen I start as a clone\nif <(Clone) = [Square]> then\n    clear graphic effects\n    show\n    set size to (0) %\n    go to x: (0) y: (300)\n    point in direction (0)\n    switch costume to (square v)\n    repeat (20)\n        change size by (((100) - (size)) / (5))\n        turn right (((90) - (direction)) / (5)) degrees\n        change y by (((0) - (y position)) / (5))\n    end\n    point in direction (90)\n    repeat (12)\n        next costume\n    end\n    repeat (20)\n        switch costume to (blank v)\n        change size by (((2000) - (size)) / (5))\n        switch costume to (square13 v)\n    end\n    wait (3) seconds\n    repeat (20)\n        switch costume to (blank v)\n        change size by (((100) - (size)) / (5))\n        switch costume to (square13 v)\n    end\n    repeat (12)\n        switch costume to ((costume [number v]) - (1))\n        change size by (-5)\n    end\n    set [i v] to [-1]\n    repeat (20)\n        change size by ((I) / (3))\n        change [i v] by (join [-] (([abs v] of (I) ) / (4)))\n        turn right ((I) / (-3)) degrees\n        change y by ((I) / (3))\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone) = [Bursts]> then\n    switch costume to (lineexplosion1 v)\n    clear graphic effects\n    go to [front v] layer\n    go [backward v] (1) layers\n    set [i v] to (pick random (1) to (3))\n    if <(I) = [1]> then\n        set [brightness v] effect to (100)\n    else\n        if <(I) = [2]> then\n            set [brightness v] effect to (25)\n        else\n            set [brightness v] effect to (-25)\n        end\n    end\n    show\n    set [i v] to [20]\n    Animate   x: [0] y: [0] size: [0] rotate: (pick random (-180) to (180)) speed: [1]\n    repeat (2)\n        set [i v] to ((I) * (0.9))\n        move (I) steps\n        Size: [100] speed: [5]\n    end\n    repeat (10)\n        set [i v] to ((I) * (0.9))\n        move (I) steps\n        Size: [100] speed: [5]\n        change [ghost v] effect by (10)\n        next costume\n    end\n    delete this clone\nend\n\ndefine Animate   x: (x) y: (y) size: (s) rotate: (r) speed: (s)\nchange x by (((round (x)) - (round (x position))) / (s))\nchange y by (((round (y)) - (round (y position))) / (s))\nchange size by (((round (s)) - (round (size))) / (s))\nturn right (((round (r)) - (round (direction))) / (s)) degrees\n\ndefine Spiral spline explosion\nset [clone v] to [Bursts]\nrepeat (3)\n    create clone of (_myself_ v)\nend\n\ndefine Size: (s) speed: (spd)\nchange size by (((round (s)) - (round (size))) / (spd))\n\ndefine Rect\nset [clone v] to [Rect]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(Clone) = [Rect]> then\n    clear graphic effects\n    show\n    set size to (0) %\n    go to (random position v)\n    point in direction (90)\n    switch costume to (background rect v)\n    repeat until <(round (size)) = [300]>\n        change size by (((300) - (size)) / (15))\n        change [ghost v] effect by (4)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone) = [Circle]> then\n    clear graphic effects\n    set [brightness v] effect to (100)\n    go to [front v] layer\n    go [backward v] (2) layers\n    show\n    set size to (0) %\n    go to x: (0) y: (0)\n    point in direction (90)\n    switch costume to (circle explosion 1 v)\n    repeat (20)\n        switch costume to (blank v)\n        change size by (((300) - (size)) / (5))\n        switch costume to (circle explosion 1 v)\n    end\n    delete this clone\nend\n\ndefine Circle\nset [clone v] to [Circle]\ncreate clone of (_myself_ v)\nwait (0.1) seconds\nset [clone v] to [Circle 2]\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nif <(Clone) = [Circle 2]> then\n    clear graphic effects\n    set [brightness v] effect to (0)\n    go to [front v] layer\n    go [backward v] (1) layers\n    show\n    set size to (0) %\n    go to x: (0) y: (0)\n    point in direction (90)\n    switch costume to (circle explosion 1 v)\n    repeat (20)\n        switch costume to (blank v)\n        change size by (((300) - (size)) / (5))\n        switch costume to (circle explosion 1 v)\n    end\n    delete this clone\nend\n\n@Duszek1\n\nwhen flag clicked\ngo to x: (-5) y: (30)\nhide\ngo to [back v] layer\nwait (6.5) seconds\nbroadcast (dzień v)\nshow\nforever\n    if <(dzień) = [1]> then\n        clear graphic effects\n        glide (30) secs to x: (325) y: (70)\n        glide (30) secs to x: (651) y: (30)\n        if <(x position) > [649]> then\n            go to x: (-5) y: (30)\n            hide\n            wait (czas) seconds\n            switch backdrop to (dzień2 v)\n            wait (czas) seconds\n            switch backdrop to (dzień3 v)\n            wait (czas) seconds\n            switch backdrop to (dzień4 v)\n            wait (czas) seconds\n            switch backdrop to (dzień5 v)\n            wait (czas) seconds\n            switch backdrop to (dzień6 v)\n            wait (czas) seconds\n            switch backdrop to (dzień7 v)\n            wait (czas) seconds\n            switch backdrop to (dzień8 v)\n            wait (czas) seconds\n            broadcast (noc v)\n            show\n        end\n    else\n        set [ghost v] effect to (3)\n        glide (30) secs to x: (325) y: (70)\n        glide (30) secs to x: (651) y: (30)\n        if <(x position) > [550]> then\n            go to x: (-5) y: (30)\n            hide\n            wait (czas) seconds\n            switch backdrop to (noc2 v)\n            wait (czas) seconds\n            switch backdrop to (noc3 v)\n            wait (czas) seconds\n            switch backdrop to (noc4 v)\n            wait (czas) seconds\n            switch backdrop to (noc5 v)\n            wait (czas) seconds\n            broadcast (dzień v)\n            show\n        end\n    end\nend\n\nwhen flag clicked\nset [dzień v] to [1]\n\nwhen I receive [dzień v]\nset [dzień v] to [1]\n\nwhen I receive [noc v]\nset [dzień v] to [0]\n\nwhen I receive [dzień v]\nswitch costume to (kostium1 v)\n\nwhen I receive [noc v]\nswitch costume to (kostium2 v)\n\nwhen flag clicked\nset [czas v] to [0.03]\n\nwhen I receive [dzień v]\nswitch backdrop to (dzień v)\n\nwhen I receive [noc v]\nswitch backdrop to (noc v)\n\nwhen flag clicked\nhide variable [collected v]\n\n@Duszek2\n\nwhen flag clicked\nhide\nwait (6.5) seconds\ngo to x: (3) y: (200)\nchange y by (20)\nbroadcast (wysuń v)\n\nwhen I receive [wysuń v]\nforever\n    hide\n    wait (50) seconds\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    show\n    glide (0.65) secs to x: (3) y: (165)\n    wait (1) seconds\n    glide (0.65) secs to x: (3) y: (188)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    change y by (20)\nend\n\n