Evgen Platformer Demo

Instructions: Стрелки

@Stage\n\n@Игрок\n\ndefine Касание земли\nchange [высота v] by (1)\nrepeat until <not <touching (платформы v)?>>\n    if <(Гравитация) = [0]> then\n        if <(Скорость падения) > [0]> then\n            change y by (-1)\n        else\n            change y by (1)\n            set [скорость падения v] to [0]\n        end\n    else\n        if <(Скорость падения) < [0]> then\n            change y by (1)\n        else\n            change y by (-1)\n            set [скорость падения v] to [0]\n        end\n    end\n    set [высота v] to [0]\nend\n\ndefine Управление\nif <key (right arrow v) pressed?> then\n    if <(Гравитация) = [0]> then\n        switch costume to (cube3 v)\n    else\n        switch costume to (cube5 v)\n    end\n    point in direction (90)\n    move (9) steps\n    if <touching (платформы v)?> then\n        change x by (-9)\n    end\nend\nif <key (left arrow v) pressed?> then\n    if <(Гравитация) = [0]> then\n        switch costume to (cube3 v)\n    else\n        switch costume to (cube5 v)\n    end\n    point in direction (-90)\n    move (9) steps\n    if <touching (платформы v)?> then\n        change x by (9)\n    end\nend\nif <not <<key (left arrow v) pressed?> or <key (right arrow v) pressed?>>> then\n    if <(Гравитация) = [0]> then\n        switch costume to (cube v)\n    else\n        switch costume to (cube4 v)\n    end\nend\nif <key (up arrow v) pressed?> then\n    if <(Первый прыжок?) = [0]> then\n        if <(Гравитация) = [0]> then\n            if <(Высота) < [3]> then\n                set [скорость падения v] to [12]\n                set [первый прыжок? v] to [1]\n                broadcast ("прыжок" v)\n            end\n            if <touching (сферы v)?> then\n                set [скорость падения v] to [10]\n                set [первый прыжок? v] to [1]\n                broadcast ("прыжок" v)\n            end\n        else\n            if <(Высота) < [3]> then\n                set [скорость падения v] to [-12]\n                set [первый прыжок? v] to [1]\n                broadcast ("прыжок" v)\n            end\n            if <touching (сферы v)?> then\n                set [скорость падения v] to [-10]\n                set [первый прыжок? v] to [1]\n                broadcast ("прыжок" v)\n            end\n        end\n    end\nelse\n    set [первый прыжок? v] to [0]\nend\n\ndefine Гравитация\nif <(Гравитация) = [0]> then\n    change [скорость падения v] by (-1)\nend\nif <(Гравитация) = [1]> then\n    change [скорость падения v] by (1)\nend\nchange y by (Скорость падения)\n\nwhen flag clicked\ngo to [back v] layer\nbroadcast (Гравитации v)\nbroadcast (Батуты v)\nbroadcast (Шипы v)\nbroadcast (Платформы v)\nbroadcast (Сферы v)\nset [гравитация v] to [0]\nswitch costume to (cube v)\nset size to (80) %\nswitch backdrop to (уровень 1 v)\nset [скорость падения v] to [0]\npoint in direction (90)\ngo to x: (-150) y: (-100)\nset rotation style [left-right v]\nif on edge, bounce\nshow\nforever\n    if <(Пауза) = [0]> then\n        Анимация\n        Гравитация\n        Касание земли\n        Управление\n        Уровень\n        Шипы\n        Порталы гравитации\n        Батуты\n    end\nend\n\ndefine Уровень\nif <(x position) > [240]> then\n    broadcast (след. ур. v)\n    broadcast ("уровень" v)\n    next backdrop\n    set [скорость падения v] to [0]\n    point in direction (90)\n    if <(Гравитация) = [0]> then\n        go to x: (-150) y: (-100)\n    else\n        go to x: (-150) y: (100)\n    end\n    set rotation style [left-right v]\n    if on edge, bounce\nend\n\ndefine Шипы\nif <touching (шипы v)?> then\n    broadcast ("в шипы" v)\n    set [скорость падения v] to [0]\n    point in direction (90)\n    if <(Гравитация) = [0]> then\n        go to x: (-150) y: (-100)\n    else\n        go to x: (-150) y: (100)\n    end\n    set rotation style [left-right v]\n    if on edge, bounce\nend\n\ndefine Батуты\nif <touching (батуты v)?> then\n    if <(Гравитация) = [0]> then\n        set [скорость падения v] to [15]\n    else\n        set [скорость падения v] to [-15]\n    end\n    broadcast ("батут" v)\nend\n\nwhen I start as a clone\nswitch costume to ((costume [number v]) + (4))\nshow\nclear graphic effects\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-5)\nend\ndelete this clone\n\ndefine Анимация\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.1)\nswitch backdrop to (картинка v)\nhide\n\ndefine Порталы гравитации\nif <touching (порталы гравитации вверх v)?> then\n    set [гравитация v] to [1]\n    broadcast ("гравитация вверх" v)\nend\nif <touching (порталы гравитации вниз v)?> then\n    set [гравитация v] to [0]\n    broadcast ("гравитация вниз" v)\nend\n\nwhen I receive [уровень v]\nbroadcast ("пропуск" v)\npoint in direction (90)\nif <(Гравитация) = [0]> then\n    go to x: (-150) y: (-100)\nelse\n    go to x: (-150) y: (100)\nend\nset rotation style [left-right v]\nif on edge, bounce\n\n@Платформы\n\nwhen flag clicked\nswitch costume to (уровень 1 v)\ngo to x: (0) y: (0)\nset size to (100) %\nshow\n\nwhen I receive [след. ур. v]\nnext costume\n\nwhen [timer v] > (0.1)\nhide\n\nwhen I receive [платформы v]\ngo to [back v] layer\n\n@Шипы\n\nwhen flag clicked\nswitch costume to (уровень 1 v)\ngo to x: (0) y: (0)\nset size to (100) %\ngo to [front v] layer\nshow\n\nwhen I receive [след. ур. v]\nnext costume\n\nwhen [timer v] > (0.1)\nhide\n\nwhen I receive [шипы v]\ngo to [back v] layer\n\n@Батуты\n\nwhen flag clicked\nswitch costume to (уровень 1 v)\ngo to x: (0) y: (0)\nset size to (100) %\ngo to [front v] layer\nshow\n\nwhen I receive [след. ур. v]\nnext costume\n\nwhen [timer v] > (0.1)\nhide\n\nwhen I receive [батуты v]\ngo to [back v] layer\n\n@Сферы\n\nwhen flag clicked\nswitch costume to (уровень 1 v)\ngo to x: (0) y: (0)\nset size to (100) %\ngo to [front v] layer\nshow\n\nwhen I receive [след. ур. v]\nnext costume\n\nwhen [timer v] > (0.1)\nhide\n\nwhen I receive [сферы v]\ngo to [back v] layer\n\n@Порталы гравитации вверх\n\nwhen flag clicked\nswitch costume to (уровень 1 v)\ngo to x: (0) y: (0)\nset size to (100) %\ngo to [front v] layer\nshow\n\nwhen I receive [след. ур. v]\nnext costume\n\nwhen [timer v] > (0.1)\nhide\n\nwhen I receive [гравитации v]\ngo to [back v] layer\n\n@Порталы гравитации вниз\n\nwhen flag clicked\nswitch costume to (уровень 1 v)\ngo to x: (0) y: (0)\nset size to (100) %\ngo to [front v] layer\nshow\n\nwhen I receive [след. ур. v]\nnext costume\n\nwhen [timer v] > (0.1)\nhide\n\nwhen I receive [гравитации v]\ngo to [back v] layer\n\n@Пропустить\n\nwhen flag clicked\nswitch backdrop to (уровень 1 v)\nswitch costume to (костюм 1 v)\ngo to x: (-200) y: (140)\nset size to (100) %\ngo to [front v] layer\nshow\nrepeat until <(backdrop [name v]) = [конец]>\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        if <<<(backdrop [number v]) = [16]> or <(backdrop [number v]) = [17]>> or <(backdrop [number v]) = [18]>> then\n            set [гравитация v] to [1]\n        else\n            set [гравитация v] to [0]\n        end\n        broadcast (след. ур. v)\n        next backdrop\n        set [скорость падения v] to [0]\n        broadcast (Уровень v)\n        wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n    end\nend\nhide\n\nwhen [timer v] > (0.1)\nhide\n\n@Пауза\n\nwhen flag clicked\nset [пауза v] to [0]\nswitch backdrop to (уровень 1 v)\nswitch costume to (костюм 1 v)\ngo to x: (100) y: (140)\nset size to (100) %\ngo to [front v] layer\nshow\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        if <(Пауза) = [0]> then\n            set [пауза v] to [1]\n            switch costume to (костюм 2 v)\n        else\n            set [пауза v] to [0]\n            switch costume to (костюм 1 v)\n        end\n        wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n    end\nend\n\nwhen [timer v] > (0.1)\nhide\n\n@Музыка\n\nwhen flag clicked\nset volume to (100) %\nswitch backdrop to (уровень 1 v)\nswitch costume to (костюм 1 v)\ngo to x: (150) y: (140)\nset size to (100) %\ngo to [front v] layer\nshow\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        if <(volume) = [0]> then\n            set volume to (100) %\n            switch costume to (костюм 1 v)\n        else\n            set volume to (0) %\n            switch costume to (костюм 2 v)\n        end\n        wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n    end\nend\n\nwhen [timer v] > (0.1)\nhide\n\nwhen flag clicked\nforever\n    play sound [Музыка Обычный мир v] until done\nend\n\nwhen flag clicked\nwait until <(backdrop [number v]) > [11]>\nstop [other scripts in sprite v]\nstop all sounds\nbroadcast (Ад v)\nforever\n    play sound [Музыка   А Д v] until done\nend\n\nwhen I receive [ад v]\ngo to x: (150) y: (140)\nset size to (100) %\ngo to [front v] layer\nshow\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        if <(volume) = [0]> then\n            set volume to (100) %\n            switch costume to (костюм 1 v)\n        else\n            set volume to (0) %\n            switch costume to (костюм 2 v)\n        end\n        wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n    end\nend\n\n@Звуки\n\nwhen flag clicked\nset volume to (100) %\nswitch backdrop to (уровень 1 v)\nswitch costume to (костюм 1 v)\ngo to x: (200) y: (140)\nset size to (100) %\ngo to [front v] layer\nshow\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        if <(volume) = [0]> then\n            set volume to (100) %\n            switch costume to (костюм 1 v)\n        else\n            set volume to (0) %\n            switch costume to (костюм 2 v)\n        end\n        wait until <not <<touching (mouse-pointer v)?> and <mouse down?>>>\n    end\nend\n\nwhen [timer v] > (0.1)\nhide\n\nwhen I receive ["уровень" v]\nstart sound [уровень v]\n\nwhen I receive ["прыжок" v]\nstart sound [прыжок v]\n\nwhen I receive ["в шипы" v]\nstart sound [в шипы v]\n\nwhen I receive ["пропуск" v]\nstart sound [пропуск v]\n\nwhen I receive ["батут" v]\nstart sound [батут v]\n\nwhen I receive ["гравитация вверх" v]\nstart sound [гравитация вверх v]\n\nwhen I receive ["гравитация вниз" v]\nstart sound [гравитация вниз v]\n\n