platformer
@Stage\n\n@Спрайт 2\n\ndefine старт\nset rotation style [left-right v]\ngo to x: (0) y: (0)\nset [x v] to [0]\nset [y v] to [0]\nset [скорость у v] to [0]\nset [скроллинг х v] to [0]\nset [скроллинг у v] to [0]\nset [скорость х v] to [0]\n\ndefine ху\ngo to x: ((x) - (скроллинг х)) y: ((y) - (скроллинг у))\n\ndefine х (x)\nchange [x v] by (скорость х)\nху\nif <touching (спрайт 1 v)?> then\n    repeat (8)\n        change [y v] by (1)\n        ху\n        if <not <touching (спрайт 1 v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-8)\n    if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<(mouse y) > (y position)> and <mouse down?>>> then\n        if <(x) > [0]> then\n            set [скорость х v] to [-2]\n        else\n            set [скорость х v] to [2]\n        end\n    else\n        set [скорость х v] to [0]\n    end\n    repeat until <not <touching (спрайт 1 v)?>>\n        if <(x) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        ху\n    end\nend\n\ndefine у (y)\nchange [y v] by (скорость у)\nху\nchange [от земли v] by (1)\nrepeat until <not <touching (спрайт 1 v)?>>\n    if <(y) < [0]> then\n        change [y v] by (1)\n        set [от земли v] to [0]\n    else\n        change [y v] by (-1)\n    end\n    ху\n    set [скорость у v] to [0]\nend\n\ndefine управление\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<(mouse x) > (x position)> and <mouse down?>>> then\n    point in direction (90)\n    change [скорость х v] by (2)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<(mouse x) < (x position)> and <mouse down?>>> then\n    point in direction (-90)\n    change [скорость х v] by (-2)\nend\nset [скорость х v] to ((скорость х) * (.8))\nif <([abs v] of (скорость х) ) > [.9]> then\n    х (скорость х)\nend\nchange [скорость у v] by (-1)\nif <(скорость у) < [-24]> then\n    set [скорость у v] to [-24]\nend\nif <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> and <(от земли) < [4]>> then\n    set [скорость у v] to [10]\nend\nу (скорость у)\nif <([abs v] of (скорость х) ) > [3]> then\n    next costume\nend\nif <<(y) < [-200]> or <touching color (#ff0000)?>> then\n    старт\nend\n\nwhen I receive [старт платформер  v]\nshow\ngo to [front v] layer\nстарт\nforever\n    delete all of [положения х v]\n    delete all of [положения у v]\n    repeat until <touching (спрайт 5 v)?>\n        управление\n        change [скроллинг х v] by (round (((x) - (скроллинг х)) / (5)))\n        change [скроллинг у v] by (round (((y) - (скроллинг у)) / (8)))\n        ху\n        broadcast (платформа v)\n        if < ((round ((timer) * (40))) / (2)) contains [.]?> then\n            add (x) to [положения х v]\n            add (y) to [положения у v]\n        end\n    end\n    broadcast (таймер в обратную v)\n    repeat until <(length of [положения х v]) < [1]>\n        set [x v] to (item (length of [положения х v]) of [положения х v])\n        set [y v] to (item (length of [положения у v]) of [положения у v])\n        change [скроллинг х v] by (round (((x) - (скроллинг х)) / (5)))\n        change [скроллинг у v] by (round (((y) - (скроллинг у)) / (8)))\n        ху\n        broadcast (платформа v)\n        delete (length of [положения х v]) of [положения х v]\n        delete (length of [положения у v]) of [положения у v]\n    end\nend\n\n@Спрайт 1\n\nwhen I receive [платформа v]\nswitch costume to (костюм 5 v)\ngo to x: ((смещение х) - (скроллинг х)) y: ((смещение у) - (скроллинг у))\nswitch costume to (костюм)\n\nwhen flag clicked\nset [смещение х v] to [0]\nset [костюм v] to [1]\nset [смещение у v] to [0]\nrepeat (4)\n    create clone of (_myself_ v)\n    change [смещение х v] by (720)\n    change [костюм v] by (1)\nend\ncreate clone of (_myself_ v)\nchange [смещение у v] by (540)\nchange [костюм v] by (1)\ncreate clone of (_myself_ v)\nchange [смещение у v] by (540)\nchange [костюм v] by (1)\ncreate clone of (_myself_ v)\nchange [смещение у v] by (540)\nchange [смещение х v] by (-720)\nchange [костюм v] by (1)\ncreate clone of (_myself_ v)\nchange [смещение х v] by (-720)\nchange [костюм v] by (1)\ncreate clone of (_myself_ v)\nchange [смещение х v] by (-720)\nchange [костюм v] by (1)\ncreate clone of (_myself_ v)\nchange [смещение х v] by (-720)\nchange [костюм v] by (1)\ncreate clone of (_myself_ v)\nchange [смещение х v] by (-760)\nchange [костюм v] by (1)\n\n@Спрайт 3\n\nwhen I receive [платформа v]\nswitch costume to (костюм 5 v)\ngo to x: ((смещение х) - (скроллинг х)) y: ((смещение у) - (скроллинг у))\nswitch costume to (костюм)\n\nwhen flag clicked\nset [смещение х v] to [0]\nset [костюм v] to [1]\nset [смещение у v] to [0]\nrepeat (4)\n    create clone of (_myself_ v)\n    change [смещение х v] by (720)\n    change [костюм v] by (1)\nend\ncreate clone of (_myself_ v)\nchange [смещение у v] by (540)\nchange [костюм v] by (1)\ncreate clone of (_myself_ v)\nchange [смещение у v] by (540)\nchange [костюм v] by (1)\ncreate clone of (_myself_ v)\nchange [смещение у v] by (540)\nchange [смещение х v] by (-720)\nchange [костюм v] by (1)\ncreate clone of (_myself_ v)\nchange [смещение х v] by (-720)\nchange [костюм v] by (1)\ncreate clone of (_myself_ v)\nchange [смещение х v] by (-720)\nchange [костюм v] by (1)\ncreate clone of (_myself_ v)\nchange [смещение х v] by (-720)\nchange [костюм v] by (1)\ncreate clone of (_myself_ v)\nchange [смещение х v] by (-760)\nchange [костюм v] by (1)\n\n@Спрайт 4\n\nwhen flag clicked\nset [таймер есть? v] to [нет]\ngo to [front v] layer\ngo to x: (0) y: (0)\nshow\nswitch costume to (2 v)\ncreate clone of (_myself_ v)\nswitch costume to (3 v)\ncreate clone of (_myself_ v)\nswitch costume to (1 v)\n\nwhen I start as a clone\nif <(costume [number v]) = [2]> then\n    go to [front v] layer\n    go to x: (156) y: (85)\n    repeat until <<mouse down?> and <touching (mouse-pointer v)?>>\n        if <touching (mouse-pointer v)?> then\n            set [brightness v] effect to (10)\n        else\n            set [brightness v] effect to (0)\n        end\n    end\n    broadcast (старт платформер  v)\n    delete this clone\nend\nif <(costume [number v]) = [3]> then\n    go to [front v] layer\n    go to x: (156) y: (0)\n    show\n    forever\n        repeat until <<mouse down?> and <touching (mouse-pointer v)?>>\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (10)\n            else\n                set [brightness v] effect to (0)\n            end\n        end\n        broadcast (спрятать кнопу старт v)\n        switch costume to (4 v)\n        create clone of (_myself_ v)\n        switch costume to (5 v)\n        create clone of (_myself_ v)\n        switch costume to (7 v)\n        create clone of (_myself_ v)\n        switch costume to (3 v)\n        hide\n    end\nend\nif <(costume [number v]) = [4]> then\n    go to [front v] layer\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\nif <(costume [number v]) = [5]> then\n    go to [front v] layer\n    go to x: (-25) y: (145)\n    set [ghost v] effect to (100)\n    set [brightness v] effect to (0)\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    forever\n        if <touching (mouse-pointer v)?> then\n            set [brightness v] effect to (10)\n            if <mouse down?> then\n                if <(costume [number v]) = [5]> then\n                    switch costume to (6 v)\n                    set [таймер есть? v] to [да]\n                else\n                    switch costume to (5 v)\n                    set [таймер есть? v] to [нет]\n                end\n                set [brightness v] effect to (0)\n                wait until <<not <touching (mouse-pointer v)?>> or <not <mouse down?>>>\n            end\n        else\n            set [brightness v] effect to (0)\n        end\n    end\nend\nif <(costume [number v]) = [7]> then\n    go to [front v] layer\n    go to x: (-193) y: (-145)\n    set [ghost v] effect to (100)\n    set [brightness v] effect to (0)\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    repeat until <<mouse down?> and <touching (mouse-pointer v)?>>\n        if <touching (mouse-pointer v)?> then\n            set [brightness v] effect to (10)\n        else\n            set [brightness v] effect to (0)\n        end\n    end\n    broadcast (конец настроек v)\nend\n\nwhen I receive [старт платформер  v]\nhide\n\nwhen I receive [конец настроек v]\nif <<(costume [number v]) = [4]> or <<(costume [number v]) = [5]> or <<(costume [number v]) = [6]> or <(costume [number v]) = [7]>>>> then\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\nif <<(costume [number v]) = [2]> or <(costume [number v]) = [3]>> then\n    show\nend\n\nwhen I receive [спрятать кнопу старт v]\nif <(costume [number v]) = [2]> then\n    hide\nend\n\n@Timer\n\nwhen I receive [старт платформер  v]\nif <(таймер есть?) = [да]> then\n    show\n    set [таймер v] to [0]\n    set [клон таймера v] to [1]\n    create clone of (_myself_ v)\n    set [клон таймера v] to [2]\n    create clone of (_myself_ v)\n    set [клон таймера v] to [3]\n    create clone of (_myself_ v)\n    hide\n    forever\n        change [таймер v] by (1)\n        wait (1) seconds\n    end\nend\n\nwhen I start as a clone\nforever\n    switch costume to (letter (клон таймера) of (таймер))\n    if <<(length of (таймер)) = [1]> and <(клон таймера) = [1]>> then\n        go to x: (218) y: (152)\n    end\n    if <<(length of (таймер)) = [2]> and <(клон таймера) = [1]>> then\n        go to x: (200) y: (152)\n    end\n    if <<(length of (таймер)) = [3]> and <(клон таймера) = [1]>> then\n        go to x: (182) y: (152)\n    end\n    if <<(length of (таймер)) = [3]> and <(клон таймера) = [2]>> then\n        go to x: (200) y: (152)\n    end\nend\n\nwhen I receive [таймер в обратную v]\nhide\n\n@Спрайт 5\n\nwhen I receive [платформа v]\nswitch costume to (костюм 2 v)\ngo to x: ((-1080) - (скроллинг х)) y: ((1860) - (скроллинг у))\nswitch costume to (костюм 1 v)\n\nwhen flag clicked\nhide\n\nwhen I receive [старт платформер  v]\nshow\n\n@Спрайт 6\n\nwhen flag clicked\nhide\n\n
"PLATFORMER"\nCONTROL:\n‖ To play click on the "play" button\n‖ Arrow control\n‖ Don't touch red\n‖ Click on "settings" to customize the game\nPROJECT:\n‖ I did it for 4 days\n‖ 300+ blocks\nplease ❤