Magic platformer

Instructions: In English:\nUse arrow keys \nor use WASD.\nPress space to next level.\nPress what is written in the book to use magic.\n\nPo Polsku:\nRuszasz się strzałkami\nalbo "WASD" (w - w górę, a - w lewo, d - w prawo)\nNaciśnij spację, aby przejść do następnego poziomu.\nNaciśnij to, co pisze w książce, aby użyć magii.

@Stage\n\n@Player\n\nwhen I receive [wiadomośćred v]\nforever\n    if <key (any v) pressed?> then\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            switch costume to (red right v)\n        end\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            switch costume to (red left v)\n        end\n        if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n            switch costume to (red right up v)\n        end\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n            switch costume to (left red up v)\n        end\n    else\n        switch costume to (red normal v)\n    end\nend\n\nwhen I receive [wiadomośćblack v]\nforever\n    if <key (any v) pressed?> then\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            switch costume to (right v)\n        end\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            switch costume to (left v)\n        end\n        if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n            switch costume to (right up v)\n        end\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n            switch costume to (left up v)\n        end\n    else\n        switch costume to (normal v)\n    end\nend\n\nwhen I receive [wiadomośćblue v]\nforever\n    if <key (any v) pressed?> then\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            switch costume to (blue right v)\n        end\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            switch costume to (blue left v)\n        end\n        if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n            switch costume to (blue right up v)\n        end\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n            switch costume to (blue left up v)\n        end\n    else\n        switch costume to (blue normal v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (water v)?> then\n        change [y v] by (1.5)\n        if <<<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> or <key (w v) pressed?>> then\n            change [y v] by (1.5)\n        end\n        if <<<key (down arrow v) pressed?> or <<mouse down?> and <(y position) > (mouse y)>>> or <key (s v) pressed?>> then\n            change [y v] by (-1.5)\n        end\n    end\nend\n\nwhen flag clicked\nset size to (100) %\ngo to x: (-185) y: (-100)\nshow\nset [x v] to [0]\nset [y v] to [0]\nforever\n    point in direction (90)\n    change [y v] by (-1)\n    if <<<key (left arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> or <key (a v) pressed?>> then\n        change [x v] by (-1)\n    end\n    if <<<key (right arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> or <key (d v) pressed?>> then\n        change [x v] by (1)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <<touching (level v)?> or <touching (platform v)?>> then\n        change y by (1)\n    end\n    if <<touching (level v)?> or <touching (platform v)?>> then\n        change y by (1)\n    end\n    if <<touching (level v)?> or <touching (platform v)?>> then\n        change y by (1)\n    end\n    if <<touching (level v)?> or <touching (platform v)?>> then\n        change y by (1)\n    end\n    if <<touching (level v)?> or <touching (platform v)?>> then\n        change y by (-4)\n        change x by ((x) * (-1))\n        if <<<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> or <key (w v) pressed?>> then\n            set [y v] to [15]\n            if <([abs v] of (x) ) = (x)> then\n                set [x v] to [-10]\n            else\n                set [x v] to [10]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (y)\n    if <<touching (level v)?> or <touching (platform v)?>> then\n        change y by ((y) - ((y) * (2)))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<<<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> or <key (w v) pressed?>> and <<touching (level v)?> or <touching (platform v)?>>> then\n        set [y v] to [15]\n    end\n    change y by (1)\nend\n\nwhen I receive [wiadomośćgreen v]\nforever\n    if <key (any v) pressed?> then\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            switch costume to (green right v)\n        end\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            switch costume to (green left v)\n        end\n        if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n            switch costume to (green right up v)\n        end\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n            switch costume to (green left up v)\n        end\n    else\n        switch costume to (green normal v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<<<touching (duszek1 v)?> or <touching (duszek2 v)?>> or <touching (duszek3 v)?>> or <touching (duszek4 v)?>> or <touching (duszek5 v)?>> then\n        go to x: (-185) y: (-100)\n    end\n    if <(y position) < [-150]> then\n        go to x: (-185) y: (-100)\n    end\n    if <(x position) > [210]> then\n        broadcast (wiadomość1 v)\n        go to x: (-185) y: (-100)\n    end\n    if <touching (teleport v)?> then\n        go to (teleport1 v)\n    end\n    if <<<key (m v) pressed?> and <<(level) = [5]> or <(level) = [9]>>> and <touching (księga v)?>> then\n        broadcast (wiadomośćukryj v)\n    end\n    if <<<key (n v) pressed?> and <(level) = [6]>> and <touching (księga v)?>> then\n        broadcast (wiadomośćukryj v)\n    end\n    if <<<key (b v) pressed?> and <(level) = [7]>> and <touching (księga v)?>> then\n        broadcast (wiadomośćpokaż v)\n    end\n    if <<<key (v v) pressed?> and <(level) = [8]>> and <touching (księga v)?>> then\n        broadcast (wiadomośćobróć v)\n    end\n    if <<<key (v v) pressed?> and <(level) = [10]>> and <touching (księga1 v)?>> then\n        broadcast (wiadomośćobróć v)\n    end\n    if <<<key (c v) pressed?> and <(level) = [10]>> and <touching (księga v)?>> then\n        broadcast (wiadomośćzmniejsz v)\n        repeat (4)\n            change size by (-5)\n        end\n    end\nend\n\nwhen [space v] key pressed\nbroadcast (wiadomość1 v)\ngo to x: (-185) y: (-100)\n\nwhen I receive [waidomość6 v]\nask [] and wait\nsay (answer) for (2) seconds\n\nwhen flag clicked\nforever\n    if <key (any v) pressed?> then\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            switch costume to (red right v)\n        end\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            switch costume to (red left v)\n        end\n        if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n            switch costume to (red right up v)\n        end\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n            switch costume to (left red up v)\n        end\n    else\n        switch costume to (red normal v)\n    end\nend\n\n@Trail thingy\n\nwhen flag clicked\nswitch costume to (costume4 v)\nset size to (10) %\nforever\n    go to [back v] layer\n    hide\n    go to (player v)\n    create clone of (_myself_ v)\n    if <(level) = [11]> then\n        forever\n            hide\n        end\n    end\nend\n\nwhen I start as a clone\nshow\nclear graphic effects\nset [ghost v] effect to (50)\ngo [forward v] (1) layers\ngo to [back v] layer\ngo to [back v] layer\nrepeat (10)\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\nwhen I receive [wiadomośćgreen v]\nswitch costume to (costume2 v)\n\nwhen I receive [wiadomośćblue v]\nswitch costume to (costume3 v)\n\nwhen I receive [wiadomośćred v]\nswitch costume to (costume4 v)\n\nwhen I receive [wiadomośćblack v]\nswitch costume to (costume1 v)\n\nwhen I receive [wiadomośćzmniejsz v]\nrepeat (2)\n    change size by (-1)\n    wait (0.2) seconds\nend\n\n@Level\n\nwhen flag clicked\nshow\nswitch costume to (kostium1 v)\nset [level v] to [1]\nforever\n    go to x: (0) y: (0)\nend\n\nwhen I receive [wiadomość1 v]\nnext costume\nchange [level v] by (1)\n\n@Platform\n\nwhen I receive [wiadomośćpokaż v]\nchange [ghost v] effect by (100)\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\n\nwhen flag clicked\npoint in direction (90)\nhide\n\nwhen I receive [wiadomość1 v]\nwait (0.0000000001) seconds\nif <<<(level) = [5]> or <(level) = [7]>> or <<<(level) = [8]> or <(level) = [9]>> or <(level) = [10]>>> then\n    if <(level) = [5]> then\n        go to x: (2) y: (-64)\n        switch costume to (kostium2 v)\n        show\n    end\n    if <(level) = [7]> then\n        go to x: (20) y: (-150)\n        switch costume to (kostium1 v)\n        set [ghost v] effect to (100)\n    end\n    if <(level) = [8]> then\n        go to x: (100) y: (0)\n        switch costume to (kostium3 v)\n        set [ghost v] effect to (0)\n        show\n    end\n    if <(level) = [9]> then\n        go to x: (150) y: (118)\n        point in direction (90)\n        switch costume to (kostium4 v)\n        set [ghost v] effect to (0)\n        show\n    end\n    if <(level) = [10]> then\n        go to x: (0) y: (110)\n        point in direction (90)\n        switch costume to (kostium5 v)\n        set [ghost v] effect to (0)\n        show\n    end\nelse\n    hide\nend\n\nwhen I receive [wiadomośćukryj v]\nif <<(level) = [5]> or <(level) = [9]>> then\n    repeat (18)\n        change [ghost v] effect by (5)\n    end\n    hide\n    set [ghost v] effect to (100)\nend\n\nwhen I receive [wiadomośćobróć v]\npoint in direction (90)\nrepeat (45)\n    turn left (2) degrees\nend\n\n@księga\n\nwhen flag clicked\nswitch costume to (kostium1 v)\nhide\nset [magia v] to [Press M]\ngo to [back v] layer\nforever\n    if <touching (player v)?> then\n        if <(level) = [5]> then\n            repeat until <not <(level) = [5]>>\n                go to (player v)\n                say (magia)\n            end\n        end\n        if <(level) = [6]> then\n            set [magia v] to [Press N]\n            repeat until <not <(level) = [6]>>\n                go to (player v)\n                say (magia)\n            end\n        end\n        if <(level) = [7]> then\n            set [magia v] to [Press B]\n            repeat until <not <(level) = [7]>>\n                go to (player v)\n                say (magia)\n            end\n        end\n        if <(level) = [8]> then\n            set [magia v] to [Press V]\n            repeat until <not <(level) = [8]>>\n                go to (player v)\n                say (magia)\n            end\n        end\n    end\nend\n\nwhen I receive [wiadomość1 v]\nwait (0.0000000001) seconds\nif <<<<(level) = [5]> or <(level) = [6]>> or <<(level) = [7]> or <(level) = [8]>>> or <<(level) = [9]> or <(level) = [10]>>> then\n    show\n    switch costume to (kostium1 v)\n    if <(level) = [5]> then\n        go to x: (-119) y: (-97)\n    end\n    if <(level) = [6]> then\n        go to x: (-160) y: (-97)\n    end\n    if <(level) = [7]> then\n        go to x: (-170) y: (-97)\n    end\n    if <(level) = [8]> then\n        go to x: (-160) y: (-97)\n    end\n    if <(level) = [9]> then\n        go to x: (-125) y: (95)\n        say []\n    end\n    if <(level) = [10]> then\n        go to x: (-150) y: (-97)\n        say []\n    end\nelse\n    hide\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        if <key (right arrow v) pressed?> then\n            switch costume to (kostium1 v)\n        end\n        if <key (left arrow v) pressed?> then\n            switch costume to (kostium2 v)\n        end\n    end\nend\n\nwhen I receive [wiadomośćukryj v]\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nset [ghost v] effect to (0)\ngo to x: (0) y: (0)\n\nwhen I receive [wiadomośćpokaż v]\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nset [ghost v] effect to (0)\n\nwhen I receive [wiadomośćobróć v]\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nset [ghost v] effect to (0)\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        if <(level) = [9]> then\n            set [magia v] to [Press M]\n            repeat until <not <(level) = [9]>>\n                go to (player v)\n                say (magia)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        if <(level) = [10]> then\n            set [magia v] to [Press C]\n            repeat until <not <(level) = [10]>>\n                go to (player v)\n                say (magia)\n            end\n        end\n    end\nend\n\nwhen I receive [wiadomośćzmniejsz v]\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nset [ghost v] effect to (0)\n\n@księga1\n\nwhen I receive [wiadomość1 v]\nwait (0.0000000001) seconds\nif <(level) = [10]> then\n    show\n    switch costume to (kostium1 v)\nelse\n    hide\nend\n\nwhen flag clicked\nhide\nforever\n    if <touching (player v)?> then\n        if <key (right arrow v) pressed?> then\n            switch costume to (kostium1 v)\n        end\n        if <key (left arrow v) pressed?> then\n            switch costume to (kostium2 v)\n        end\n    end\nend\n\nwhen I receive [wiadomośćobróć v]\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nset [ghost v] effect to (0)\n\nwhen flag clicked\ngo to x: (-150) y: (65)\nforever\n    if <touching (player v)?> then\n        if <key (right arrow v) pressed?> then\n            switch costume to (kostium1 v)\n        end\n        if <key (left arrow v) pressed?> then\n            switch costume to (kostium2 v)\n        end\n        if <(level) = [10]> then\n            set [magia1 v] to [Press V]\n            repeat until <not <(level) = [10]>>\n                go to (player v)\n                say (magia1)\n            end\n        end\n    end\nend\n\n@Chat\n\nwhen flag clicked\ngo to x: (-120) y: (-153)\nshow\n\nwhen this sprite clicked\nbroadcast (waidomość6 v)\n\n@Shop \n\nwhen flag clicked\nset [zmienna1 v] to [2]\nshow\ngo to x: (-190) y: (-153)\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        if <(zmienna1) = [2]> then\n            broadcast (wiadomość3 v)\n            wait (0.1) seconds\n            set [zmienna1 v] to [1]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<touching (mouse-pointer v)?> or <not <touching (mouse-pointer v)?>>> and <mouse down?>> then\n        if <(zmienna1) = [1]> then\n            broadcast (wiadomość4 v)\n            wait (0.1) seconds\n            set [zmienna1 v] to [2]\n        end\n    end\nend\n\n@Shop\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [wiadomość3 v]\nshow\n\nwhen I receive [wiadomość4 v]\nhide\n\n@Black Outfit\n\nwhen flag clicked\nhide\ngo to x: (0) y: (-110)\n\nwhen I receive [wiadomość4 v]\nhide\n\nwhen I receive [wiadomość3 v]\nshow\n\nwhen flag clicked\nhide\ngo to x: (0) y: (-110)\n\nwhen this sprite clicked\nbroadcast (wiadomośćblack v)\n\n@Red Outfit\n\nwhen flag clicked\nhide\ngo to x: (0) y: (-40)\n\nwhen I receive [wiadomość3 v]\nshow\n\nwhen this sprite clicked\nbroadcast (wiadomośćred v)\n\nwhen I receive [wiadomość4 v]\nhide\n\n@Blue Outfit\n\nwhen flag clicked\nhide\ngo to x: (0) y: (30)\n\nwhen I receive [wiadomość3 v]\nshow\n\nwhen this sprite clicked\nbroadcast (wiadomośćblue v)\n\nwhen I receive [wiadomość4 v]\nhide\n\n@Green Outfit\n\nwhen flag clicked\nhide\ngo to x: (0) y: (100)\n\nwhen I receive [wiadomość3 v]\nshow\n\nwhen this sprite clicked\nbroadcast (wiadomośćgreen v)\n\nwhen I receive [wiadomość4 v]\nhide\n\n@Duszek1\n\nwhen I receive [wiadomośćukryj v]\nif <(level) = [6]> then\n    repeat (18)\n        change [ghost v] effect by (5)\n    end\n    hide\n    set [ghost v] effect to (100)\nend\n\nwhen I receive [wiadomość1 v]\nwait (0.0000000001) seconds\nif <(level) = [6]> then\n    go to x: (-70) y: (-105)\n    show\nend\n\nwhen flag clicked\nhide\npoint in direction (90)\nforever\n    if <(level) = [4]> then\n        go to x: (-115) y: (-105)\n        set size to (115) %\n        show\n    end\n    if <(level) = [9]> then\n        go to x: (-90) y: (-115)\n        set size to (70) %\n        set [ghost v] effect to (0)\n        show\n    end\n    if <(level) = [10]> then\n        go to x: (65) y: (-55)\n        point in direction (-90)\n        set size to (100) %\n        set [ghost v] effect to (0)\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <<<(level) = [4]> or <(level) = [6]>> or <<(level) = [9]> or <(level) = [10]>>>> then\n        hide\n    end\nend\n\n@Duszek2\n\nwhen flag clicked\nhide\nforever\n    go to [back v] layer\n    if <(level) = [4]> then\n        go to x: (5) y: (-55)\n        point in direction (90)\n        set size to (115) %\n        show\n    end\n    if <(level) = [9]> then\n        go to x: (-30) y: (-25)\n        point in direction (-90)\n        set size to (70) %\n        set [ghost v] effect to (0)\n        show\n    end\n    if <(level) = [10]> then\n        go to x: (-28) y: (-55)\n        set size to (100) %\n        set [ghost v] effect to (0)\n        show\n    end\nend\n\nwhen I receive [wiadomośćukryj v]\nif <(level) = [6]> then\n    repeat (18)\n        change [ghost v] effect by (5)\n    end\n    hide\n    set [ghost v] effect to (100)\nend\n\nwhen I receive [wiadomość1 v]\nwait (0.0000000001) seconds\nif <(level) = [6]> then\n    go to x: (-30) y: (-105)\n    show\nend\n\nwhen flag clicked\nforever\n    if <not <<<(level) = [4]> or <(level) = [6]>> or <<(level) = [9]> or <(level) = [10]>>>> then\n        hide\n    end\nend\n\n@Duszek3\n\nwhen flag clicked\nhide\nforever\n    go to [back v] layer\n    if <(level) = [4]> then\n        point in direction (90)\n        go to x: (120) y: (0)\n        set size to (115) %\n        show\n    end\n    if <(level) = [9]> then\n        go to x: (25) y: (-115)\n        set size to (70) %\n        set [ghost v] effect to (0)\n        show\n    end\n    if <(level) = [10]> then\n        go to x: (20) y: (-55)\n        point in direction (-90)\n        set size to (100) %\n        set [ghost v] effect to (0)\n        show\n    end\nend\n\nwhen I receive [wiadomośćukryj v]\nif <(level) = [6]> then\n    repeat (18)\n        change [ghost v] effect by (5)\n    end\n    hide\n    set [ghost v] effect to (100)\nend\n\nwhen I receive [wiadomość1 v]\nwait (0.0000000001) seconds\nif <(level) = [6]> then\n    go to x: (10) y: (-105)\n    show\nend\n\nwhen flag clicked\nforever\n    if <not <<<(level) = [4]> or <(level) = [6]>> or <<(level) = [9]> or <(level) = [10]>>>> then\n        hide\n    end\nend\n\n@Duszek4\n\nwhen I receive [wiadomośćukryj v]\nif <(level) = [6]> then\n    repeat (18)\n        change [ghost v] effect by (5)\n    end\n    hide\n    set [ghost v] effect to (100)\nend\n\nwhen I receive [wiadomość1 v]\nwait (0.0000000001) seconds\nif <(level) = [6]> then\n    go to x: (50) y: (-105)\n    point in direction (90)\n    set size to (115) %\n    show\nend\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    if <not <<(level) = [6]> or <(level) = [9]>>> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [9]> then\n        go to x: (95) y: (-25)\n        point in direction (-90)\n        set size to (70) %\n        set [ghost v] effect to (0)\n        show\n    end\n    if <(level) = [10]> then\n        go to x: (170) y: (70)\n        point in direction (90)\n        set size to (90) %\n        set [ghost v] effect to (0)\n        show\n    end\nend\n\n@Duszek5\n\nwhen I receive [wiadomośćukryj v]\nif <(level) = [6]> then\n    repeat (18)\n        change [ghost v] effect by (5)\n    end\n    hide\n    set [ghost v] effect to (100)\nend\n\nwhen I receive [wiadomość1 v]\nwait (0.0000000001) seconds\nif <(level) = [6]> then\n    go to x: (90) y: (-105)\n    point in direction (90)\n    set size to (115) %\n    show\nend\nif <(level) = [9]> then\n    go to x: (145) y: (-115)\n    set size to (70) %\n    set [ghost v] effect to (0)\n    show\nend\n\nwhen flag clicked\nforever\n    if <not <<(level) = [6]> or <(level) = [9]>>> then\n        hide\n    end\nend\n\n@Teleport\n\nwhen flag clicked\nhide\nforever\n    go to [back v] layer\n    if <(level) = [9]> then\n        go to x: (205) y: (-70)\n        show\n    end\n    if <(level) = [10]> then\n        go to x: (204) y: (-73)\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(level) = [9]> or <(level) = [10]>> then\n        show\n    else\n        hide\n    end\nend\n\n@Teleport1\n\nwhen flag clicked\nhide\nforever\n    go to [back v] layer\n    if <(level) = [9]> then\n        go to x: (-190) y: (115)\n        show\n    end\n    if <(level) = [10]> then\n        go to x: (-190) y: (90)\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(level) = [9]> or <(level) = [10]>> then\n        show\n    else\n        hide\n    end\nend\n\n@Duszek6\n\nwhen flag clicked\nswitch costume to (kostium1 v)\ngo to x: (0) y: (0)\nshow\nwait (0.7) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nforever\n    go to [front v] layer\n    if <(level) = [11]> then\n        broadcast (wiadomosć5 v)\n        switch costume to (kostium2 v)\n        show\n        repeat (20)\n            change [ghost v] effect by (-5)\n        end\n        wait (3) seconds\n        switch costume to (kostium1 v)\n        stop [all v]\n    end\nend\n\n