Rat (Platformer)


@Stage\n\nwhen flag clicked\nswitch backdrop to (ozadje1 v)\nset volume to (20) %\nforever\n    play sound [Movie v] until done\nend\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) = [55]> then\n        wait (3) seconds\n        play sound (pick random (2) to (3)) until done\n    end\nend\n\n@rat\n\nwhen flag clicked\ngo to x: (-214) y: (115)\nwait until <([costume # v] of [intro v]) = [6]>\nswitch costume to (preobleka1 v)\nswitch backdrop to (ozadje1 v)\nshow\nhide variable [y v]\nhide variable [x v]\nset [y v] to [0]\nset [x v] to [0]\nforever\n    change [y v] by (-1)\n    if <key (left arrow v) pressed?> then\n        change [x v] by (-1)\n    end\n    if <key (right arrow 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 color (#626262)?> or <<touching color (#b79e60)?> or <touching color (#ccc5b5)?>>> or <touching color (#00ab4a)?>> or <<touching color (#de00ff)?> or <<touching color (#ffd041)?> or <<touching color (#948022)?> or <touching color (#424242)?>>>>> then\n        change y by (4)\n    end\n    if <<<<touching color (#626262)?> or <<touching color (#b79e60)?> or <touching color (#ccc5b5)?>>> or <touching color (#00ab4a)?>> or <<touching color (#de00ff)?> or <<touching color (#ffd041)?> or <<touching color (#948022)?> or <touching color (#424242)?>>>>> then\n        change y by (-4)\n        change x by ((x) * (-1))\n        if <key (up arrow v) pressed?> then\n            set [y v] to [17]\n            if <(x) > [0]> 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 color (#626262)?> or <<touching color (#b79e60)?> or <touching color (#ccc5b5)?>>> or <touching color (#00ab4a)?>> or <<touching color (#de00ff)?> or <<touching color (#ffd041)?> or <<touching color (#948022)?> or <touching color (#424242)?>>>>> 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?> and <<<<touching color (#626262)?> or <<touching color (#b79e60)?> or <touching color (#ccc5b5)?>>> or <touching color (#00ab4a)?>> or <<touching color (#de00ff)?> or <<touching color (#ffd041)?> or <<touching color (#948022)?> or <touching color (#424242)?>>>>>> then\n        set [y v] to [15]\n    end\n    change y by (1)\n    if <<<touching color (#528c85)?> or <touching color (#7c7c7c)?>> or <<touching color (#aa7200)?> or <<touching (poison gas v)?> or <<touching (ball v)?> or <<touching (foot v)?> or <<touching (killer wasp v)?> or <<touching color (#00ffff)?> or >>>>>>> then\n        wait (0.001) seconds\n        start sound [squeak v]\n        go to x: (-217) y: (-20)\n    end\n    if <<<(x position) > [222]> or <touching color (#9e6400)?>> and <not <(backdrop [number v]) = [60]>>> then\n        go to x: (-217) y: (-20)\n        switch backdrop to (next backdrop v)\n    end\n    if <touching color (#ff8b8b)?> then\n        set [y v] to [20]\n    end\nend\n\nwhen [p v] key pressed\ngo to x: (-217) y: (-20)\nif <not <(backdrop [number v]) = [60]>> then\n    next backdrop\nend\n\nwhen flag clicked\nforever\n    if <touching (chef v)?> then\n        switch costume to (preobleka2 v)\n    end\nend\n\n@poison gas\n\nwhen I start as a clone\nset size to (pick random (100) to (140)) %\nshow\nset [ghost v] effect to (100)\npoint in direction (pick random (360) to (0))\nrepeat (10)\n    move (0.3) steps\n    change [ghost v] effect by (-7)\nend\nrepeat (10)\n    move (0.3) steps\nend\nrepeat (10)\n    move (0.3) steps\n    change [ghost v] effect by (7)\nend\nhide\ndelete this clone\n\nwhen flag clicked\nhide\nforever\n    if <<<(backdrop [number v]) = [15]> or <(backdrop [number v]) = [16]>> or <(backdrop [number v]) = [29]>> then\n        go to x: (135) y: (-5)\n        create clone of (_myself_ v)\n        wait (0.2) seconds\n    end\n    if <(backdrop [number v]) = [18]> then\n        go to x: (-60) y: (-40)\n        create clone of (_myself_ v)\n        wait (0.2) seconds\n    end\n    if <(backdrop [number v]) = [19]> then\n        go to x: (30) y: (-40)\n        create clone of (_myself_ v)\n        wait (0.2) seconds\n    end\n    if <(backdrop [number v]) = [27]> then\n        go to x: (100) y: (40)\n        create clone of (_myself_ v)\n        wait (0.2) seconds\n    end\n    if <(backdrop [number v]) = [45]> then\n        go to x: (130) y: (30)\n        create clone of (_myself_ v)\n        wait (0.2) seconds\n    end\n    if <(backdrop [number v]) = [51]> then\n        go to x: (50) y: (100)\n        create clone of (_myself_ v)\n        wait (0.2) seconds\n    end\n    if <(backdrop [number v]) = [58]> then\n        go to x: (230) y: (-60)\n        create clone of (_myself_ v)\n        wait (0.2) seconds\n    end\nend\n\nwhen I start as a clone\nforever\n    if <<<(backdrop [number v]) = [17]> or <(backdrop [number v]) = [20]>> or <<(backdrop [number v]) = [28]> or <<(backdrop [number v]) = [30]> or <<(backdrop [number v]) = [46]> or <<(backdrop [number v]) = [52]> or >>>>> then\n        delete this clone\n    end\nend\n\n@ball\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) = [23]> then\n        show\n        go to x: (190) y: (-50)\n        point in direction (90)\n        forever\n            turn left (5) degrees\n            change x by (-5)\n            if <<touching (_edge_ v)?> or <(backdrop [number v]) = [24]>> then\n                hide\n                stop [this script v]\n            end\n            if <touching (rat v)?> then\n                wait (0.1) seconds\n                go to x: (190) y: (-50)\n                point in direction (90)\n            end\n        end\n    else\n        hide\n    end\nend\n\n@foot\n\nwhen flag clicked\nif <(backdrop [number v]) = [1]> then\n    wait (0.1) seconds\n    hide\nend\nforever\n    if <(backdrop [number v]) = [26]> then\n        switch costume to (preobleka1 v)\n        go to x: (120) y: (285)\n        show\n        forever\n            repeat (30)\n                change y by (5)\n                if <(backdrop [number v]) = [27]> then\n                    hide\n                    stop [this script v]\n                end\n            end\n            repeat (30)\n                change y by (-5)\n                if <(backdrop [number v]) = [27]> then\n                    hide\n                    stop [this script v]\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) = [30]> then\n        show\n        switch costume to (preobleka2 v)\n        go to x: (-60) y: (285)\n        forever\n            repeat (30)\n                change y by (5)\n                if <(backdrop [number v]) = [31]> then\n                    hide\n                    stop [this script v]\n                end\n            end\n            repeat (30)\n                change y by (-5)\n                if <(backdrop [number v]) = [31]> then\n                    hide\n                    stop [this script v]\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) = [54]> then\n        show\n        switch costume to (preobleka3 v)\n        go to x: (-60) y: (285)\n        forever\n            repeat (30)\n                change y by (5)\n                if <(backdrop [number v]) = [55]> then\n                    hide\n                    stop [this script v]\n                end\n            end\n            repeat (30)\n                change y by (-5)\n                if <(backdrop [number v]) = [55]> then\n                    hide\n                    stop [this script v]\n                end\n            end\n        end\n    end\nend\n\n@killer wasp\n\nwhen flag clicked\nhide\nforever\n    if <(backdrop [number v]) = [33]> then\n        create clone of (_myself_ v)\n        wait until <(backdrop [number v]) = [34]>\n    end\n    if <(backdrop [number v]) = [35]> then\n        create clone of (_myself_ v)\n        wait until <(backdrop [number v]) = [36]>\n    end\n    if <(backdrop [number v]) = [38]> then\n        create clone of (_myself_ v)\n        wait until <(backdrop [number v]) = [39]>\n    end\nend\n\nwhen I start as a clone\nchange y by (pick random (-10) to (10))\nshow\nforever\n    point towards (rat v)\n    move (1.6) steps\nend\n\nwhen I start as a clone\nforever\n    if <touching (rat v)?> then\n        wait (0.01) seconds\n        go to x: (196) y: (111)\n    end\n    if <<(backdrop [number v]) = [34]> or <<(backdrop [number v]) = [36]> or >> then\n        delete this clone\n    end\nend\n\n@chef\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) = [60]> then\n        show\n        if <touching (rat v)?> then\n            set [ghost v] effect to (100)\n        end\n    else\n        hide\n    end\nend\n\n@intro\n\nwhen flag clicked\nswitch costume to (preobleka1 v)\ngo to [front v] layer\ngo [backward v] (1) layers\nshow\nrepeat (5)\n    switch backdrop to (ozadje1 v)\n    wait (4) seconds\n    next costume\nend\nwait (4) seconds\nhide\n\nwhen flag clicked\nset language to (en v)::tts\nset voice to (tenor v)::tts\nwait (1) seconds\nspeak [once upon a time]::tts\nwait until <(costume [number v]) = [2]>\nspeak [in the sewers of paris]::tts\nwait until <(costume [number v]) = [3]>\nspeak [there was a rat]::tts\nwait until <(costume [number v]) = [4]>\nspeak [a rat like no other]::tts\nwait until <(costume [number v]) = [5]>\nspeak [a rat that wanted to become]::tts\nwait until <(costume [number v]) = [6]>\nspeak [a chef]::tts\n\nswitch costume to (preobleka6 v)\n\n@thumbnail\n\nwhen flag clicked\nhide\n\nshow\n\n