Penguin Platformer

Instructions: Arrow keys or WASD to move.\nAvoid spikes, acid, enemies.\nCollect coins and get to the green portal.\n[N] - Skip level.\n[R] - Respawn.\nHow to create an object:\n[1],[2],[3] - Object select.\n[4] - Object destroyer.\n[Z]/[X] - Rotate object.\n[C] - Cancel.

@Stage\n\nwhen flag clicked\nswitch backdrop to (1-1 v)\nset [värld v] to [1]\nset [boss v] to [1]\n\nwhen I receive [nästa bana v]\nswitch backdrop to (join (Värld) (join [-] (Bana)))\n\n@Thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\nshow\n\n@Title Screen\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (vanlig v)\nshow\nset volume to (100) %\nstart sound [Rachmaninoff plays Prelude in G Minor Op v]\nbroadcast (Allt blir klickbart v)\n\nwhen I receive [intro-story v]\nhide\n\nwhen I receive [starta spelet v]\nrepeat (50)\n    change volume by (-2)\nend\nstop all sounds\n\nwhen I receive [tillbaka till start v]\nbroadcast (Allt blir klickbart v)\n\n@Title\n\nwhen flag clicked\ngo to x: (0) y: (58)\npoint in direction (90)\nswitch costume to (klädsel4 v)\nshow\nforever\n    next costume\nend\n\nwhen I receive [intro-story v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [instruktioner v]\nTillfälligt bort\n\ndefine Tillfälligt bort\n\nwhen I receive [inställningar v]\nTillfälligt bort\n\nwhen flag clicked\nforever\n    set [rotera v] to [0]\n    repeat until <(Rotera) > [10000]>\n        change [rotera v] by (5)\n        point in direction ((([sin v] of (Rotera) ) * (2)) + (90))\n    end\nend\n\n@Instructions-button\n\nwhen flag clicked\ngo to x: (-65) y: (-65)\nswitch costume to (klädsel1 v)\nshow\n\nwhen I receive [allt blir klickbart v]\ngo to x: (-65) y: (-65)\nset [höjd v] to [0]\nset [kan klicka? v] to [1]\nforever\n    if <touching (mouse-pointer v)?> then\n        set [rör vid mus v] to [1]\n        repeat until <(Höjd) = [2]>\n            change [höjd v] by (1)\n            change y by (2)\n        end\n    else\n        set [rör vid mus v] to [0]\n        repeat until <(Höjd) = [0]>\n            change [höjd v] by (-1)\n            change y by (-2)\n        end\n    end\nend\n\nwhen I receive [instruktioner v]\nset [kan klicka? v] to [0]\n\nwhen I receive [inställningar v]\nset [kan klicka? v] to [0]\n\nwhen I receive [starta spelet v]\nrepeat (3)\n    next costume\nend\nhide\n\nwhen I receive [allt blir klickbart v]\nforever\n    if <<<touching (mouse-pointer v)?> and <mouse down?>> and <<(Kan klicka?) = [1]> and <(Rör vid mus) = [1]>>> then\n        set [kan klicka? v] to [0]\n        start sound [Tryck v]\n        stop [other scripts in sprite v]\n        broadcast (Instruktioner v)\n        repeat (8)\n            change y by (-0.5)\n        end\n    end\nend\n\n@Play-button\n\nwhen flag clicked\ngo to x: (0) y: (-60)\nswitch costume to (klädsel2 v)\nshow\n\nwhen I receive [inställningar v]\nset [kan klicka? v] to [0]\n\nwhen I receive [allt blir klickbart v]\nset [höjd v] to [0]\nset [kan klicka? v] to [1]\nforever\n    if <touching (mouse-pointer v)?> then\n        set [rör vid mus v] to [1]\n        repeat until <(Höjd) = [2]>\n            change [höjd v] by (1)\n            change y by (2)\n        end\n    else\n        set [rör vid mus v] to [0]\n        repeat until <(Höjd) = [0]>\n            change [höjd v] by (-1)\n            change y by (-2)\n        end\n    end\nend\n\nwhen I receive [instruktioner v]\nset [kan klicka? v] to [0]\n\nwhen I receive [starta spelet v]\nrepeat (3)\n    next costume\nend\nhide\n\nwhen I receive [allt blir klickbart v]\nforever\n    if <<<touching (mouse-pointer v)?> and <mouse down?>> and <<(Rör vid mus) = [1]> and <(Kan klicka?) = [1]>>> then\n        set [kan klicka? v] to [0]\n        start sound [Tryck v]\n        stop [other scripts in sprite v]\n        broadcast (Starta spelet v)\n        repeat (8)\n            change y by (-0.5)\n        end\n    end\nend\n\n@Highscore-button\n\nwhen flag clicked\ngo to x: (65) y: (-65)\nswitch costume to (highscore v)\nshow\n\nwhen I receive [allt blir klickbart v]\ngo to x: (65) y: (-65)\nset [höjd v] to [0]\nset [kan klicka? v] to [1]\nforever\n    if <touching (mouse-pointer v)?> then\n        set [rör vid mus v] to [1]\n        repeat until <(Höjd) = [2]>\n            change [höjd v] by (1)\n            change y by (2)\n        end\n    else\n        set [rör vid mus v] to [0]\n        repeat until <(Höjd) = [0]>\n            change [höjd v] by (-1)\n            change y by (-2)\n        end\n    end\nend\n\nwhen I receive [inställningar v]\nset [kan klicka? v] to [0]\nshow variable [☁ highest score v]\n\nshow variable [☁ fastest time v]\nshow variable [☁ wins v]\nshow variable [☁ deaths v]\n\nwhen flag clicked\nhide variable [☁ highest score v]\n\nhide variable [☁ fastest time v]\nhide variable [☁ wins v]\nhide variable [☁ deaths v]\n\nwhen I receive [allt blir klickbart v]\nhide variable [☁ highest score v]\n\nhide variable [☁ fastest time v]\nhide variable [☁ wins v]\nhide variable [☁ deaths v]\n\nwhen I receive [spelet avklarat v]\nstop [other scripts in sprite v]\nset [#time v] to (Tid)\nif <(#time) > [2400]> then\n    set [#time v] to [2400]\nend\nset [#score v] to ((((2400) - (#time)) + ((Ringar #?) * (200))) + ((Liv) * (50)))\nset [#score 2 v] to (#score)\nwait (0.1) seconds\nif <(#score) > (☁ Highest score)> then\n    set [☁ highest score v] to (#score)\nend\nwait (0.1) seconds\nif <(#time) < (☁ Fastest time)> then\n    set [☁ fastest time v] to (join (#time) [s])\nend\n\nwhen flag clicked\nset [#score v] to [0]\nset [#score 2 v] to [0]\nset [#time v] to [0]\n\nwhen I receive [nu börjar allt v]\nset [tid v] to [0]\nforever\n    wait (1) seconds\n    change [tid v] by (1)\nend\n\nwhen I receive [börja om på nytt v]\nset [#score v] to [0]\nset [#time v] to [0]\nset [tid v] to [0]\nforever\n    wait (1) seconds\n    change [tid v] by (1)\nend\n\nwhen I receive [instruktioner v]\nset [kan klicka? v] to [0]\n\nwhen I receive [starta spelet v]\nrepeat (3)\n    next costume\nend\nhide\n\nwhen I receive [allt blir klickbart v]\nforever\n    if <<<touching (mouse-pointer v)?> and <mouse down?>> and <<(Kan klicka?) = [1]> and <(Rör vid mus) = [1]>>> then\n        set [kan klicka? v] to [0]\n        start sound [Tryck v]\n        stop [other scripts in sprite v]\n        broadcast (Inställningar v)\n        repeat (8)\n            change y by (-0.5)\n        end\n    end\nend\n\n@Info-sida\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [instruktioner v]\nswitch costume to (instruktioner v)\nFram\n\nwhen I receive [tillbaka till start v]\nhide\n\ndefine Fram\ngo to x: (0) y: (-18)\nshow\nset [fart v] to [4]\nrepeat (8)\n    change y by (Fart)\n    change [fart v] by (-0.5)\nend\n\nwhen I receive [inställningar v]\nswitch costume to (leaderboard3 v)\nFram\n\n@Tillbakaknapp\n\nwhen flag clicked\nhide\n\nwhen I receive [instruktioner v]\nFram\n\ndefine Fram\ngo to x: (196) y: (120)\nshow\nset [fart v] to [4]\nrepeat (8)\n    change y by (Fart)\n    change [fart v] by (-0.5)\nend\nset [höjd v] to [0]\nset [kan klicka? v] to [1]\nforever\n    if <touching (mouse-pointer v)?> then\n        set [rör vid mus v] to [1]\n        set [kan klicka? v] to [1]\n        repeat until <(Höjd) = [2]>\n            change [höjd v] by (1)\n            change y by (2)\n        end\n    else\n        set [rör vid mus v] to [0]\n        set [kan klicka? v] to [0]\n        repeat until <(Höjd) = [0]>\n            change [höjd v] by (-1)\n            change y by (-2)\n        end\n    end\nend\n\nwhen I receive [inställningar v]\nFram\n\ndefine Tryckbar\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        if <(Kan klicka?) = [1]> then\n            set [kan klicka? v] to [0]\n            start sound [Tryck2 v]\n            stop [other scripts in sprite v]\n            broadcast (Tillbaka till start v)\n            hide\n        end\n    end\nend\n\nwhen I receive [inställningar v]\nTryckbar\n\nwhen I receive [instruktioner v]\nTryckbar\n\n@Vit skärm\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [nivå avklarad v]\nshow\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nset [ghost v] effect to (0)\nwait (1) seconds\nbroadcast (Nästa värld v)\nwait (1) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\n\nwhen I receive [spelet avklarat v]\nset [ghost v] effect to (100)\nshow\nrepeat (200)\n    change [ghost v] effect by (-0.5)\nend\nset [ghost v] effect to (0)\n\nwhen I receive [starta spelet v]\nshow\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nset [ghost v] effect to (0)\nwait (1) seconds\nbroadcast (Story-läge v)\nbroadcast (Intro-story v)\nwait (1) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\n\nwhen I receive [game over! v]\nwait (1) seconds\nset [ghost v] effect to (100)\nshow\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nset [ghost v] effect to (0)\n\nwhen I receive [börja om på nytt v]\nrepeat (4)\n    change [ghost v] effect by (25)\nend\nhide\n\n@Story-sekvens\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nset [ghost v] effect to (100)\n\ndefine Fram\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\ndefine Bort\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [story-läge v]\nFram\n\nwhen I receive [stoy-läge avslutat v]\nBort\n\nwhen I receive [börja om på nytt v]\ngo to x: (0) y: (0)\nhide\nset [ghost v] effect to (100)\n\nwhen I receive [börja om på nytt v]\nBort\n\n@Infopanel\n\nwhen flag clicked\ngo to x: (141) y: (156)\nshow\n\ndefine Fram\ngo to x: (141) y: (180)\nshow\nrepeat (8)\n    change y by (-3)\nend\ngo to x: (141) y: (156)\n\ndefine Bort\ngo to x: (141) y: (156)\nshow\nrepeat (8)\n    change y by (3)\nend\nhide\n\nwhen I receive [story-läge v]\nBort\n\nwhen I receive [stoy-läge avslutat v]\nFram\n\nwhen I receive [continue-button v]\nFram\n\n@Livräkning\n\nwhen I receive [visa hjärtan v]\nswitch costume to (join (Liv) [])\n\nwhen I receive [ändra statistik- hjärtan' v]\nswitch costume to (join (Liv) [])\n\nwhen I receive [börja om på nytt v]\nswitch costume to (5 v)\nshow\n\ndefine Fram\nshow\nrepeat (8)\n    change y by (-3)\nend\ngo to x: (164) y: (155)\n\nwhen flag clicked\nset y to (([y position v] of [infopanel v]) - (1))\nset x to (([x position v] of [infopanel v]) + (23))\ngo to x: (164) y: (155)\nswitch costume to (5 v)\nshow\n\ndefine Bort\nshow\nrepeat (8)\n    change y by (3)\nend\nhide\n\nwhen I receive [continue-button v]\nFram\n\nwhen I receive [stoy-läge avslutat v]\nFram\n\nwhen I receive [story-läge v]\nBort\n\n@Värld\n\nwhen I receive [nästa bana v]\nswitch costume to (join (Värld) (join [-] (Bana)))\n\nwhen I receive [nästa värld v]\nswitch costume to (join (Värld) (join [-] (Bana)))\n\ndefine Fram\nshow\nrepeat (8)\n    change y by (-3)\nend\ngo to x: (94) y: (155)\n\ndefine Bort\nshow\nrepeat (8)\n    change y by (3)\nend\nhide\n\nwhen flag clicked\nset y to (([y position v] of [infopanel v]) - (1))\nset x to (([x position v] of [infopanel v]) - (47))\ngo to x: (94) y: (155)\nswitch costume to (1-1 v)\nshow\n\nwhen I receive [stoy-läge avslutat v]\nFram\n\nwhen I receive [story-läge v]\nBort\n\nwhen I receive [continue-button v]\nFram\n\n@Ringräkning\n\nwhen I receive [ringstatistik v]\nswitch costume to (join (Ringar #?) [])\n\nwhen I receive [börja om på nytt v]\nswitch costume to (0 v)\n\nwhen flag clicked\nset y to (([y position v] of [infopanel v]) - (1))\nset x to (([x position v] of [infopanel v]) + (75))\ngo to x: (216) y: (155)\nswitch costume to (0 v)\nshow\n\ndefine Bort\nshow\nrepeat (8)\n    change y by (3)\nend\nhide\n\ndefine Fram\nshow\nrepeat (8)\n    change y by (-3)\nend\ngo to x: (216) y: (155)\n\nwhen I receive [continue-button v]\nFram\n\nwhen I receive [stoy-läge avslutat v]\nFram\n\nwhen I receive [story-läge v]\nBort\n\n@Infobubbla\n\nwhen I receive [nästa bana v]\nset [specialbana v] to [0]\nhide\nif <(Värld) = [1]> then\n    if <<<(Bana) = [2]> or <(Bana) = [3]>> or <<(Bana) = [4]> or <(Bana) = [6]>>> then\n        Meddelande\n    end\nend\nif <(Värld) = [2]> then\n    if <<<(Bana) = [2]> or <(Bana) = [3]>> or <<(Bana) = [4]> or <(Bana) = [6]>>> then\n        Meddelande\n    end\nend\nif <(Värld) = [3]> then\n    if <(Bana) = [2]> then\n        Meddelande\n    end\n    if <(Bana) = [3]> then\n        set [specialbana v] to [1]\n        wait (2) seconds\n        Meddelande\n    end\n    if <(Bana) = [4]> then\n        set [specialbana v] to [1]\n        wait (1) seconds\n        Meddelande\n    end\n    if <(Bana) = [6]> then\n        set [specialbana v] to [1]\n        wait (1) seconds\n        Meddelande\n    end\nend\nif <(Värld) = [4]> then\n    if <<<(Bana) = [2]> or <(Bana) = []>> or <<(Bana) = [6]> or <(Bana) = []>>> then\n        Meddelande\n    end\n    if <(Bana) = [3]> then\n        wait (5) seconds\n        Meddelande\n    end\n    if <(Bana) = [4]> then\n        set [specialbana v] to [1]\n        wait (1) seconds\n        Meddelande\n    end\nend\n\nwhen I receive [nästa bana v]\nif <(Värld) = [1]> then\n    if <(Bana) = [2]> then\n        set [koordinat v] to [-85]\n    end\n    if <(Bana) = [3]> then\n        set [koordinat v] to [-120]\n    end\n    if <(Bana) = [4]> then\n        set [koordinat v] to [-90]\n    end\n    if <(Bana) = [6]> then\n        set [koordinat v] to [-180]\n    end\n    if <(Bana) = [8]> then\n        set [koordinat v] to [-160]\n    end\nend\nif <(Värld) = [2]> then\n    if <(Bana) = [2]> then\n        set [koordinat v] to [-85]\n    end\n    if <(Bana) = [3]> then\n        set [koordinat v] to [-140]\n    end\n    if <(Bana) = [4]> then\n        set [koordinat v] to [-130]\n    end\n    if <(Bana) = [6]> then\n        set [koordinat v] to [-190]\n    end\nend\nif <(Värld) = [3]> then\n    if <(Bana) = [2]> then\n        set [koordinat v] to [-100]\n    end\n    if <(Bana) = [3]> then\n        set [koordinat v] to [-50]\n    end\n    if <(Bana) = [4]> then\n        set [koordinat v] to [-180]\n    end\n    if <(Bana) = [6]> then\n        set [koordinat v] to [-60]\n    end\nend\nif <(Värld) = [4]> then\n    if <(Bana) = [2]> then\n        set [koordinat v] to [-210]\n    end\n    if <(Bana) = [4]> then\n        set [koordinat v] to [-170]\n    end\n    if <(Bana) = [6]> then\n        set [koordinat v] to [-130]\n    end\nend\n\nwhen flag clicked\ngo to x: (-231) y: (190)\nswitch costume to (ex v)\nhide\nset [koordinat v] to [0]\nset [specialbana v] to [0]\n\nwhen I receive [skada v]\nif <<<(Bossliv) = [5]> and <<<(Värld) = [1]> or <(Värld) = [2]>> and <(Bana) = [10]>>> or <<(Bossliv) = [3]> and <<(Värld) = [3]> and <(Bana) = [10]>>>> then\n    if <(DÖD?) = [0]> then\n        if <(Meddeland framme) = [0]> then\n            set [meddeland framme v] to [1]\n            go to x: (-231) y: (190)\n            switch costume to (join (Värld) [-Boss])\n            start sound [Fram v]\n            set [y-fart v] to [-8]\n            show\n            repeat (10)\n                change y by (Y-fart)\n                change [y-fart v] by (0.8)\n            end\n        end\n    end\n    if <(Meddeland framme) = [1]> then\n        wait until <<key (space v) pressed?> or <(Story-läge) = [1]>>\n        if <(Story-läge) = [0]> then\n            start sound [Bort v]\n        end\n        repeat (11)\n            change y by (Y-fart)\n            change [y-fart v] by (0.8)\n        end\n        hide\n        set [meddeland framme v] to [2]\n    end\nend\n\ndefine Meddelande\ngo to x: (-231) y: (190)\nswitch costume to (join (join (Värld) [-]) (Bana))\nif <(Specialbana) = [0]> then\n    wait until <([x position v] of [spelare v]) > (Koordinat)>\nend\nstart sound [Fram v]\nset [y-fart v] to [-8]\nshow\nrepeat (10)\n    change y by (Y-fart)\n    change [y-fart v] by (0.8)\nend\nwait until <<<key (space v) pressed?> or <([x position v] of [spelare v]) > [180]>> or <(Story-läge) = [1]>>\nif <(Story-läge) = [0]> then\n    start sound [Bort v]\nend\nrepeat (11)\n    change y by (Y-fart)\n    change [y-fart v] by (0.8)\nend\nhide\n\nwhen flag clicked\nset [meddeland framme v] to [0]\n\nwhen I receive [boss 3: start v]\nset [meddeland framme v] to [0]\n\nwhen I receive [boss 1: start v]\nset [meddeland framme v] to [0]\n\n@Bana\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [värld v] to [1]\nset [bana v] to [1]\nswitch costume to (1-1 v)\nset [ghost v] effect to (0)\nshow\n\nwhen I receive [nästa bana v]\nswitch costume to (join (Värld) (join [-] (Bana)))\n\nwhen I receive [jordbävning v]\nrepeat (3)\n    change y by (2)\n    wait (0.05) seconds\n    change y by (-2)\n    wait (0.05) seconds\nend\ngo to x: (0) y: (0)\n\nwhen I receive [musik: ny värld v]\nset volume to (100) %\nif <(Värld) = [2]> then\n    play sound [Värld 2: Debussy_ Préludes _ Book 1, L v] until done\nend\nif <(Värld) = [3]> then\n    play sound [Värld 3: The Ragtime Dance v] until done\nend\nif <(Värld) = [4]> then\n    play sound [Värld 4: Erik Satie - Gnossienne No v] until done\nend\nstop [this script v]\n\nwhen I receive [boss 1: intro v]\nKlamp pratar\n\nwhen I receive [boss 2: intro v]\nKlamp pratar\n\ndefine Klamp pratar\nrepeat (5)\n    change volume by (-20)\nend\nstop all sounds\nstart sound [Sports et divertissements_ La pieuvre v]\nrepeat (5)\n    change volume by (20)\nend\n\nwhen I receive [boss 3: intro v]\nKlamp pratar\n\nwhen I receive [boss 3: start v]\nBoss start\n\ndefine Boss start\nrepeat (5)\n    change volume by (-20)\nend\nstop all sounds\nset volume to (0) %\nif <(Boss) = [1]> then\n    start sound [Boss 1: Out of Doors, Suite for Piano, Sz v]\nend\nif <(Boss) = [2]> then\n    wait until <(Story-läge) = [0]>\n    start sound [Boss 2: Chopin_ 12 Études, Op v]\nend\nif <(Boss) = [3]> then\n    wait (6) seconds\n    start sound [Boss 3: Prokofiev - Dance of the Knights \(From Romeo and Juliet\) v]\nend\nif <(Boss) = [4]> then\n    start sound [Boss 4: Chopin - Revolutionary Etude \(Op v]\nend\nrepeat (5)\n    change volume by (20)\nend\n\nwhen I receive [boss 1: start v]\nBoss start\n\nwhen I receive [boss 2: start v]\nBoss start\n\nwhen I receive [boss 1: död v]\nBoss död\n\ndefine Boss död\nrepeat (5)\n    change volume by (-20)\nend\nstop all sounds\n\nwhen I receive [boss 2: död v]\nBoss död\n\nwhen I receive [boss 4: start v]\nBoss start\n\nwhen I receive [boss 3: död v]\nBoss död\n\nwhen I receive [boss 4: död v]\nBoss död\n\nwhen I receive [bb: tack björne! v]\nrepeat (5)\n    change volume by (20)\nend\nstart sound [Bunny Blue rescued: y2mate v]\n\nwhen I receive [boss 4: mötet v]\nBoss död\n\nwhen I receive [nu börjar allt v]\nset volume to (100) %\nstart sound [Värld 1: Erik Satie _1904_ Le Piccadilly v]\n\nwhen I receive [intro-story v]\nwait (3) seconds\nset volume to (100) %\nstart sound [Introstory v]\n\nwhen I receive [storymusiken avtar v]\nwait (1) seconds\nrepeat (20)\n    change volume by (-5)\nend\nstop all sounds\n\nwhen I receive [börja om på nytt v]\nrepeat (5)\n    change volume by (-20)\nend\nstop all sounds\nset volume to (0) %\nif <(Värld) = [1]> then\n    start sound [Värld 1: Erik Satie _1904_ Le Piccadilly v]\nend\nif <(Värld) = [2]> then\n    start sound [Värld 2: Debussy_ Préludes _ Book 1, L v]\nend\nif <(Värld) = [3]> then\n    start sound [Värld 3: The Ragtime Dance v]\nend\nif <(Värld) = [4]> then\n    start sound [Boss 4: Chopin - Revolutionary Etude \(Op v]\nend\nrepeat (5)\n    change volume by (20)\nend\n\nwhen I receive [game over! v]\nset volume to (100) %\nrepeat (5)\n    change volume by (-20)\nend\nstop all sounds\nset volume to (0) %\nwait (0.5) seconds\nset volume to (100) %\nstart sound [Game over v]\n\n@Banlinje\n\nwhen flag clicked\nset [ghost v] effect to (100)\nhide\ngo to x: (0) y: (50)\n\nwhen I receive [tappa ringen v]\nswitch costume to (join (Värld) (join [-] (Bana)))\nshow\n\nwhen I receive [ta ringen igen v]\nhide\n\nwhen I receive [nästa bana v]\nhide\nif <(Värld) = [4]> then\n    if <(Bana) = [10]> then\n        switch costume to (4-10 v)\n        show\n    end\nend\n\n@Bakgrund\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (1-1 v)\nset [ghost v] effect to (0)\nshow\n\nwhen I receive [nästa bana v]\nswitch costume to (join (Värld) (join [-] (Bana)))\n\nwhen I receive [jordbävning v]\nrepeat (3)\n    change y by (2)\n    wait (0.05) seconds\n    change y by (-2)\n    wait (0.05) seconds\nend\ngo to x: (0) y: (0)\n\n@Luftballong\n\nwhen flag clicked\ngo to [back v] layer\nhide\nset [y-koordinat v] to [-50]\n\nwhen I receive [nästa bana v]\nhide\nif <(Bana) = [10]> then\n    if <(Värld) = [1]> then\n        switch costume to (värld 1 v)\n        go to x: (139) y: (86)\n        show\n    end\n    if <(Värld) = [2]> then\n        switch costume to (värld 2 v)\n        go to x: (-62) y: (74)\n        show\n    end\n    if <(Värld) = [3]> then\n        switch costume to (värld 3 v)\n        go to x: (-182) y: (90)\n        show\n    end\n    if <(Värld) = [4]> then\n        switch costume to (värld 4 v)\n        go to x: (-42) y: (80)\n        show\n    end\n    set [ballongfart v] to [0]\n    forever\n        repeat until <(Ballongfart) > [0.5]>\n            change y by (Ballongfart)\n            change [ballongfart v] by (0.02)\n        end\n        repeat until <(Ballongfart) < [-0.5]>\n            change y by (Ballongfart)\n            change [ballongfart v] by (-0.02)\n        end\n    end\nend\n\nwhen I receive [boss 1: död v]\nstop [other scripts in sprite v]\nset [ballong: i luften v] to [1]\nset [ballongfart v] to [0]\nrepeat (15)\n    change y by (Ballongfart)\n    change [ballongfart v] by (-0.1)\nend\nrepeat until <(y position) < [-40]>\n    change y by (Ballongfart)\nend\nset [ballong: i luften v] to [0]\n\nwhen I receive [boss 2: död v]\nstop [other scripts in sprite v]\nset [ballongfart v] to [0]\nrepeat (15)\n    change y by (Ballongfart)\n    change [ballongfart v] by (-0.1)\nend\nrepeat until <(y position) < [-34]>\n    change y by (Ballongfart)\nend\nset [ballong: i luften v] to [0]\n\nwhen I receive [nästa bana v]\nif <(Värld) = [2]> then\n    if <(Bana) = [1]> then\n        set [y-koordinat v] to [-50]\n        switch costume to (värld 2 v)\n        go to x: (-98) y: (89)\n        wait (1) seconds\n        show\n        Landning\n    end\nend\nif <(Värld) = [3]> then\n    if <(Bana) = [1]> then\n        set [y-koordinat v] to [-59]\n        switch costume to (värld 3 v)\n        go to x: (-98) y: (89)\n        wait (1) seconds\n        show\n        Landning\n    end\nend\nif <(Värld) = [4]> then\n    if <(Bana) = [1]> then\n        set [y-koordinat v] to [-80]\n        switch costume to (värld 4 v)\n        go to x: (12) y: (69)\n        wait (1) seconds\n        show\n        Landning\n    end\nend\n\ndefine Landning\nset [ballongfart v] to [0]\nrepeat (15)\n    change y by (Ballongfart)\n    change [ballongfart v] by (-0.1)\nend\nrepeat until <(y position) < (Y-koordinat)>\n    change y by (Ballongfart)\nend\nset [ballong: i luften v] to [0]\n\nwhen I receive [boss 3: död v]\nstop [other scripts in sprite v]\nset [ballongfart v] to [0]\nrepeat (15)\n    change y by (Ballongfart)\n    change [ballongfart v] by (-0.1)\nend\nrepeat until <(y position) < [-65]>\n    change y by (Ballongfart)\nend\nset [ballong: i luften v] to [0]\n\nwhen I receive [boss 4: död v]\nstop [other scripts in sprite v]\nset [ballongfart v] to [0]\nrepeat (15)\n    change y by (Ballongfart)\n    change [ballongfart v] by (-0.1)\nend\nrepeat until <(y position) < [-65]>\n    change y by (Ballongfart)\nend\nset [ballong: i luften v] to [0]\n\n@Dörr\n\nwhen I receive [intro-story v]\ngo to x: (-144) y: (-6)\nswitch costume to (stängd v)\nshow\nwait (2.5) seconds\nstart sound [431117__inspectorj__door-front-opening-a v]\nwait (0.5) seconds\nrepeat (8)\n    next costume\nend\nhide\n\nwhen flag clicked\ngo to x: (-144) y: (-6)\nswitch costume to (stängd v)\nshow\n\nwhen I receive [nästa bana v]\nhide\n\nwhen I receive [börja om på nytt v]\nif <(Värld) = [1]> then\n    go to x: (-144) y: (-6)\n    switch costume to (stängd v)\n    show\nend\n\n@Spelare\n\nwhen flag clicked\nset [gravitation v] to [-1.2]\nset [hopp-kraft v] to [10]\nset [acceleration v] to [2]\nset [resistans v] to [0.7]\nset [hopp-tid v] to [6]\nset [skadeläge v] to [0]\nset [story-läge v] to [1]\nset [frusen v] to [1]\nset [död? v] to [0]\nset [ghost v] effect to (0)\nshow\nset rotation style [don't rotate v]\nÅterställa och starta bana\n\ndefine Rörelse i steg (steg)\nchange [faller v] by (1)\nrepeat (steg)\n    set [senaste värdet v] to (x position)\n    change x by ((Hastighet X) / (steg))\n    Check: Nudda bana\n    if <(Nudda) > [0]> then\n        Krock X - Backe eller vägg\n    end\n    set [senaste värdet v] to (y position)\n    change y by ((Hastighet Y) / (steg))\n    Check: Nudda bana\n    if <(Nudda) > [0]> then\n        Krock Y - Tak eller golv\n    end\nend\n\ndefine Check: Nudda bana\nif <<touching (bana v)?> or <touching (plattform v)?>> then\n    set [nudda v] to [1]\nelse\n    set [nudda v] to [0]\nend\n\nwhen I receive [tick - spelare v]\nFlyttad av plattform\nKontroller - Upp & ner\nKontroller: Vänster & höger\nRörelse i steg (([abs v] of (Hastighet X) ) + ([abs v] of (Hastighet Y) ))\nVälj klädsel\n\ndefine Kontroller - Upp & ner\nif <(Story-läge) = [0]> then\n    if <key (up arrow v) pressed?> then\n        if <<<(Faller) < [3]> and <(Hoppar?) = [0]>> or <<<touching (vatten v)?> and <([y position v] of [vatten v]) > ((y position) - (20))>> and <(Hoppar?) = [0]>>> then\n            start sound [jump v]\n            set [hoppar? v] to [1]\n            set [faller v] to [3]\n        end\n        if <<(Hoppar?) > [0]> and <(Hoppar?) < (Hopp-tid)>> then\n            change [hoppar? v] by (1)\n            set [hastighet y v] to (Hopp-kraft)\n        end\n    else\n        set [hoppar? v] to [0]\n    end\nend\nchange [hastighet y v] by (Gravitation)\n\ndefine Kontroller: Vänster & höger\nif <(Story-läge) = [0]> then\n    set [key x v] to (<key (right arrow v) pressed?> - <key (left arrow v) pressed?>)\nelse\n    set [key x v] to [0]\nend\nif <(Key X) = [0]> then\n    if <([abs v] of (Hastighet X) ) < [1]> then\n        set [bildruta v] to [0]\n        set [hastighet x v] to [0]\n    else\n        change [bildruta v] by (0.5)\n    end\nelse\n    if <(Story-läge) = [0]> then\n        change [hastighet x v] by ((Key X) * (Acceleration))\n        point in direction ((Key X) * (90))\n        change [bildruta v] by (0.5)\n    end\nend\nset [hastighet x v] to ((Hastighet X) * (Resistans))\n\ndefine Återställa och starta bana\nset [hastighet y v] to [0]\nset [hastighet x v] to [0]\nset [faller v] to [99]\ngo to x: (-179) y: (0)\nbroadcast (Spelloop v)\n\nwhen I receive [spelloop v]\nforever\n    if <(Frusen) = [0]> then\n        broadcast (Tick - Första v)\n        broadcast (Tick - Plattformar v)\n        broadcast (Tick - Spelare v)\n        broadcast (Tick - Sista v)\n    end\nend\n\nwhen I receive [tick - sista v]\nif <<(Boss igång) = [0]> and <(Story-läge) = [0]>> then\n    if <not <(Bana) = [10]>> then\n        if <(x position) > [235]> then\n            Nästa bana\n        end\n    end\nend\n\ndefine Fixa kolistion i riktning (dir)\nset [temporärt v] to (direction)\nset [distans v] to [1]\npoint in direction (dir)\nrepeat (128)\n    Check: Nudda bana\n    if <(Nudda) < [1]> then\n        point in direction (Temporärt)\n        stop [this script v]\n    end\n    move (Distans) steps\n    turn right (180) degrees\n    change [distans v] by (1)\nend\n\ndefine Krock X - Backe eller vägg\nchange y by (1)\nCheck: Nudda bana\nif <(Nudda) > [0]> then\n    change y by (1)\n    Check: Nudda bana\n    if <(Nudda) > [0]> then\n        change y by (-2)\n        set x to (Senaste värdet)\n        set [hastighet x v] to [0]\n        stop [this script v]\n    end\n    set [hastighet x v] to ((Hastighet X) * (0.8))\nend\nset [hastighet x v] to ((Hastighet X) * (0.95))\nHalka\n\ndefine Krock Y - Tak eller golv\nset y to (Senaste värdet)\nif <(Hastighet Y) > [0]> then\n    set [hastighet y v] to [0]\n    stop [this script v]\nend\nif <(Faller) > [0]> then\n    set [faller v] to [0]\n    Halka\nend\nset [hastighet y v] to ((Hastighet Y) * (0.8))\n\ndefine Halka\nchange y by (-2)\nchange x by (1)\nCheck: Nudda bana\nif <(Nudda) < [1]> then\n    set [faller v] to [9]\n    change [hastighet x v] by (1)\n    stop [this script v]\nend\nchange x by (-2)\nCheck: Nudda bana\nif <(Nudda) < [1]> then\n    set [faller v] to [9]\n    change [hastighet x v] by (-1)\n    stop [this script v]\nend\nchange y by (2)\nchange x by (1)\n\ndefine Flyttad av plattform\nchange x by (Plattform DX)\nchange y by (Plattform DY)\nCheck: Nudda bana\nif <(Nudda) > [0]> then\n    Hitta närmaste ställe till (x position) (y position) max [16]\n    if <(Nudda) > [0]> then\n        broadcast (Skada av hål v)\n    end\nend\n\nwhen I receive [tick - första v]\nset [plattform dx v] to []\nset [plattform dy v] to []\n\ndefine Hitta närmaste ställe till (x) (y) max (max)\nset [temporärt v] to (direction)\nset [distans v] to [1]\npoint in direction (0)\nrepeat (max)\n    repeat (16)\n        go to x: (x) y: (y)\n        move (Distans) steps\n        Check: Nudda bana\n        if <(Nudda) < [1]> then\n            point in direction (Temporärt)\n            stop [this script v]\n        end\n        turn right (22.5) degrees\n    end\n    change [distans v] by (1)\nend\ngo to x: (x) y: (y)\npoint in direction (Temporärt)\n\nwhen I receive [skada av hål v]\nchange [liv v] by (-1)\nbroadcast (Ändra statistik- hjärtan' v)\nif <(Liv) = [0]> then\n    set [story-läge v] to [1]\n    set [död? v] to [1]\n    broadcast (GAME OVER! v)\n    broadcast (Story-läge v)\nend\nstart sound [Faller ner v]\nif <<<(Värld) = [3]> and <(Bana) = [10]>> and <(Boss igång) = [1]>> then\n    set x to (10)\nelse\n    set x to (-200)\nend\nset y to (200)\nwait until <(Faller) = [0]>\nset [skadeläge v] to [0]\n\nwhen I receive [tick - spelare v]\nif <(y position) < [-195]> then\n    set [skadeläge v] to [11]\n    broadcast (Skada av hål v)\nend\nif <touching (_edge_ v)?> then\n    set [rör kant? v] to [1]\nelse\n    set [rör kant? v] to [0]\nend\n\nwhen I receive [tick - första v]\nswitch costume to (hitbox v)\nset rotation style [don't rotate v]\n\ndefine Välj klädsel\nset rotation style [left-right v]\nif <(Faller) > [1]> then\n    if <(Hastighet Y) > [0]> then\n        switch costume to (hopp v)\n    else\n        switch costume to (fall v)\n    end\n    stop [this script v]\nend\nif <(Bildruta) > [0]> then\n    switch costume to ((3) + ([floor v] of ((Bildruta) mod (11)) ))\nelse\n    switch costume to (still v)\nend\n\ndefine Nästa bana\nif <(Bana) = [10]> then\n    change [värld v] by (1)\n    set [bana v] to [0]\nend\nchange [bana v] by (1)\nset x to (-245)\nset [ballong: i luften v] to [1]\nbroadcast (Nästa bana v)\nstop [other scripts in sprite v]\nbroadcast (Nästa bana \(spelare\) v)\nwait (0) seconds\nswitch costume to (hitbox v)\nset rotation style [don't rotate v]\nFixa kolistion i riktning [0]\nVälj klädsel\nset [ghost v] effect to (0)\nset [skadeläge v] to [0]\nbroadcast (Spelloop v)\n\nwhen I receive [tick - spelare v]\nif <(Sandstorm?) = [1]> then\n    change [hastighet x v] by (-1.2)\nend\nif <(Sandstorm?) = [2]> then\n    change [hastighet x v] by (1.2)\nend\n\nwhen I receive [skada v]\nchange [liv v] by (-1)\nif <(Liv) = [0]> then\n    set [story-läge v] to [1]\n    set [död? v] to [1]\n    broadcast (GAME OVER! v)\n    start sound (pick random (2) to (3))\n    broadcast (Story-läge v)\nend\nif <(Liv) > [0]> then\n    broadcast (Visa hjärtan v)\n    start sound (pick random (2) to (3))\n    set [ghost v] effect to (20)\n    if <(Skadeläge) = [11]> then\n        change [hastighet x v] by (-10)\n        change [hastighet y v] by (10)\n    end\n    if <(Skadeläge) = [12]> then\n        change [hastighet x v] by (10)\n        change [hastighet y v] by (10)\n    end\n    wait (1.5) seconds\n    set [ghost v] effect to (0)\n    set [skadeläge v] to [0]\nend\n\nwhen I receive [åter till spelet v]\nset [hastighet y v] to [0]\nset [hastighet x v] to [0]\nset [faller v] to [99]\nbroadcast (Spelloop v)\n\nwhen I receive [tick - spelare v]\nif <<touching (vatten v)?> and <([y position v] of [vatten v]) > ((y position) - (45))>> then\n    set [gravitation v] to [-0.2]\n    set [resistans v] to [0.4]\n    set [hopp-kraft v] to [3]\nelse\n    set [gravitation v] to [-1.2]\n    set [resistans v] to [0.7]\n    set [hopp-kraft v] to [10]\nend\n\nwhen I receive [boss: skadad v]\nif <(Skadeläge) = [11]> then\n    change [hastighet x v] by (-10)\n    change [hastighet y v] by (10)\nend\nif <(Skadeläge) = [12]> then\n    change [hastighet x v] by (10)\n    change [hastighet y v] by (10)\nend\n\nwhen I receive [nästa bana \(spelare\) v]\nif <(Värld) = [1]> then\n    if <(Bana) = [10]> then\n        wait until <(x position) > [75]>\n        set [story-läge v] to [1]\n        broadcast (Boss 1: Intro v)\n        broadcast (Story-läge v)\n    end\nend\nif <(Värld) = [2]> then\n    if <(Bana) = [10]> then\n        wait until <(x position) > [30]>\n        set [story-läge v] to [1]\n        broadcast (Boss 2: Intro v)\n        broadcast (Story-läge v)\n    end\nend\nif <(Värld) = [3]> then\n    if <(Bana) = [10]> then\n        wait until <(x position) > [75]>\n        set [story-läge v] to [1]\n        broadcast (Boss 3: intro v)\n        broadcast (Story-läge v)\n    end\nend\nif <(Värld) = [4]> then\n    if <(Bana) = [10]> then\n        wait until <(x position) > [-140]>\n        set [story-läge v] to [1]\n        broadcast (Boss 4: Mötet v)\n        broadcast (Story-läge v)\n    end\nend\n\nwhen I receive [pandafaffa-prat v]\nwait (0.5) seconds\npoint towards (pandafaffa v)\n\nwhen I receive [boss 1: start v]\nwait (1.5) seconds\npoint in direction (-90)\n\nwhen I receive [nivå avklarad v]\nset [frusen v] to [1]\nset [story-läge v] to [0]\n\nwhen I receive [nästa värld v]\nhide\nNästa bana\nwait until <(Ballong: I luften) = [0]>\ngo to x: (-245) y: (-35)\npoint in direction (90)\nwait (0.5) seconds\nset [story-läge v] to [1]\nset [frusen v] to [0]\nshow\nrepeat (44)\n    set [hastighet x v] to [4]\nend\nset [story-läge v] to [0]\nbroadcast (Stoy-läge avslutat v)\nbroadcast (Musik: Ny värld v)\n\nchange [hoppar? v] by (1)\nset [hastighet y v] to (Hopp-kraft)\n\nwhen I receive [tick - spelare v]\nif <(x position) > [0]> then\n    set [björnes position v] to [3]\nend\nif <(x position) < [0]> then\n    set [björnes position v] to [1]\nend\n\nwhen I receive [boss 2: start v]\nwait (1.5) seconds\npoint in direction (-90)\n\nwhen I receive [bb: rescued v]\nwait (1) seconds\npoint towards (bunny blue v)\n\nwhen I receive [intro-story v]\ngo to x: (230) y: (-44)\npoint in direction (-90)\nset [story-läge v] to [1]\nset [frusen v] to [0]\nwait (1) seconds\nrepeat (65)\n    set [hastighet x v] to [-4]\nend\nwait until <([x position v] of [klamp v]) > (x position)>\npoint in direction (90)\n\nwhen I receive [pandafaffa hjälper till v]\npoint in direction (-90)\n\nwhen I receive [game over! v]\nif <(Skadeläge) = [11]> then\n    change [hastighet x v] by (-10)\n    change [hastighet y v] by (10)\nend\nif <(Skadeläge) = [12]> then\n    change [hastighet x v] by (10)\n    change [hastighet y v] by (10)\nend\n\nwhen I receive [continue-button v]\nset [frusen v] to [1]\nset [värld v] to (Värld)\nset [bana v] to [0]\nNästa bana\n\nwhen I receive [börja om på nytt v]\ngo to x: (-178) y: (-8)\npoint in direction (90)\nset [död? v] to [0]\nset [frusen v] to [0]\nset [story-läge v] to [0]\n\n@Pandafaffa\n\nwhen flag clicked\nset [ghost v] effect to (0)\nhide\nset rotation style [left-right v]\npoint in direction (-90)\n\nwhen I receive [boss: slut v]\nwait until <(Ballong: I luften) = [0]>\nwait (1) seconds\nif <(Värld) = [1]> then\n    go to x: (240) y: (-46)\n    set [gånglängd v] to [30]\nend\nif <(Värld) = [2]> then\n    go to x: (240) y: (45)\n    set [gånglängd v] to [34]\nend\nif <(Värld) = [3]> then\n    go to x: (240) y: (-39)\n    set [gånglängd v] to [17]\nend\nif <not <(Värld) = [4]>> then\n    point in direction (-90)\n    switch costume to (gå #1 v)\n    show\n    repeat (Gånglängd)\n        change x by (-3)\n        next costume\n    end\n    switch costume to (gå #1 v)\n    point towards (spelare v)\n    set [pratbubbla igång v] to [1]\n    broadcast (Pandafaffa-prat v)\n    wait until <(Pratbubbla igång) = [0]>\n    point in direction (90)\n    repeat (Gånglängd)\n        change x by (3)\n        next costume\n    end\n    hide\n    broadcast (Nivå avklarad v)\n    stop [other scripts in sprite v]\nend\n\nif <(Värld) = [4]> then\n    switch costume to (gå #1 v)\n    show\n    if <[] = [0]> then\n        point in direction (90)\n        repeat (Gånglängd)\n            change x by (3)\n            next costume\n        end\n    end\n    if <[] = [1]> then\n        point in direction (-90)\n        repeat (Gånglängd)\n            change x by (-3)\n            next costume\n        end\n    end\n    switch costume to (gå #1 v)\n    set [pratbubbla igång v] to [1]\n    broadcast (Pandafaffa-prat v)\n    wait until <(Pratbubbla igång) = [0]>\n    set [story-läge v] to [0]\nend\n\ndefine Ut ur marken\nrepeat until <not <touching (bana v)?>>\n    change y by (1)\nend\nset [y-fart v] to [0]\n\nset [acceleration v] to [0]\n\nwhen I receive [nästa bana v]\nif <(Värld) = [2]> then\n    if <(Bana) = [2]> then\n        hide\n    end\nend\n\nwhen I receive [boss: slut v]\nset [y-fart v] to [0]\nforever\n    change [y-fart v] by (-1)\n    change y by (Y-Fart)\n    if <touching (bana v)?> then\n        Ut ur marken\n    end\nend\n\nwhen I receive [bb: pandafaffa vill hem v]\ngo to x: (246) y: (-45)\npoint in direction (-90)\nswitch costume to (gå #1 v)\nshow\nrepeat (27)\n    change x by (-3)\n    next costume\nend\nswitch costume to (gå #1 v)\nset [pratbubbla igång v] to [1]\nbroadcast (Pandafaffa-prat v)\nwait until <(Pratbubbla igång) = [0]>\nbroadcast (Spelet avklarat v)\nstop [other scripts in sprite v]\n\nwhen I receive [bb: pandafaffa vill hem v]\nset [y-fart v] to [0]\nforever\n    change [y-fart v] by (-1)\n    change y by (Y-Fart)\n    if <touching (bana v)?> then\n        Ut ur marken\n    end\nend\n\nwhen I receive [klamp flyr v]\nwait (4) seconds\ngo to x: (-245) y: (-10)\npoint in direction (90)\nswitch costume to (gå #1 v)\nshow\nrepeat (30)\n    change x by (3)\n    next costume\n    if <touching (bana v)?> then\n        change y by (0.5)\n    end\nend\nswitch costume to (gå #1 v)\nset [pratbubbla igång v] to [1]\nbroadcast (Pandafaffa hjälper till v)\nwait until <(Pratbubbla igång) = [0]>\npoint in direction (-90)\nrepeat (30)\n    change x by (-3)\n    next costume\n    if <not <touching (bana v)?>> then\n        change y by (-0.5)\n    end\nend\nhide\nbroadcast (Nu börjar allt v)\nbroadcast (Stoy-läge avslutat v)\nset [story-läge v] to [0]\nstop [other scripts in sprite v]\n\n@Klamp\n\nwhen I receive [intro-story v]\nhide\nwait (3.1) seconds\ngo to x: (-177) y: (-7)\npoint in direction (90)\nswitch costume to (still2 v)\nshow\nwait (1) seconds\nbroadcast (Klamp kidnappar v)\n\nwhen flag clicked\ngo to x: (173) y: (-47)\nhide\nset [plats? # v] to [0]\n\nwhen I receive [nästa bana v]\nhide\nif <(Värld) = [1]> then\n    if <(Bana) = [10]> then\n        go to x: (173) y: (-45)\n        point in direction (-90)\n        switch costume to (still v)\n        show\n    end\nend\nif <(Värld) = [2]> then\n    if <(Bana) = [10]> then\n        go to x: (133) y: (30)\n        point in direction (-90)\n        switch costume to (still v)\n        show\n    end\nend\nif <(Värld) = [3]> then\n    if <(Bana) = [10]> then\n        go to x: (191) y: (-49)\n        point in direction (-90)\n        switch costume to (still v)\n        show\n    end\nend\nif <(Värld) = [4]> then\n    if <(Bana) = [10]> then\n        go to x: (33) y: (-86)\n        point in direction (-90)\n        switch costume to (still v)\n        show\n    end\nend\nstop [other scripts in sprite v]\n\nwhen I receive [boss 1: start v]\nwait (0.5) seconds\npoint in direction (90)\nrepeat (13)\n    change x by (7)\n    next costume\n    if <(costume [number v]) = [12]> then\n        switch costume to (still v)\n    end\nend\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [boss 2: start v]\nwait (0.5) seconds\npoint in direction (90)\nrepeat (17)\n    change x by (7)\n    next costume\n    if <(costume [number v]) = [12]> then\n        switch costume to (still v)\n    end\nend\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [boss 3: start v]\nwait (0.5) seconds\npoint in direction (90)\nrepeat (8)\n    change x by (7)\n    next costume\n    if <(costume [number v]) = [12]> then\n        switch costume to (still v)\n    end\nend\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [boss 1: intro v]\nGravitation\n\nwhen I receive [boss 2: intro v]\nGravitation\n\nwhen I receive [boss 3: intro v]\nGravitation\n\nwhen I receive [boss 4: intro v]\nGravitation\n\nwhen I receive [boss 4: start v]\nset [bossliv v] to [10]\nset [boss igång v] to [1]\nset [klamp: attack igång? v] to [0]\nset [attack? # v] to [0]\nset [plats? # v] to [2]\nset [story-läge v] to [0]\nbroadcast (Stoy-läge avslutat v)\nwait (1) seconds\nforever\n    switch costume to (still v)\n    set [föregående plats # v] to (Plats? #)\n    repeat until <<not <(Föregående plats #) = (Plats? #)>> and <not <(Plats? #) = (Björnes position)>>>\n        set [plats? # v] to (pick random (1) to (3))\n    end\n    set [föregående attack? # v] to (Attack? #)\n    set [attack? # v] to (pick random (1) to (2))\n    if <<<(Plats? #) = [1]> or <(Plats? #) = [3]>> and <(Föregående attack? #) = [1]>> then\n        set [attack? # v] to [3]\n    end\n    set [repititioner? # v] to (pick random (1) to (3))\n    if <(Plats? #) = [1]> then\n        point in direction (-90)\n        repeat until <(x position) < [-155]>\n            change x by (-3)\n            next costume\n            if <(costume [number v]) = [12]> then\n                switch costume to (still v)\n            end\n        end\n    end\n    if <(Plats? #) = [2]> then\n        if <(Föregående plats #) = [1]> then\n            point in direction (90)\n            repeat until <(x position) > [30]>\n                change x by (3)\n                next costume\n                if <(costume [number v]) = [12]> then\n                    switch costume to (still v)\n                end\n            end\n        end\n        if <(Föregående plats #) = [3]> then\n            point in direction (-90)\n            repeat until <(x position) < [36]>\n                change x by (-3)\n                next costume\n                if <(costume [number v]) = [12]> then\n                    switch costume to (still v)\n                end\n            end\n        end\n    end\n    if <(Plats? #) = [3]> then\n        point in direction (90)\n        repeat until <(x position) > [190]>\n            change x by (3)\n            next costume\n            if <(costume [number v]) = [12]> then\n                switch costume to (still v)\n            end\n        end\n    end\n    repeat (Repititioner? #)\n        point towards (spelare v)\n        if <(Attack? #) = [1]> then\n            set [klamp: attack igång? v] to [1]\n            switch costume to (förbered ben #1 v)\n            repeat (6)\n                next costume\n            end\n            wait (0.5) seconds\n            repeat (5)\n                next costume\n            end\n            broadcast (Klamp: Ben v)\n            repeat (5)\n                switch costume to (kasta ben #1 v)\n                repeat (8)\n                    next costume\n                end\n                set [klamp: attack igång? v] to [0]\n            end\n        end\n        if <(Attack? #) = [2]> then\n            set [klamp: attack igång? v] to [1]\n            switch costume to (bumerangen #1 v)\n            wait (1) seconds\n            repeat (10)\n                next costume\n            end\n            wait (0.3) seconds\n            broadcast (Klamp: Boomerang v)\n            repeat (4)\n                next costume\n            end\n        end\n        if <(Attack? #) = [3]> then\n            set [klamp: attack igång? v] to [1]\n            switch costume to (fram med raket #1 v)\n            wait (0.5) seconds\n            repeat (8)\n                next costume\n            end\n            start sound [Tänder på v]\n            wait (0.7) seconds\n            broadcast (Klamp: Raket v)\n            repeat (2)\n                next costume\n            end\n            switch costume to (still v)\n        end\n        wait until <(Klamp: attack igång?) = [0]>\n        if <(Attack? #) = [2]> then\n            switch costume to (bumerangen #7 v)\n            wait (0.5) seconds\n            repeat (6)\n                switch costume to ((costume [number v]) - (1))\n            end\n        end\n        if <(Repititioner? #) > [1]> then\n            Ny attack\n        end\n    end\nend\n\ndefine Ny attack\nset [föregående attack? # v] to (Attack? #)\nrepeat until <not <(Föregående attack? #) = (Attack? #)>>\n    set [attack? # v] to (pick random (1) to (3))\nend\n\nwhen I receive [boss 4: död v]\nswitch costume to (död #1 v)\nrepeat (4)\n    next costume\nend\nset [pratbubbla igång v] to [1]\nwait until <(Pratbubbla igång) = [0]>\nset [boss igång v] to [0]\nstop [other scripts in sprite v]\nbroadcast (Klamp: Gravitation v)\nwait (1) seconds\nrepeat (4)\n    switch costume to ((costume [number v]) - (1))\nend\nswitch costume to (still v)\npoint in direction (90)\nrepeat until <(x position) > [242]>\n    change x by (7)\n    next costume\n    if <(costume [number v]) = [12]> then\n        switch costume to (still v)\n    end\nend\nhide\nstop [other scripts in sprite v]\nbroadcast (Boss: Slut v)\nbroadcast (Finalboss: Slut v)\n\nwhen I receive [klamp: gravitation v]\nGravitation\n\nwhen I receive [boss 4: start v]\nforever\n    if <(Skadeläge) = [0]> then\n        if <<<touching (spelare v)?> and <([faller v] of [spelare v]) > [5]>> and <([y position v] of [spelare v]) > ((y position) + (35))>> then\n            if <([x position v] of [spelare v]) < (x position)> then\n                start sound [recording2 v]\n                set [skadeläge v] to [11]\n                broadcast (Boss: Skadad v)\n            end\n            if <([x position v] of [spelare v]) > (x position)> then\n                start sound [recording2 v]\n                set [skadeläge v] to [12]\n                broadcast (Boss: Skadad v)\n            end\n        end\n        if <<touching (spelare v)?> and <<not <([faller v] of [spelare v]) > [5]>> and <not <([y position v] of [spelare v]) > ((y position) + (35))>>>> then\n            if <([x position v] of [spelare v]) < (x position)> then\n                set [skadeläge v] to [11]\n                broadcast (Skada v)\n            end\n            if <([x position v] of [spelare v]) > (x position)> then\n                set [skadeläge v] to [12]\n                broadcast (Skada v)\n            end\n        end\n    end\nend\n\nwhen I receive [boss: skadad v]\nif <(Värld) = [4]> then\n    if <(Bossliv) > [1]> then\n        change [bossliv v] by (-1)\n        broadcast (Visa bosshjärtan v)\n        set [ghost v] effect to (20)\n        wait (1.5) seconds\n        set [ghost v] effect to (0)\n        set [skadeläge v] to [0]\n    else\n        set [story-läge v] to [1]\n        stop [other scripts in sprite v]\n        broadcast (Klamp: Gravitation v)\n        broadcast (Boss 4: Död v)\n        broadcast (Story-läge v)\n    end\nend\n\nwhen I receive [intro-story v]\nGravitation\n\ndefine Upp ur marken\nrepeat until <not <<touching (bana v)?> or <touching (bur v)?>>>\n    change y by (1)\nend\nset [y-fart v] to [0]\n\ndefine Gravitation\nset [y-fart v] to [0]\nforever\n    change [y-fart v] by (-1)\n    change y by (Y-Fart)\n    if <<touching (bana v)?> or <touching (bur v)?>> then\n        Upp ur marken\n    end\nend\n\nwhen I receive [klamp flyr v]\nrepeat until <(x position) > [242]>\n    change x by (7)\n    next costume\n    if <(costume [number v]) = [76]> then\n        switch costume to (still2 v)\n    end\nend\nhide\nstop [other scripts in sprite v]\nbroadcast (STorymusiken avtar v)\n\n@Bunny Blue\n\nwhen flag clicked\nhide\nset rotation style [left-right v]\n\nwhen I receive [bb: ut ur buren v]\ngo to (bur v)\nchange y by (-152)\nchange x by (4)\npoint towards (spelare v)\nswitch costume to (pose v)\nshow\nrepeat until <([abs v] of (([x position v] of [spelare v]) - (x position)) ) < [50]>\n    change x by (-2)\n    next costume\nend\nrepeat until <<(costume [number v]) = [1]> or <(costume [number v]) = [7]>>\n    next costume\nend\nbroadcast (BB: Tack Björne! v)\n\nwhen I receive [bb: ut ur buren v]\nGravitation\n\nwhen I receive [bb: pandafaffa vill hem v]\nwait (1) seconds\npoint towards (pandafaffa v)\n\ndefine Gravitation\nset [fart y v] to [0]\nforever\n    change [fart y v] by (-1)\n    change y by (Fart Y)\n    if <touching (bana v)?> then\n        Upp ur marken\n    end\nend\n\ndefine Upp ur marken\nrepeat until <not <touching (bana v)?>>\n    change y by (1)\nend\nset [fart y v] to [0]\n\n@Säck\n\nwhen I receive [intro-story v]\nwait (3) seconds\nGravitation\n\nwhen I receive [intro-story v]\nhide\ngo to x: (-192) y: (-20)\npoint in direction (90)\nwait (3) seconds\nshow\n\nwhen I receive [intro-story v]\nwait until <(x position) > [-30]>\nrepeat (13)\n    turn right (1.5) degrees\nend\nrepeat (13)\n    turn left (1.5) degrees\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [klamp flyr v]\nrepeat until <(x position) > [292]>\n    change x by (7)\n    next costume\nend\nhide\nstop [other scripts in sprite v]\n\ndefine Gravitation\nset [y-fart v] to [0]\nforever\n    change [y-fart v] by (-1)\n    change y by (Y-Fart)\n    if <<touching (bana v)?> or <touching (bur v)?>> then\n        Upp ur marken\n    end\nend\n\ndefine Upp ur marken\nrepeat until <not <<touching (bana v)?> or <touching (bur v)?>>>\n    change y by (1)\nend\nset [y-fart v] to [0]\n\n@Liv\n\nwhen flag clicked\nset [liv v] to [5]\nset [hjärtan igång? v] to [0]\nswitch costume to (Liv)\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [hjärtan på plats v]\nrepeat until <(Hjärtan igång?) = [0]>\n    set x to ([x position v] of [spelare v])\n    set y to ([y position v] of [spelare v])\nend\n\nwhen I receive [visa hjärtan v]\nswitch costume to (Liv)\nset [hjärtan igång? v] to [1]\nbroadcast (Hjärtan på plats v)\nset [ghost v] effect to (100)\nshow\nrepeat (2)\n    change [ghost v] effect by (-50)\nend\nwait (1.5) seconds\nrepeat (2)\n    change [ghost v] effect by (50)\nend\nhide\nset [hjärtan igång? v] to [0]\nstop [this script v]\n\nwhen I receive [3+ liv v]\nchange [liv v] by (3)\nbroadcast (Visa hjärtan v)\n\nwhen I receive [börja om på nytt v]\nset [liv v] to [5]\nset [hjärtan igång? v] to [0]\nswitch costume to (Liv)\nset [ghost v] effect to (100)\nhide\n\n@Extraliv\n\nwhen I receive [nästa bana v]\nhide\nif <<(Värld) = [1]> and <<(Bana) = [6]> or <(Bana) = [9]>>> then\n    if <(Bana) = [6]> then\n        go to x: (-47) y: (-32)\n    end\n    if <(Bana) = [9]> then\n        go to x: (104) y: (-20)\n    end\n    switch costume to (#1 v)\n    show\n    repeat until <touching (spelare v)?>\n        next costume\n    end\n    broadcast (3+ liv v)\n    start sound [Extra liv v]\n    hide\n    stop [other scripts in sprite v]\nend\nif <<(Värld) = [2]> and <<(Bana) = [6]> or <(Bana) = [9]>>> then\n    if <(Bana) = [6]> then\n        go to x: (-48) y: (2)\n    end\n    if <(Bana) = [9]> then\n        go to x: (168) y: (1)\n    end\n    switch costume to (#1 v)\n    show\n    repeat until <touching (spelare v)?>\n        next costume\n    end\n    broadcast (3+ liv v)\n    start sound [Extra liv v]\n    hide\n    stop [other scripts in sprite v]\nend\nif <(Värld) = [3]> then\n    if <<(Bana) = [6]> or <(Bana) = [9]>> then\n        if <(Bana) = [6]> then\n            go to x: (76) y: (-17)\n        end\n        if <(Bana) = [9]> then\n            go to x: (-3) y: (21)\n        end\n        switch costume to (#1 v)\n        show\n        repeat until <touching (spelare v)?>\n            next costume\n        end\n        broadcast (3+ liv v)\n        start sound [Extra liv v]\n        hide\n        stop [other scripts in sprite v]\n    end\nend\nif <(Värld) = [4]> then\n    if <<(Bana) = [6]> or <(Bana) = [9]>> then\n        if <(Bana) = [6]> then\n            go to x: (60) y: (-6)\n        end\n        if <(Bana) = [9]> then\n            go to x: (32) y: (-6)\n        end\n        switch costume to (#1 v)\n        show\n        repeat until <touching (spelare v)?>\n            next costume\n        end\n        broadcast (3+ liv v)\n        start sound [Extra liv v]\n        hide\n        stop [other scripts in sprite v]\n    end\nend\n\nwhen flag clicked\nhide\n\ndefine snurr\nforever\n    next costume\n    if <(costume [number v]) = [15]> then\n        switch costume to (#1 v)\n    end\nend\n\n@Bossliv\n\nwhen flag clicked\nset [hjärtan igång? v] to [0]\nswitch costume to (Bossliv)\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [bosshjärtan på plats v]\nrepeat until <(Hjärtan igång?) = [0]>\n    if <(Boss) = [1]> then\n        set x to ([x position v] of [snigelboss v])\n        set y to ([y position v] of [snigelboss v])\n    end\n    if <(Boss) = [2]> then\n        set x to ([x position v] of [cactupiller v])\n        set y to (([y position v] of [cactupiller v]) + (45))\n    end\n    if <(Boss) = [3]> then\n        set x to ([x position v] of [bläckfisk v])\n        set y to (([x position v] of [bläckfisk v]) - (65))\n    end\n    if <(Boss) = [4]> then\n        set x to ([x position v] of [klamp v])\n        set y to (([y position v] of [klamp v]) + (3))\n    end\nend\n\nwhen I receive [visa bosshjärtan v]\nswitch costume to (Bossliv)\nset [hjärtan igång? v] to [1]\nbroadcast (Bosshjärtan på plats v)\nset [ghost v] effect to (100)\nshow\nrepeat (2)\n    change [ghost v] effect by (-50)\nend\nwait (1.5) seconds\nrepeat (2)\n    change [ghost v] effect by (50)\nend\nhide\nset [hjärtan igång? v] to [0]\nstop [this script v]\n\n@Ring\n\nwhen flag clicked\npoint in direction (90)\ngo to x: (-106) y: (-116)\nset [ringar #? v] to [0]\nhide\n\nwhen I receive [nästa bana v]\nset [har björne ringen? v] to [0]\npoint in direction (90)\nhide\nif <(Värld) = [1]> then\n    if <(Bana) = [4]> then\n        go to x: (60) y: (66)\n        show\n        Vickel\n    end\n    if <(Bana) = [7]> then\n        go to x: (-2) y: (74)\n        show\n        Vickel\n    end\nend\nif <(Värld) = [2]> then\n    if <(Bana) = [5]> then\n        go to x: (-25) y: (79)\n        show\n        Vickel\n    end\n    if <(Bana) = [7]> then\n        go to x: (-91) y: (-43)\n        show\n        Vickel\n    end\nend\nif <(Värld) = [3]> then\n    if <(Bana) = [5]> then\n        go to x: (55) y: (34)\n        show\n        Vickel\n    end\n    if <(Bana) = [7]> then\n        go to x: (-68) y: (55)\n        show\n        Vickel\n    end\nend\nif <(Värld) = [4]> then\n    if <(Bana) = [5]> then\n        go to x: (44) y: (-51)\n        show\n        Vickel\n    end\n    if <(Bana) = [7]> then\n        go to x: (29) y: (49)\n        show\n        Vickel\n    end\nend\n\nwhen I receive [nästa bana v]\nif <(Värld) = [1]> then\n    if <<(Bana) = [4]> or <(Bana) = [7]>> then\n        wait until <touching (spelare v)?>\n        stop [other scripts in sprite v]\n        start sound [Ring v]\n        set [har björne ringen? v] to [1]\n        change [ringar #? v] by (1)\n        broadcast (Ringstatistik v)\n        switch costume to (samlad #1 v)\n        repeat (2)\n            next costume\n        end\n        hide\n    end\nend\nif <(Värld) = [2]> then\n    if <<(Bana) = [5]> or <(Bana) = [7]>> then\n        wait until <touching (spelare v)?>\n        stop [other scripts in sprite v]\n        start sound [Ring v]\n        set [har björne ringen? v] to [1]\n        change [ringar #? v] by (1)\n        broadcast (Ringstatistik v)\n        switch costume to (samlad #1 v)\n        repeat (2)\n            next costume\n        end\n        hide\n    end\nend\nif <(Värld) = [3]> then\n    if <<(Bana) = [5]> or <(Bana) = [7]>> then\n        wait until <touching (spelare v)?>\n        stop [other scripts in sprite v]\n        start sound [Ring v]\n        set [har björne ringen? v] to [1]\n        change [ringar #? v] by (1)\n        broadcast (Ringstatistik v)\n        switch costume to (samlad #1 v)\n        repeat (2)\n            next costume\n        end\n        hide\n    end\nend\nif <(Värld) = [4]> then\n    if <<(Bana) = [5]> or <(Bana) = [7]>> then\n        wait until <touching (spelare v)?>\n        stop [other scripts in sprite v]\n        start sound [Ring v]\n        set [har björne ringen? v] to [1]\n        change [ringar #? v] by (1)\n        broadcast (Ringstatistik v)\n        switch costume to (samlad #1 v)\n        repeat (2)\n            next costume\n        end\n        hide\n    end\nend\nstop [other scripts in sprite v]\nstop [this script v]\n\ndefine Vickel\nforever\n    switch costume to (vick #1 v)\n    repeat (36)\n        next costume\n        if <(costume [number v]) = [13]> then\n            switch costume to (vick #1 v)\n        end\n    end\n    wait (1.5) seconds\nend\n\nwhen I receive [skada v]\nif <(Har Björne ringen?) = [1]> then\n    stop [other scripts in sprite v]\n    broadcast (Tappa ringen v)\nend\n\nwhen I receive [ta ringen igen v]\nwait until <touching (spelare v)?>\nstop [other scripts in sprite v]\nstart sound [Ring v]\nset [har björne ringen? v] to [1]\nchange [ringar #? v] by (1)\nbroadcast (Ringstatistik v)\nswitch costume to (samlad #1 v)\nrepeat (2)\n    next costume\nend\nhide\n\nwhen I receive [tappa ringen v]\nstart sound [Lost v]\ngo to (spelare v)\nset [har björne ringen? v] to [0]\nchange [ringar #? v] by (-1)\nbroadcast (Ringstatistik v)\nswitch costume to (vick #1 v)\nshow\nset [gravitation v] to [5]\nset [kraft v] to [4]\nif <(Skadeläge) = [11]> then\n    set [vilket håll? v] to [0]\nend\nif <(Skadeläge) = [12]> then\n    set [vilket håll? v] to [1]\nend\nrepeat until <<touching (banlinje v)?> and <(Gravitation) < [0]>>\n    change y by ((Gravitation) * (1.8))\n    if <(Vilket håll?) = [0]> then\n        turn right (10) degrees\n        change x by (Kraft)\n    end\n    if <(Vilket håll?) = [1]> then\n        turn left (10) degrees\n        change x by (join [-] (Kraft))\n    end\n    change [gravitation v] by (-0.2)\nend\npoint in direction (90)\nbroadcast (Ta ringen igen v)\n\nwhen I receive [ta ringen igen v]\nVickel\n\nwhen I receive [skada av hål v]\nif <(Har Björne ringen?) = [1]> then\n    set [har björne ringen? v] to [0]\n    change [ringar #? v] by (-1)\n    broadcast (Ringstatistik v)\n    start sound [Lost v]\nend\n\nwhen I receive [börja om på nytt v]\nset [ringar #? v] to [0]\nset [har björne ringen? v] to [0]\n\n@The end\n\nwhen flag clicked\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [spelet avklarat v]\ngo to x: (0) y: (0)\nswitch costume to (the end v)\nwait (8) seconds\nset [ghost v] effect to (100)\nshow\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\nbroadcast (Slutpoäng v)\n\nwhen I receive [game over! v]\ngo to x: (0) y: (0)\nswitch costume to (game over v)\nwait (4) seconds\nset [ghost v] effect to (100)\nshow\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nbroadcast (Continue-button v)\n\nwhen I receive [börja om på nytt v]\nrepeat (4)\n    change [ghost v] effect by (25)\nend\nhide\n\n@Continue-button\n\nwhen flag clicked\ngo to x: (0) y: (-45)\nhide\n\nwhen I receive [continue-button v]\nwait (1) seconds\ngo to x: (0) y: (-63)\nswitch costume to (klädsel1 v)\nshow\nset [fart v] to [4]\nrepeat (8)\n    change y by (Fart)\n    change [fart v] by (-0.5)\nend\nset [höjd v] to [0]\nset [kan klicka? v] to [1]\nforever\n    if <touching (mouse-pointer v)?> then\n        set [rör vid mus v] to [1]\n        repeat until <(Höjd) = [2]>\n            change [höjd v] by (1)\n            change y by (2)\n        end\n    else\n        set [rör vid mus v] to [0]\n        repeat until <(Höjd) = [0]>\n            change [höjd v] by (-1)\n            change y by (-2)\n        end\n    end\nend\n\nwhen I receive [continue-button v]\nforever\n    if <<<touching (mouse-pointer v)?> and <mouse down?>> and <<(Rör vid mus) = [1]> and <(Kan klicka?) = [1]>>> then\n        set [kan klicka? v] to [0]\n        start sound [Tryck v]\n        stop [other scripts in sprite v]\n        broadcast (Börja om på nytt v)\n        repeat (3)\n            next costume\n        end\n        hide\n    end\nend\n\n@Slutpoäng\n\nwhen flag clicked\nhide variable [#score 2 v]\nhide\n\nwhen I receive [slutpoäng v]\nwait (1) seconds\ngo to x: (-30) y: (-45)\nshow\nshow variable [#score 2 v]\n\n@Klamp: Pratbubbla\n\nwhen flag clicked\nswitch costume to (ex.3 v)\nhide\n\nwhen I receive [boss 2: intro v]\nstart sound [Sports et divertissements_ La pieuvre v]\nswitch costume to (blank v)\nwait (1) seconds\nstart sound [Nästa meddelande v]\nrepeat (6)\n    next costume\n    go to (klamp v)\n    change y by (25)\n    set [fart y v] to [4]\n    show\n    repeat (8)\n        change y by (Fart Y)\n        change [fart y v] by (-0.5)\n    end\n    wait until <key (space v) pressed?>\n    start sound [Nästa meddelande v]\nend\nhide\nbroadcast (Boss 2: Start v)\n\nwhen I receive [boss 3: intro v]\nstart sound [Sports et divertissements_ La pieuvre v]\nswitch costume to (blank2 v)\nwait (1) seconds\nstart sound [Nästa meddelande v]\nrepeat (8)\n    next costume\n    go to (klamp v)\n    change y by (25)\n    set [fart y v] to [4]\n    show\n    repeat (8)\n        change y by (Fart Y)\n        change [fart y v] by (-0.5)\n    end\n    wait until <key (space v) pressed?>\n    start sound [Nästa meddelande v]\nend\nhide\nbroadcast (Boss 3: Start v)\n\nwhen I receive [boss 4: intro v]\nstart sound [Sports et divertissements_ La pieuvre v]\nswitch costume to (blank3 v)\nstart sound [Nästa meddelande v]\nrepeat (8)\n    next costume\n    go to (klamp v)\n    change y by (25)\n    set [fart y v] to [4]\n    show\n    repeat (8)\n        change y by (Fart Y)\n        change [fart y v] by (-0.5)\n    end\n    wait until <key (space v) pressed?>\n    start sound [Nästa meddelande v]\nend\nhide\nbroadcast (Boss 4: Start v)\n\nwhen I receive [klamp kidnappar v]\nswitch costume to (första v)\nrepeat (2)\n    start sound [Nästa meddelande v]\n    next costume\n    go to (klamp v)\n    change y by (25)\n    set [fart y v] to [4]\n    show\n    repeat (8)\n        change y by (Fart Y)\n        change [fart y v] by (-0.5)\n    end\n    wait until <key (space v) pressed?>\nend\nhide\nbroadcast (BB: Blir kidnappad v)\n\nwhen I receive [boss 1: intro v]\nstart sound [Sports et divertissements_ La pieuvre v]\nswitch costume to (ex.3 v)\nwait (1) seconds\nstart sound [Nästa meddelande v]\nrepeat (8)\n    next costume\n    go to (klamp v)\n    change y by (25)\n    set [fart y v] to [4]\n    show\n    repeat (8)\n        change y by (Fart Y)\n        change [fart y v] by (-0.5)\n    end\n    wait until <key (space v) pressed?>\n    start sound [Nästa meddelande v]\nend\nhide\nbroadcast (Boss 1: Start v)\n\n@Pandafaffa: Pratbubbla\n\nwhen flag clicked\nset [antal pratbubblor v] to [8]\nhide\n\nwhen I receive [pandafaffa-prat v]\nif <(Värld) = [1]> then\n    if <(Bana) = [10]> then\n        set [antal pratbubblor v] to [9]\n        switch costume to (mitt #1 v)\n    end\nend\nif <(Värld) = [2]> then\n    if <(Bana) = [10]> then\n        set [antal pratbubblor v] to [7]\n        switch costume to (mitt #2 v)\n    end\nend\nif <(Värld) = [3]> then\n    if <(Bana) = [10]> then\n        set [antal pratbubblor v] to [10]\n        switch costume to (mitt #3 v)\n    end\nend\nif <(Värld) = [4]> then\n    if <(Bana) = [10]> then\n        set [antal pratbubblor v] to [5]\n        switch costume to (mitt #4 v)\n    end\nend\nwait (0.2) seconds\nstart sound [Nästa meddelande v]\nrepeat (Antal pratbubblor)\n    next costume\n    set [fart y v] to [4]\n    go to (pandafaffa v)\n    change y by (24)\n    show\n    repeat (8)\n        change y by (Fart Y)\n        change [fart y v] by (-0.5)\n    end\n    wait until <key (space v) pressed?>\n    start sound [Nästa meddelande v]\nend\nset [pratbubbla igång v] to [0]\nhide\n\nwhen I receive [björne vill rädda v]\nswitch costume to (ex.2 v)\nstart sound [Nästa meddelande v]\nrepeat (1)\n    next costume\n    set [fart y v] to [4]\n    go to (spelare v)\n    change y by (24)\n    show\n    repeat (8)\n        change y by (Fart Y)\n        change [fart y v] by (-0.5)\n    end\n    wait until <key (space v) pressed?>\nend\nset [pratbubbla igång v] to [0]\nhide\nbroadcast (Klamp flyr v)\n\nwhen I receive [pandafaffa hjälper till v]\nset [antal pratbubblor v] to [6]\nswitch costume to (mitt någonstans v)\nwait (0.2) seconds\nstart sound [Nästa meddelande v]\nrepeat (Antal pratbubblor)\n    next costume\n    set [fart y v] to [4]\n    go to (pandafaffa v)\n    change y by (24)\n    show\n    repeat (8)\n        change y by (Fart Y)\n        change [fart y v] by (-0.5)\n    end\n    wait until <key (space v) pressed?>\n    start sound [Nästa meddelande v]\nend\nset [pratbubbla igång v] to [0]\nhide\n\n@Boss: Pratbubbla\n\nwhen flag clicked\nhide\n\nwhen I receive [boss 1: död v]\nwait (1) seconds\nswitch costume to (snigelboss v)\nif <(Boss) = [1]> then\n    go to (snigelboss v)\n    change y by (-4)\nend\nset [fart y v] to [4]\nstart sound [Nästa meddelande v]\nshow\nrepeat (8)\n    change y by (Fart Y)\n    change [fart y v] by (-0.5)\nend\nwait until <key (space v) pressed?>\nset [pratbubbla igång v] to [0]\nhide\n\nwhen I receive [nästa bana v]\nset [boss v] to (Värld)\nset [boss igång v] to [0]\n\nwhen I receive [boss 2: död v]\nwait (1) seconds\nswitch costume to (cactupillar v)\nif <(Boss) = [2]> then\n    go to (cactupiller v)\n    change y by (70)\nend\nset [fart y v] to [4]\nstart sound [Nästa meddelande v]\nshow\nrepeat (8)\n    change y by (Fart Y)\n    change [fart y v] by (-0.5)\nend\nwait until <key (space v) pressed?>\nset [pratbubbla igång v] to [0]\nhide\n\nwhen I receive [boss 3: död v]\nwait (1) seconds\nswitch costume to (bläckfisk v)\nif <(Boss) = [3]> then\n    go to (bläckfisk v)\n    change y by (-53)\nend\nset [fart y v] to [4]\nstart sound [Nästa meddelande v]\nshow\nrepeat (8)\n    change y by (Fart Y)\n    change [fart y v] by (-0.5)\nend\nwait until <key (space v) pressed?>\nset [pratbubbla igång v] to [0]\nhide\n\nwhen I receive [boss 4: död v]\nwait (1) seconds\nswitch costume to (klamp v)\nif <(Boss) = [4]> then\n    go to (klamp v)\n    change y by (16)\nend\nset [fart y v] to [4]\nstart sound [Nästa meddelande v]\nshow\nrepeat (8)\n    change y by (Fart Y)\n    change [fart y v] by (-0.5)\nend\nwait until <key (space v) pressed?>\nset [pratbubbla igång v] to [0]\nhide\n\n@Bunny Blue: Pratbubbla\n\nwhen flag clicked\nhide\n\nwhen I receive [ta nyckeln! v]\nswitch costume to (ta nyckeln #1 v)\nwait (1) seconds\nstart sound [Nästa meddelande v]\nrepeat (1)\n    go to (bur v)\n    change y by (-115)\n    change x by (4)\n    set [fart y v] to [4]\n    show\n    repeat (8)\n        change y by (Fart Y)\n        change [fart y v] by (-0.5)\n    end\n    wait until <key (space v) pressed?>\nend\nhide\nset [story-läge v] to [0]\nbroadcast (Stoy-läge avslutat v)\nbroadcast (KAN ta nyckeln v)\n\nwhen I receive [bb: tack björne! v]\nswitch costume to (ta nyckeln #1 v)\nwait (1) seconds\nstart sound [Nästa meddelande v]\nrepeat (5)\n    go to (bunny blue v)\n    change y by (25)\n    set [fart y v] to [4]\n    next costume\n    show\n    repeat (8)\n        change y by (Fart Y)\n        change [fart y v] by (-0.5)\n    end\n    wait until <key (space v) pressed?>\n    start sound [Nästa meddelande v]\nend\nhide\nbroadcast (BB: Pandafaffa vill hem v)\n\nwhen I receive [bb: blir kidnappad v]\nswitch costume to (kidnappning #1 v)\nstart sound [Nästa meddelande v]\nrepeat (1)\n    go to (säck v)\n    change y by (3)\n    change x by (-20)\n    set [fart y v] to [4]\n    show\n    repeat (8)\n        change y by (Fart Y)\n        change [fart y v] by (-0.5)\n    end\n    wait until <key (space v) pressed?>\nend\nhide\nbroadcast (Björne vill rädda v)\n\nwhen I receive [boss 4: mötet v]\nswitch costume to (mötet #1 v)\nwait (1) seconds\nstart sound [Nästa meddelande v]\nrepeat (1)\n    go to (bur v)\n    change y by (-115)\n    change x by (4)\n    set [fart y v] to [4]\n    show\n    repeat (8)\n        change y by (Fart Y)\n        change [fart y v] by (-0.5)\n    end\n    wait until <key (space v) pressed?>\nend\nhide\nbroadcast (Boss 4: intro v)\n\n@Giftsnigel #1\n\nwhen flag clicked\nhide\nswitch costume to (klädsel5 v)\nset rotation style [left-right v]\n\nwhen I receive [nästa bana v]\nhide\npoint in direction (-90)\nif <(Värld) = [1]> then\n    if <(Bana) = [2]> then\n        go to x: (116) y: (-66)\n        switch costume to (klädsel5 v)\n        show\n        Snigel\n    end\n    if <(Bana) = [4]> then\n        go to x: (92) y: (-39)\n        switch costume to (klädsel5 v)\n        show\n        Snigel\n    end\n    if <(Bana) = [5]> then\n        go to x: (82) y: (-102)\n        switch costume to (klädsel5 v)\n        show\n        Snigel\n    end\n    if <(Bana) = [6]> then\n        go to x: (-97) y: (-80)\n        switch costume to (klädsel5 v)\n        show\n        Snigel\n    end\n    if <(Bana) = [8]> then\n        go to x: (-47) y: (-32)\n        switch costume to (klädsel5 v)\n        show\n        Snigel\n    end\nend\n\ndefine Rörelse\nif <(costume [number v]) = [12]> then\n    switch costume to (upprätt v)\nend\nwait (0.01) seconds\nnext costume\n\ndefine Fixa övertramp\nrepeat until <not <touching (bana v)?>>\n    change y by (1)\nend\nset [snigel y v] to [0]\n\nwhen I receive [nästa bana v]\nwait (0.02) seconds\nif <(Värld) = [1]> then\n    if <<<(Bana) = [2]> or <<<(Bana) = [4]> or <(Bana) = [5]>> or <(Bana) = [6]>>> or <(Bana) = [8]>> then\n        set [snigel y v] to [0]\n        forever\n            change [snigel y v] by (-1)\n            change y by (Snigel Y)\n            if <touching (bana v)?> then\n                Fixa övertramp\n            end\n        end\n    end\nend\nstop [this script v]\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <([x position v] of [spelare v]) < (x position)> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <([x position v] of [spelare v]) > (x position)> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\ndefine Snigel\nwait until <<(distance to [spelare v]) < [150]> and <<<([direction v] of [spelare v]) = [-90]> and <([x position v] of [spelare v]) < ((x position) - (15))>> or <<([direction v] of [spelare v]) = [90]> and <([x position v] of [spelare v]) > ((x position) + (15))>>>>\nset [igång? v] to [1]\npoint towards (spelare v)\nrepeat (4)\n    next costume\n    wait (0.01) seconds\nend\nrepeat until <(Igång?) = [0]>\n    if <<([direction v] of [spelare v]) = [-90]> and <([x position v] of [spelare v]) < ((x position) - (15))>> then\n        point towards (spelare v)\n        change x by (-1)\n        Rörelse\n    else\n        if <<([direction v] of [spelare v]) = [90]> and <([x position v] of [spelare v]) > ((x position) + (15))>> then\n            point towards (spelare v)\n            change x by (1)\n            Rörelse\n        else\n            set [igång? v] to [0]\n        end\n    end\nend\nswitch costume to (upprätt v)\nrepeat (4)\n    switch costume to ((costume [number v]) - (1))\n    wait (0.01) seconds\nend\nSnigel\n\n@Giftsnigel #2\n\nwhen flag clicked\nhide\nswitch costume to (klädsel5 v)\nset rotation style [left-right v]\n\nwhen I receive [nästa bana v]\nhide\npoint in direction (-90)\nif <(Värld) = [1]> then\n    if <(Bana) = [5]> then\n        go to x: (189) y: (-103)\n        switch costume to (klädsel5 v)\n        show\n        Snigel\n    end\n    if <(Bana) = [8]> then\n        go to x: (119) y: (-79)\n        switch costume to (klädsel5 v)\n        show\n        Snigel\n    end\nend\n\ndefine Rörelse\nif <(costume [number v]) = [12]> then\n    switch costume to (upprätt v)\nend\nwait (0.01) seconds\nnext costume\n\ndefine Fixa övertramp\nrepeat until <not <touching (bana v)?>>\n    change y by (1)\nend\nset [snigel y v] to [0]\n\nwhen I receive [nästa bana v]\nwait (0.02) seconds\nif <(Värld) = [1]> then\n    if <<(Bana) = [5]> or <(Bana) = [8]>> then\n        set [snigel y v] to [0]\n        forever\n            change [snigel y v] by (-1)\n            change y by (Snigel Y)\n            if <touching (bana v)?> then\n                Fixa övertramp\n            end\n        end\n    end\nend\nstop [this script v]\n\ndefine Snigel\nwait until <<(distance to [spelare v]) < [150]> and <<<([direction v] of [spelare v]) = [-90]> and <([x position v] of [spelare v]) < ((x position) - (15))>> or <<([direction v] of [spelare v]) = [90]> and <([x position v] of [spelare v]) > ((x position) + (15))>>>>\nset [igång? v] to [1]\npoint towards (spelare v)\nrepeat (4)\n    next costume\n    wait (0.01) seconds\nend\nrepeat until <(Igång?) = [0]>\n    if <<([direction v] of [spelare v]) = [-90]> and <([x position v] of [spelare v]) < ((x position) - (15))>> then\n        point towards (spelare v)\n        change x by (-1)\n        Rörelse\n    else\n        if <<([direction v] of [spelare v]) = [90]> and <([x position v] of [spelare v]) > ((x position) + (15))>> then\n            point towards (spelare v)\n            change x by (1)\n            Rörelse\n        else\n            set [igång? v] to [0]\n        end\n    end\nend\nswitch costume to (upprätt v)\nrepeat (4)\n    switch costume to ((costume [number v]) - (1))\n    wait (0.01) seconds\nend\nSnigel\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <([x position v] of [spelare v]) < (x position)> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <([x position v] of [spelare v]) > (x position)> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\n@Taggväxt #1\n\nwhen I receive [nästa bana v]\nhide\nswitch costume to (klädsel6 v)\nif <(Värld) = [1]> then\n    if <(Bana) = [3]> then\n        forever\n            go to x: (38) y: (-120)\n            switch costume to (klädsel6 v)\n            show\n            if <(DÖD?) = [0]> then\n                wait until <<<<([x position v] of [spelare v]) > [-92]> and <([x position v] of [spelare v]) < [38]>> and <([hastighet x v] of [spelare v]) > [1]>> or <<<([x position v] of [spelare v]) < [168]> and <([x position v] of [spelare v]) > [38]>> and <([hastighet x v] of [spelare v]) < [-1]>>>\n                start sound [Roten ur marken v]\n                wait (0.3) seconds\n                repeat (8)\n                    change y by (20)\n                    next costume\n                end\n                wait (1) seconds\n                start sound [Roten ur marken2 v]\n                repeat (20)\n                    change y by (-8)\n                    next costume\n                end\n                wait (1) seconds\n            end\n        end\n    end\n    if <(Bana) = [4]> then\n        forever\n            go to x: (-91) y: (-147)\n            switch costume to (klädsel5 v)\n            show\n            if <(DÖD?) = [0]> then\n                wait until <<<<([x position v] of [spelare v]) > [-221]> and <([x position v] of [spelare v]) < [-91]>> and <([hastighet x v] of [spelare v]) > [1]>> or <<<([x position v] of [spelare v]) < [39]> and <([x position v] of [spelare v]) > [-91]>> and <([hastighet x v] of [spelare v]) < [-1]>>>\n                start sound [Roten ur marken v]\n                wait (0.3) seconds\n                repeat (9)\n                    change y by (20)\n                    next costume\n                end\n                wait (1) seconds\n                start sound [Roten ur marken2 v]\n                repeat (20)\n                    change y by (-9)\n                    next costume\n                end\n                wait (1) seconds\n            end\n        end\n    end\n    if <(Bana) = [6]> then\n        forever\n            go to x: (99) y: (-96)\n            switch costume to (klädsel4 v)\n            show\n            if <(DÖD?) = [0]> then\n                wait until <<<<([x position v] of [spelare v]) > [-31]> and <([x position v] of [spelare v]) < [99]>> and <([hastighet x v] of [spelare v]) > [1]>> or <<<([x position v] of [spelare v]) < [229]> and <([x position v] of [spelare v]) > [99]>> and <([hastighet x v] of [spelare v]) < [-1]>>>\n                start sound [Roten ur marken v]\n                wait (0.3) seconds\n                repeat (7)\n                    change y by (24)\n                    next costume\n                end\n                wait (1) seconds\n                start sound [Roten ur marken2 v]\n                repeat (24)\n                    change y by (-7)\n                    next costume\n                end\n                wait (1) seconds\n            end\n        end\n    end\n    if <(Bana) = [7]> then\n        forever\n            go to x: (-80) y: (-161)\n            switch costume to (klädsel4 v)\n            show\n            if <(DÖD?) = [0]> then\n                wait until <<<<([x position v] of [spelare v]) > [-210]> and <([x position v] of [spelare v]) < [-80]>> and <([hastighet x v] of [spelare v]) > [1]>> or <<<([x position v] of [spelare v]) < [50]> and <([x position v] of [spelare v]) > [-80]>> and <([hastighet x v] of [spelare v]) < [-1]>>>\n                start sound [Roten ur marken v]\n                wait (0.3) seconds\n                repeat (5)\n                    change y by (24)\n                    next costume\n                end\n                wait (1) seconds\n                start sound [Roten ur marken2 v]\n                repeat (15)\n                    change y by (-8)\n                    next costume\n                end\n                wait (1) seconds\n            end\n        end\n    end\n    if <(Bana) = [8]> then\n        forever\n            go to x: (15) y: (-80)\n            switch costume to (klädsel2 v)\n            show\n            if <(DÖD?) = [0]> then\n                wait until <<<<([x position v] of [spelare v]) > [-115]> and <([x position v] of [spelare v]) < [15]>> and <([hastighet x v] of [spelare v]) > [1]>> or <<<([x position v] of [spelare v]) < [145]> and <([x position v] of [spelare v]) > [15]>> and <([hastighet x v] of [spelare v]) < [-1]>>>\n                start sound [Roten ur marken v]\n                wait (0.3) seconds\n                repeat (7)\n                    change y by (24)\n                    next costume\n                end\n                wait (1) seconds\n                start sound [Roten ur marken2 v]\n                repeat (24)\n                    change y by (-7)\n                    next costume\n                end\n                wait (1) seconds\n            end\n        end\n    end\n    stop [this script v]\nend\n\nwhen flag clicked\ngo to x: (45) y: (-130)\nhide\nswitch costume to (klädsel1 v)\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <([x position v] of [spelare v]) < (x position)> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <([x position v] of [spelare v]) > (x position)> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\n@Taggväxt #2\n\nwhen I receive [nästa bana v]\nhide\nif <(Värld) = [1]> then\n    if <(Bana) = [7]> then\n        forever\n            go to x: (71) y: (-115)\n            switch costume to (klädsel6 v)\n            show\n            if <(DÖD?) = [0]> then\n                wait until <<<<([x position v] of [spelare v]) > [-59]> and <([x position v] of [spelare v]) < [71]>> and <([hastighet x v] of [spelare v]) > [1]>> or <<<([x position v] of [spelare v]) < [201]> and <([x position v] of [spelare v]) > [71]>> and <([hastighet x v] of [spelare v]) < [-1]>>>\n                start sound [Roten ur marken v]\n                wait (0.3) seconds\n                repeat (8)\n                    change y by (20)\n                    next costume\n                end\n                wait (1) seconds\n                start sound [Roten ur marken2 v]\n                repeat (20)\n                    change y by (-8)\n                    next costume\n                end\n                wait (1) seconds\n            end\n        end\n    end\nend\nstop [this script v]\n\nwhen flag clicked\ngo to x: (71) y: (-115)\nswitch costume to (klädsel1 v)\nhide\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <([x position v] of [spelare v]) < (x position)> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <([x position v] of [spelare v]) > (x position)> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\n@Snigelboss\n\ndefine Fixa övertramp\nrepeat until <not <touching (bana v)?>>\n    change y by (1)\nend\n\nwhen I receive [boss 1: start v]\nset [bossliv v] to [5]\nset [rör vid bana? v] to [1]\nset [boss igång v] to [1]\nwait (0.8) seconds\ngo to x: (-249) y: (-70)\npoint in direction (90)\nswitch costume to (spring #4 v)\nshow\nrepeat (60)\n    move (3) steps\n    next costume\n    if <(costume [number v]) = [10]> then\n        switch costume to (spring #1 v)\n    end\nend\nwait (1) seconds\nset [story-läge v] to [0]\nbroadcast (Stoy-läge avslutat v)\nswitch costume to (spring #1 v)\nforever\n    set [attack-form? v] to (pick random (1) to (2))\n    if <(Attack-form?) = [1]> then\n        wait (1) seconds\n        if <([x position v] of [spelare v]) > (x position)> then\n            point in direction (90)\n        end\n        if <([x position v] of [spelare v]) < (x position)> then\n            point in direction (-90)\n        end\n        repeat until <(distance to [spelare v]) < [95]>\n            move (3) steps\n            if on edge, bounce\n            next costume\n            if <(costume [number v]) = [10]> then\n                switch costume to (spring #1 v)\n            end\n        end\n        broadcast (Snigelboss: Hopp v)\n        wait (0.3) seconds\n        set [fart y v] to (pick random (17) to (20))\n        set [fart x v] to ((Fart Y) / (5.5))\n        repeat until <<(Rör vid bana?) = [1]> and <<(Fart Y) < [0]> or <(Fart Y) = [0]>>>\n            if on edge, bounce\n            move (Fart X) steps\n        end\n        broadcast (Jordbävning v)\n        start sound [Träff mot marken/väggen v]\n    end\n    if <(Attack-form?) = [2]> then\n        wait (1) seconds\n        if <([x position v] of [spelare v]) > (x position)> then\n            point in direction (90)\n        end\n        if <([x position v] of [spelare v]) < (x position)> then\n            point in direction (-90)\n        end\n        wait (0.5) seconds\n        repeat (15)\n            move (-1.5) steps\n            if on edge, bounce\n            next costume\n            if <(costume [number v]) = [10]> then\n                switch costume to (spring #1 v)\n            end\n        end\n        set [fart y v] to [3]\n        repeat until <touching (_edge_ v)?>\n            move (9) steps\n            next costume\n            if <(costume [number v]) = [10]> then\n                switch costume to (spring #1 v)\n            end\n        end\n        broadcast (Boss 1: Slag mot kant v)\n        broadcast (Jordbävning v)\n        start sound [Träff mot marken/väggen v]\n        if <(x position) < [0]> then\n            point in direction (90)\n        end\n        if <(x position) > [0]> then\n            point in direction (-90)\n        end\n        set [fart y v] to [4]\n        set [fart x v] to [4]\n        repeat until <<(Rör vid bana?) = [1]> and <<(Fart Y) < [0]> or <(Fart Y) = [0]>>>\n            if on edge, bounce\n            move (Fart X) steps\n        end\n        wait (1.5) seconds\n        repeat (7)\n            switch costume to ((costume [number v]) - (1))\n            wait (0.01) seconds\n        end\n        switch costume to (spring #1 v)\n    end\nend\n\nwhen flag clicked\nhide\nset [boss igång v] to [0]\nset [rör vid bana? v] to [1]\nset [bossliv v] to [5]\n\nwhen I receive [boss 1: start v]\nwait (0.5) seconds\nrepeat until <(Boss igång) = [0]>\n    set [fart y v] to [0]\n    forever\n        change [fart y v] by (-1)\n        change y by (Fart Y)\n        if <touching (bana v)?> then\n            Fixa övertramp\n            set [rör vid bana? v] to [1]\n        else\n            set [rör vid bana? v] to [0]\n        end\n    end\nend\n\nwhen I receive [snigelboss: hopp v]\nswitch costume to (hopp #1 v)\nrepeat (7)\n    next costume\nend\nrepeat (11)\n    switch costume to ((costume [number v]) - (1))\nend\n\nwhen I receive [boss 1: död v]\nset [pratbubbla igång v] to [1]\nif <(costume [number v]) > [11]> then\n    repeat until <(costume [number v]) = [19]>\n        next costume\n    end\nelse\n    switch costume to (hopp #1 v)\n    repeat (8)\n        next costume\n    end\nend\nwait until <(Pratbubbla igång) = [0]>\nset [boss igång v] to [0]\nstop [other scripts in sprite v]\nwait (0.5) seconds\nrepeat until <(costume [number v]) = [34]>\n    next costume\nend\nhide\nbroadcast (Boss: Slut v)\n\nwhen I receive [boss 1: slag mot kant v]\nstart sound [Slag mot metall v]\nstart sound [Wobble v]\nswitch costume to (hopp #1 v)\nrepeat (7)\n    next costume\nend\n\nwhen I receive [boss 1: död v]\nrepeat until <(Boss igång) = [0]>\n    set [fart y v] to [0]\n    forever\n        change [fart y v] by (-1)\n        change y by (Fart Y)\n        if <touching (bana v)?> then\n            Fixa övertramp\n            set [rör vid bana? v] to [1]\n        else\n            set [rör vid bana? v] to [0]\n        end\n    end\nend\n\nwhen I receive [boss 1: död v]\nwait until <(costume [number v]) = [19]>\nrepeat until <(Boss igång) = [0]>\n    next costume\n    wait (0.01) seconds\n    if <(costume [number v]) = [21]> then\n        switch costume to (hopp #5 v)\n    end\nend\n\nwhen I receive [boss: skadad v]\nif <(Värld) = [1]> then\n    if <(Bossliv) > [1]> then\n        change [bossliv v] by (-1)\n        broadcast (Visa bosshjärtan v)\n        set [ghost v] effect to (20)\n        wait (1.5) seconds\n        set [ghost v] effect to (0)\n        set [skadeläge v] to [0]\n    else\n        set [story-läge v] to [1]\n        stop [other scripts in sprite v]\n        broadcast (Boss 1: Död v)\n        broadcast (Story-läge v)\n    end\nend\n\nwhen I receive [boss 1: start v]\nforever\n    if <(Skadeläge) = [0]> then\n        if <<<touching (spelare v)?> and <([faller v] of [spelare v]) > [5]>> and <([y position v] of [spelare v]) > (y position)>> then\n            if <([x position v] of [spelare v]) < (x position)> then\n                start sound [Slag v]\n                set [skadeläge v] to [11]\n                broadcast (Boss: Skadad v)\n            end\n            if <([x position v] of [spelare v]) > (x position)> then\n                start sound [Slag v]\n                set [skadeläge v] to [12]\n                broadcast (Boss: Skadad v)\n            end\n        end\n        if <<touching (spelare v)?> and <not <<([faller v] of [spelare v]) > [5]> and <([y position v] of [spelare v]) > (y position)>>>> then\n            if <([x position v] of [spelare v]) < (x position)> then\n                set [skadeläge v] to [11]\n                broadcast (Skada v)\n            end\n            if <([x position v] of [spelare v]) > (x position)> then\n                set [skadeläge v] to [12]\n                broadcast (Skada v)\n            end\n        end\n    end\nend\n\nwhen I receive [continue-button v]\nstop [other scripts in sprite v]\nhide\n\n@Aracet\n\nwhen flag clicked\nhide\nswitch costume to (still v)\ngo to x: (17) y: (-45)\n\nwhen I receive [nästa bana v]\nhide\nif <(Värld) = [2]> then\n    if <(Bana) = [2]> then\n        go to x: (17) y: (-45)\n    end\n    if <(Bana) = [3]> then\n        go to x: (104) y: (-61)\n    end\n    if <(Bana) = [5]> then\n        go to x: (-37) y: (-27)\n    end\n    if <(Bana) = [8]> then\n        go to x: (7) y: (-56)\n    end\n    if <<<(Bana) = [2]> or <(Bana) = [3]>> or <<(Bana) = [5]> or <(Bana) = [8]>>> then\n        switch costume to (still v)\n        show\n        set [fart y v] to [20]\n        forever\n            wait until <<([faller v] of [spelare v]) > [1]> and <([hastighet y v] of [spelare v]) > [0]>>\n            repeat (4)\n                next costume\n                wait (0.01) seconds\n            end\n            set [fart y v] to [20]\n            wait (0.1) seconds\n            repeat (4)\n                switch costume to ((costume [number v]) - (1))\n            end\n            broadcast (Spindelhopp v)\n            start sound [Hop v]\n            repeat until <(Fart Y) < [-19]>\n                change [fart y v] by (-1)\n                change y by (Fart Y)\n                Ut ur marken\n            end\n        end\n    end\nend\nstop [this script v]\n\ndefine Ut ur marken\nrepeat until <not <touching (bana v)?>>\n    change y by (1)\nend\n\nwhen I receive [spindelhopp v]\nswitch costume to (hopp #1 v)\nrepeat (2)\n    next costume\n    wait (0.01) seconds\nend\nswitch costume to (hopp #3 v)\nwait (0.88) seconds\nrepeat (2)\n    switch costume to ((costume [number v]) - (1))\n    wait (0.01) seconds\nend\nswitch costume to (still v)\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <([x position v] of [spelare v]) < (x position)> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <([x position v] of [spelare v]) > (x position)> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\n@Sandstorm\n\nwhen I receive [nästa bana v]\nif <(Värld) = [2]> then\n    set [sandstorm? v] to [0]\n    repeat until <(Genomskinlighet) > [97]>\n        change [genomskinlighet v] by (2)\n        change [ghost v] effect by (2)\n        switch costume to (pick random (1) to (8))\n    end\n    set [genomskinlighet v] to [100]\n    set [ghost v] effect to (100)\n    hide\n    if <(Bana) = [3]> then\n        wait until <([x position v] of [spelare v]) > [-140]>\n        go to x: (0) y: (0)\n        set volume to (0) %\n        start sound [565015__blackatomproductions__sandstormmix v]\n        show\n        set [sandstorm? v] to [2]\n        set [genomskinlighet v] to [100]\n        repeat (50)\n            change volume by (0.5)\n            change [genomskinlighet v] by (-1)\n            change [ghost v] effect by (-1)\n            switch costume to (pick random (1) to (8))\n        end\n        set [genomskinlighet v] to [50]\n        forever\n            Sandstorm\n        end\n    end\n    if <(Bana) = [7]> then\n        wait until <([x position v] of [spelare v]) > [-200]>\n        go to x: (0) y: (0)\n        set volume to (0) %\n        start sound [565015__blackatomproductions__sandstormmix v]\n        show\n        set [sandstorm? v] to [2]\n        repeat (50)\n            change volume by (0.5)\n            change [ghost v] effect by (-1)\n            switch costume to (pick random (1) to (8))\n        end\n        set [genomskinlighet v] to [50]\n        forever\n            Sandstorm\n        end\n    end\n    if <(Bana) = [8]> then\n        wait until <([x position v] of [spelare v]) > [-185]>\n        go to x: (0) y: (0)\n        show\n        set volume to (0) %\n        start sound [565015__blackatomproductions__sandstormmix v]\n        set [sandstorm? v] to [2]\n        repeat (50)\n            change volume by (0.5)\n            change [ghost v] effect by (-1)\n            switch costume to (pick random (1) to (8))\n        end\n        set [genomskinlighet v] to [50]\n        forever\n            Sandstorm\n        end\n    end\nend\nstop [this script v]\n\nwhen flag clicked\nhide\nset [ghost v] effect to (100)\nset [sandstorm? v] to [0]\ngo to x: (0) y: (0)\n\ndefine Sandstorm\nif <(Genomskinlighet) < [40]> then\n    set [intensitet v] to (pick random (1) to (2))\nend\nif <(Genomskinlighet) > [60]> then\n    set [intensitet v] to (pick random (-1) to (-3))\nend\nchange [ghost v] effect by (Intensitet)\nchange [genomskinlighet v] by (Intensitet)\nswitch costume to (pick random (1) to (8))\n\nwhen I receive [nästa bana v]\nrepeat until <(volume) < [3]>\n    change volume by (-2)\nend\nset volume to (0) %\n\nwhen I receive [continue-button v]\nstop [other scripts in sprite v]\nhide\nset [ghost v] effect to (100)\nset [sandstorm? v] to [0]\ngo to x: (0) y: (0)\n\n@Vulture\n\nwhen flag clicked\ngo to x: (100) y: (-116)\nhide\n\nwhen I receive [nästa bana v]\nhide\nif <(Värld) = [2]> then\n    if <(Bana) = [4]> then\n        go to x: (110) y: (-116)\n        set [y-fart v] to [2]\n        switch costume to (normal v)\n        show\n    end\n    if <(Bana) = [5]> then\n        go to x: (67) y: (-123)\n        set [y-fart v] to [2]\n        switch costume to (normal v)\n        show\n    end\n    if <(Bana) = [7]> then\n        go to x: (-19) y: (-126)\n        set [y-fart v] to [2]\n        switch costume to (normal v)\n        show\n    end\n    if <<(Bana) = [4]> or <<(Bana) = [5]> or <(Bana) = [7]>>> then\n        forever\n            repeat until <(y position) > [30]>\n                change y by (Y-Fart)\n                next costume\n                if <(costume [number v]) = [5]> then\n                    start sound [Flapping Wings - Sound Effect2 v]\n                end\n            end\n            repeat (4)\n                change [y-fart v] by (-0.5)\n                change y by (Y-Fart)\n                next costume\n                if <(costume [number v]) = [5]> then\n                    start sound [Flapping Wings - Sound Effect2 v]\n                end\n            end\n            repeat (50)\n                next costume\n                if <(costume [number v]) = [5]> then\n                    start sound [Flapping Wings - Sound Effect2 v]\n                end\n            end\n            repeat (4)\n                change [y-fart v] by (-0.5)\n                change y by (Y-Fart)\n                next costume\n                if <(costume [number v]) = [5]> then\n                    start sound [Flapping Wings - Sound Effect2 v]\n                end\n            end\n            repeat until <(y position) < [-116]>\n                change y by (Y-Fart)\n                next costume\n                if <(costume [number v]) = [5]> then\n                    start sound [Flapping Wings - Sound Effect2 v]\n                end\n            end\n            repeat (4)\n                change [y-fart v] by (0.5)\n                change y by (Y-Fart)\n                next costume\n                if <(costume [number v]) = [5]> then\n                    start sound [Flapping Wings - Sound Effect2 v]\n                end\n            end\n            repeat (50)\n                next costume\n                if <(costume [number v]) = [5]> then\n                    start sound [Flapping Wings - Sound Effect2 v]\n                end\n            end\n            repeat (4)\n                change [y-fart v] by (0.5)\n                change y by (Y-Fart)\n                next costume\n                if <(costume [number v]) = [5]> then\n                    start sound [Flapping Wings - Sound Effect2 v]\n                end\n            end\n        end\n    end\n    stop [other scripts in sprite v]\n    stop [this script v]\nend\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <([x position v] of [spelare v]) < (x position)> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <([x position v] of [spelare v]) > (x position)> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\n@Blomma\n\nwhen flag clicked\ngo to x: (85) y: (-11)\nhide\n\nwhen I receive [nästa bana v]\nhide\nif <(Värld) = [2]> then\n    if <(Bana) = [6]> then\n        set [projektil igång? v] to [0]\n        go to x: (85) y: (-11)\n        switch costume to (still v)\n        show\n    end\n    if <(Bana) = [7]> then\n        set [projektil igång? v] to [0]\n        go to x: (182) y: (-40)\n        switch costume to (still v)\n        show\n    end\n    if <(Bana) = [8]> then\n        set [projektil igång? v] to [0]\n        go to x: (161) y: (-44)\n        switch costume to (still v)\n        show\n    end\n    if <<<(Bana) = [6]> or <(Bana) = [7]>> or <(Bana) = [8]>> then\n        forever\n            wait (1.5) seconds\n            if <(DÖD?) = [0]> then\n                wait until <([x position v] of [spelare v]) < (x position)>\n                wait until <(Projektil igång?) = [0]>\n                set [projektil igång? v] to [1]\n                repeat (4)\n                    next costume\n                    wait (0.01) seconds\n                end\n                wait (1) seconds\n                broadcast (Blomma: Projektil v)\n                repeat (6)\n                    switch costume to ((costume [number v]) - (1))\n                end\n                repeat (2)\n                    next costume\n                    wait (0.01) seconds\n                end\n                switch costume to (still v)\n            end\n        end\n    end\nend\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <([x position v] of [spelare v]) < (x position)> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <([x position v] of [spelare v]) > (x position)> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\n@Blomma: Projektil\n\nwhen flag clicked\nhide\nset [projektil igång? v] to [0]\n\nwhen I receive [blomma: projektil v]\npoint in direction (-45)\nset x to (([x position v] of [blomma v]) - (1))\nset y to (([y position v] of [blomma v]) + (3))\nset [gravitation v] to [9]\nset [kraft v] to [11]\nwait (0.07) seconds\nstart sound [Spott v]\nswitch costume to (klädsel2 v)\nshow\nrepeat until <touching (bana v)?>\n    if <(Sandstorm?) = [0]> then\n        turn left (15) degrees\n        change y by ((Gravitation) * (1.8))\n        change x by (join [-] (Kraft))\n        change [gravitation v] by (-1)\n    else\n        turn left (15) degrees\n        change y by ((Gravitation) * (1.8))\n        change x by (join [-] ((Kraft) * (0.5)))\n        change [gravitation v] by (-1)\n    end\nend\nstart sound [Landning v]\nnext costume\nwait (0.01) seconds\nhide\nset [projektil igång? v] to [0]\n\nwhen I receive [nästa bana v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <([x position v] of [spelare v]) < (x position)> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <([x position v] of [spelare v]) > (x position)> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\n@Cactupiller\n\nwhen I receive [boss 2: start v]\nset [bossliv v] to [5]\nset [hål ## v] to [1]\nset [förra hålet ## v] to [1]\nset [antal varv i marken v] to [1]\ngo to x: (-173) y: (-190)\npoint in direction (-90)\nswitch costume to (rakt v)\nshow\nset [boss igång v] to [1]\nwait (0.5) seconds\nrepeat (5)\n    change y by (8)\nend\nwait (0.5) seconds\nrepeat (5)\n    change y by (-8)\nend\nwait (0.5) seconds\nrepeat (5)\n    change y by (16)\nend\nrepeat (5)\n    change y by (16)\n    next costume\nend\nrepeat (4)\n    repeat (7)\n        next costume\n    end\n    repeat (7)\n        switch costume to ((costume [number v]) - (1))\n    end\nend\nset [story-läge v] to [0]\nbroadcast (Stoy-läge avslutat v)\nrepeat (5)\n    change y by (-16)\n    next costume\nend\nrepeat (5)\n    change y by (-16)\nend\nforever\n    repeat (Antal varv i marken)\n        wait (1) seconds\n        set [förra hålet ## v] to (Hål ##)\n        repeat until <<not <(Hål ##) = (Förra hålet ##)>> and <([abs v] of ((Förra hålet ##) - (Hål ##)) ) = [1]>>\n            set [hål ## v] to (pick random (1) to (3))\n        end\n        set [klar med ö-förflyttning? v] to [0]\n        broadcast (Larv: Mellan öarna v)\n        wait until <(Klar med ö-förflyttning?) = [1]>\n        set [förra hålet ## v] to (Hål ##)\n    end\n    start sound [Car Horn v]\n    if <(Hål ##) = [1]> then\n        wait (0.2) seconds\n    end\n    if <(Hål ##) = [2]> then\n        wait (0.5) seconds\n    end\n    if <(Hål ##) = [3]> then\n        wait (0.7) seconds\n    end\n    if <(Hål ##) = [1]> then\n        go to x: (-173) y: (-190)\n    end\n    if <(Hål ##) = [2]> then\n        go to x: (-7) y: (-144)\n    end\n    if <(Hål ##) = [3]> then\n        go to x: (184) y: (-83)\n    end\n    switch costume to (rakt v)\n    if <([x position v] of [spelare v]) > (x position)> then\n        point in direction (-90)\n    else\n        point in direction (90)\n    end\n    broadcast (Larv: Upp ur marken v)\n    if <(Special: Boss-skadeläge) = [0]> then\n        set [höjd v] to (pick random (4) to (5))\n        start sound [Gallop v]\n        repeat (Höjd)\n            change y by (16)\n        end\n        repeat (Höjd)\n            change y by (16)\n            next costume\n        end\n        repeat (35)\n            next costume\n            if <(costume [number v]) = [21]> then\n                switch costume to (rakt v)\n            end\n        end\n        switch costume to (rakt v)\n        broadcast (Larv: Ner i jorden v)\n        if <(Höjd) = [4]> then\n            wait (1.2) seconds\n        end\n        if <(Höjd) = [5]> then\n            wait (1.1) seconds\n        end\n        repeat ((Höjd) * (2))\n            change y by (-16)\n        end\n    end\nend\n\nwhen flag clicked\nset [hål ## v] to [3]\nset [förra hålet ## v] to [3]\nset [antal varv i marken v] to [1]\nset [special: boss-skadeläge v] to [0]\nhide\n\nwhen flag clicked\nswitch costume to (rakt v)\n\nwhen I receive [larv: ner i jorden v]\nset [böj-nummer # v] to [4]\nrepeat (4)\n    switch costume to (rakt v)\n    repeat (Böj-nummer #)\n        next costume\n    end\n    repeat (Böj-nummer #)\n        switch costume to ((costume [number v]) - (1))\n    end\n    switch costume to (böj #9 mitten v)\n    repeat (Böj-nummer #)\n        next costume\n    end\n    repeat (Böj-nummer #)\n        switch costume to ((costume [number v]) - (1))\n    end\n    change [böj-nummer # v] by (-1)\nend\n\nwhen I receive [boss 2: start v]\nforever\n    if <(Skadeläge) = [0]> then\n        if <<<touching (spelare v)?> and <([faller v] of [spelare v]) > [5]>> and <([y position v] of [spelare v]) > ((y position) + (70))>> then\n            if <([x position v] of [spelare v]) < (x position)> then\n                start sound [Träff v]\n                set [skadeläge v] to [11]\n                broadcast (Boss: Skadad v)\n            end\n            if <([x position v] of [spelare v]) > (x position)> then\n                start sound [Träff v]\n                set [skadeläge v] to [12]\n                broadcast (Boss: Skadad v)\n            end\n        end\n        if <<touching (spelare v)?> and <not <<([faller v] of [spelare v]) > [5]> and <([y position v] of [spelare v]) > ((y position) + (70))>>>> then\n            if <([x position v] of [spelare v]) < (x position)> then\n                set [skadeläge v] to [11]\n                broadcast (Skada v)\n            end\n            if <([x position v] of [spelare v]) > (x position)> then\n                set [skadeläge v] to [12]\n                broadcast (Skada v)\n            end\n        end\n    end\nend\n\nwhen I receive [boss: skadad v]\nif <(Värld) = [2]> then\n    if <(Bossliv) > [1]> then\n        set [special: boss-skadeläge v] to [1]\n        change [bossliv v] by (-1)\n        broadcast (Visa bosshjärtan v)\n        set [ghost v] effect to (20)\n        wait (1.5) seconds\n        set [ghost v] effect to (0)\n        set [skadeläge v] to [0]\n        set [special: boss-skadeläge v] to [0]\n    else\n        set [story-läge v] to [1]\n        stop [other scripts in sprite v]\n        broadcast (Boss 2: Död v)\n        broadcast (Story-läge v)\n    end\nend\n\nwhen I receive [boss: skadad v]\nif <(Värld) = [2]> then\n    if <(Bossliv) < [4]> then\n        change [antal varv i marken v] by (1)\n    end\nend\n\nwhen I receive [boss 2: död v]\nset [pratbubbla igång v] to [1]\nwait until <(Pratbubbla igång) = [0]>\nset [boss igång v] to [0]\nwait (0.5) seconds\nif <not <<(costume [number v]) = [1]> or <(costume [number v]) = [11]>>> then\n    repeat until <<(costume [number v]) = [1]> or <(costume [number v]) = [11]>>\n        switch costume to ((costume [number v]) - (1))\n        change y by (-16)\n    end\nend\nrepeat until <(y position) < [-220]>\n    change y by (-16)\nend\nhide\nwait (0.5) seconds\nbroadcast (Jordbävning v)\nbroadcast (Boss: Slut v)\n\nwhen I receive [continue-button v]\nstop [other scripts in sprite v]\nhide\n\n@Cactupiller kopia\n\nwhen I receive [larv: mellan öarna v]\nif <(Förra hålet ##) = [1]> then\n    go to x: (-200) y: (-135)\nend\nif <(Förra hålet ##) = [2]> then\n    go to x: (-7) y: (-145)\nend\nif <(Förra hålet ##) = [3]> then\n    go to x: (185) y: (-145)\nend\nif <(Hål ##) > (Förra hålet ##)> then\n    point in direction (90)\nelse\n    point in direction (-90)\nend\nshow\nchange y by (pick random (5) to (-20))\nset [klar med ö-förflyttning? v] to [1]\nbroadcast (Förläng larven v)\nstart sound [Mellan öarna v]\nrepeat (18)\n    move (16) steps\n    next costume\nend\nhide\n\nwhen flag clicked\nhide\ngo to x: (224) y: (-135)\nset rotation style [left-right v]\nset [klar med ö-förflyttning? v] to [1]\n\nwhen I receive [boss 2: start v]\nshow\ngo to x: (224) y: (-135)\npoint in direction (-90)\n\nwhen I receive [förläng larven v]\nwait (0.28) seconds\nmove (-96) steps\n\nwhen I receive [nästa bana v]\nhide\n\nwhen I receive [continue-button v]\nstop [other scripts in sprite v]\nhide\n\n@Vatten\n\nwhen I receive [nästa bana v]\nset [tidvatten? v] to [0]\nhide\nif <(Värld) = [3]> then\n    switch costume to (tropiskt v)\n    set [ghost v] effect to (20)\n    show\n    go to x: (0) y: (-173)\n    set [vågnivå v] to [0]\n    forever\n        repeat (Antal vågor)\n            repeat until <(Vågnivå) > [0.8]>\n                change y by (Vågnivå)\n                change [vågnivå v] by (0.05)\n            end\n            repeat until <(Vågnivå) < [-0.8]>\n                change y by (Vågnivå)\n                change [vågnivå v] by (-0.05)\n            end\n        end\n        if <<(Bana) = [3]> or <<(Bana) = [7]> or <(Bana) = [8]>>> then\n            Tidsvatten\n        end\n    end\nend\nif <(Värld) = [4]> then\n    switch costume to (grumligt v)\n    set [ghost v] effect to (20)\n    show\n    go to x: (0) y: (-145)\n    forever\n        repeat (Antal vågor)\n            repeat until <(Vågnivå) > [0.8]>\n                change y by (Vågnivå)\n                change [vågnivå v] by (0.05)\n            end\n            repeat until <(Vågnivå) < [-0.8]>\n                change y by (Vågnivå)\n                change [vågnivå v] by (-0.05)\n            end\n        end\n    end\nend\nstop [this script v]\n\nwhen flag clicked\nset [max y v] to [0]\nset [tidvatten? v] to [0]\nset [antal vågor v] to [1]\nset [ghost v] effect to (20)\nswitch costume to (tropiskt v)\nhide\n\nwhen I receive [nästa bana v]\nif <(Värld) = [3]> then\n    if <(Bana) = [3]> then\n        set [max y v] to [-80]\n        set [antal vågor v] to [1]\n    end\n    if <(Bana) = [4]> then\n        set [max y v] to [-44]\n        set [antal vågor v] to [1]\n    end\n    if <(Bana) = [5]> then\n        set [max y v] to [-50]\n        set [antal vågor v] to [2]\n    end\n    if <(Bana) = [7]> then\n        set [max y v] to [-63]\n        set [antal vågor v] to [2]\n    end\n    if <(Bana) = [8]> then\n        set [max y v] to [-60]\n        set [antal vågor v] to [1]\n    end\nend\n\ndefine Tidsvatten\nset [tidvatten? v] to [1]\nrepeat until <(Vågnivå) > [0.8]>\n    change y by (Vågnivå)\n    change [vågnivå v] by (0.05)\nend\nrepeat until <(y position) > (Max Y)>\n    change y by (Vågnivå)\n    if <([abs v] of ((y position) - ([y position v] of [crab v])) ) < [80]> then\n        set [tidvatten? v] to [2]\n    end\nend\nrepeat until <(Vågnivå) < [-0.8]>\n    change y by (Vågnivå)\n    change [vågnivå v] by (-0.05)\nend\nrepeat until <(y position) < [-166]>\n    change y by (Vågnivå)\nend\nset [tidvatten? v] to [0.5]\n\n@Crab\n\nwhen flag clicked\nhide\n\nwhen I receive [nästa bana v]\nwait (0.02) seconds\nif <(Värld) = [3]> then\n    if <<<(Bana) = [2]> or <(Bana) = [3]>> or <<(Bana) = [5]> or <(Bana) = [8]>>> then\n        set [krabba y v] to [0]\n        forever\n            if <<(Tidvatten?) = [0]> or <(Tidvatten?) = [1]>> then\n                change [krabba y v] by (-1)\n                change y by (Krabba Y)\n                if <touching (bana v)?> then\n                    Fixa övertramp\n                end\n            end\n        end\n    end\nend\n\ndefine Fixa övertramp\nrepeat until <not <touching (bana v)?>>\n    change y by (1)\n    set [krabba y v] to [0]\nend\n\nwhen I receive [nästa bana v]\nset volume to (100) %\nhide\nif <(Värld) = [3]> then\n    if <(Bana) = [2]> then\n        set [högst x v] to [176]\n        set [lägst x v] to [17]\n        go to x: (186) y: (-65)\n        show\n    end\n    if <(Bana) = [3]> then\n        set [högst x v] to [27]\n        set [lägst x v] to [-103]\n        go to x: (37) y: (-50)\n        show\n    end\n    if <(Bana) = [5]> then\n        set [högst x v] to [151]\n        set [lägst x v] to [41]\n        go to x: (161) y: (-91)\n        show\n    end\n    if <(Bana) = [8]> then\n        set [högst x v] to [34]\n        set [lägst x v] to [-76]\n        go to x: (44) y: (-62)\n        show\n    end\n    if <<<(Bana) = [2]> or <(Bana) = [3]>> or <<(Bana) = [5]> or <(Bana) = [8]>>> then\n        switch costume to (still v)\n        wait (0.5) seconds\n        forever\n            set [fart v] to [-5.5]\n            if <(Bana) = [2]> then\n                start sound [Gå \(2\) v]\n            end\n            if <<(Bana) = [3]> or <(Bana) = [5]>> then\n                start sound [Gå \(3/5\) v]\n            end\n            if <(Bana) = [8]> then\n                start sound [Gå \(8\) v]\n            end\n            repeat until <(x position) < (Lägst X)>\n                change x by (Fart)\n                next costume\n                if <(costume [number v]) = [12]> then\n                    switch costume to (still v)\n                end\n                if <(Tidvatten?) = [2]> then\n                    Ner i sanden\n                end\n            end\n            switch costume to (still v)\n            repeat (3)\n                change x by (Fart)\n                change [fart v] by (1)\n            end\n            wait (0.5) seconds\n            set [fart v] to [5.5]\n            if <(Bana) = [2]> then\n                start sound [Gå \(2\) v]\n            end\n            if <<(Bana) = [3]> or <(Bana) = [5]>> then\n                start sound [Gå \(3/5\) v]\n            end\n            if <(Bana) = [8]> then\n                start sound [Gå \(8\) v]\n            end\n            repeat until <(x position) > (Högst X)>\n                change x by (Fart)\n                next costume\n                if <(costume [number v]) = [12]> then\n                    switch costume to (still v)\n                end\n                if <(Tidvatten?) = [2]> then\n                    Ner i sanden\n                end\n            end\n            switch costume to (still v)\n            repeat (3)\n                change x by (Fart)\n                change [fart v] by (-1)\n            end\n            wait (0.5) seconds\n        end\n    end\nend\n\ndefine Ner i sanden\nset volume to (0) %\nswitch costume to (gräv #1 v)\nrepeat (44)\n    change y by (-1)\n    next costume\n    if <(costume [number v]) = [18]> then\n        switch costume to (gräv #1 v)\n    end\nend\nwait until <(Tidvatten?) = [0.5]>\nrepeat (44)\n    change y by (1)\n    next costume\n    if <(costume [number v]) = [18]> then\n        switch costume to (gräv #1 v)\n    end\nend\nswitch costume to (still v)\nset volume to (100) %\nset [tidvatten? v] to [0]\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <([x position v] of [spelare v]) < (x position)> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <([x position v] of [spelare v]) > (x position)> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\n@Seagull\n\nwhen flag clicked\nhide\nswitch costume to (flyg #1 v)\nset [fågelskit droppad v] to [0]\n\nwhen I receive [nästa bana v]\nhide\nset [fågelskit droppad v] to [0]\nif <(Värld) = [3]> then\n    if <<(Bana) = [4]> or <<(Bana) = [5]> or <(Bana) = [7]>>> then\n        forever\n            set [fågelskit droppad v] to [0]\n            go to x: (250) y: (110)\n            switch costume to (pick random (1) to (5))\n            show\n            repeat until <(x position) < [-250]>\n                change x by (-6)\n                next costume\n                if <(costume [number v]) = [11]> then\n                    switch costume to (flyg #1 v)\n                end\n                if <(DÖD?) = [0]> then\n                    if <([hastighet x v] of [spelare v]) > [0]> then\n                        if <<([abs v] of ((x position) - ([x position v] of [spelare v])) ) < [100]> and <(Fågelskit droppad) = [0]>> then\n                            repeat until <(costume [number v]) = [14]>\n                                change x by (-6)\n                                next costume\n                            end\n                            set [fågelskit droppad v] to [1]\n                            broadcast (Fågelskit v)\n                            repeat (3)\n                                change x by (-6)\n                                next costume\n                            end\n                        end\n                    else\n                        if <<([abs v] of ((x position) - ([x position v] of [spelare v])) ) < [30]> and <(Fågelskit droppad) = [0]>> then\n                            repeat until <(costume [number v]) = [14]>\n                                change x by (-6)\n                                next costume\n                            end\n                            set [fågelskit droppad v] to [1]\n                            broadcast (Fågelskit v)\n                            repeat (3)\n                                change x by (-6)\n                                next costume\n                            end\n                        end\n                    end\n                end\n            end\n            hide\n            wait (1) seconds\n        end\n    end\nend\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <([x position v] of [spelare v]) < (x position)> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <([x position v] of [spelare v]) > (x position)> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\n@Birdpoop\n\nwhen I receive [fågelskit v]\nswitch costume to (klädsel2 v)\nset x to (([x position v] of [seagull v]) + (15))\nset y to (([y position v] of [seagull v]) - (15))\nstart sound [Poop v]\nshow\nset [y-fart v] to [0]\nrepeat until <<<touching (bana v)?> or <touching (vatten v)?>> or <(Skadeläge) > [0]>>\n    change y by (Y-Fart)\n    change [y-fart v] by (-1)\n    if <(Skadeläge) = [0]> then\n        if <touching (spelare v)?> then\n            if <([x position v] of [spelare v]) < (x position)> then\n                set [skadeläge v] to [11]\n                broadcast (Skada v)\n            end\n            if <([x position v] of [spelare v]) > (x position)> then\n                set [skadeläge v] to [12]\n                broadcast (Skada v)\n            end\n        end\n    end\nend\nstart sound [Skiten2 v]\nrepeat (6)\n    next costume\nend\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [nästa bana v]\nstop [other scripts in sprite v]\nhide\n\n@Pufferfish\n\nwhen I receive [nästa bana v]\nstop [other scripts in sprite v]\nhide\nif <(Värld) = [3]> then\n    if <(Bana) = [6]> then\n        go to x: (-6) y: (-150)\n        set [hopp-räkning v] to [0]\n        set [x-fart v] to [0]\n        set [hopp? v] to [0]\n        broadcast (Blåsfisk v)\n        switch costume to (vanlig v)\n        show\n    end\n    if <(Bana) = [7]> then\n        go to x: (-185) y: (-150)\n        set [hopp-räkning v] to [0]\n        set [x-fart v] to [0]\n        set [hopp? v] to [0]\n        broadcast (Blåsfisk v)\n        switch costume to (vanlig v)\n        show\n    end\n    if <(Bana) = [8]> then\n        go to x: (-135) y: (-150)\n        set [hopp-räkning v] to [0]\n        set [x-fart v] to [0]\n        set [hopp? v] to [0]\n        broadcast (Blåsfisk v)\n        switch costume to (vanlig v)\n        show\n    end\n    if <<(Bana) = [6]> or <<(Bana) = [7]> or <(Bana) = [8]>>> then\n        switch costume to (vanlig v)\n        forever\n            repeat until <(X-Fart) > [7]>\n                change x by (X-Fart)\n                point in direction (90)\n                if <(Hopp?) = [0]> then\n                    next costume\n                    if <(costume [number v]) = [8]> then\n                        switch costume to (vanlig v)\n                    end\n                    change [x-fart v] by (0.5)\n                end\n            end\n            repeat until <(x position) > [150]>\n                change x by (X-Fart)\n                if <(Hopp?) = [0]> then\n                    next costume\n                    if <(costume [number v]) = [8]> then\n                        switch costume to (vanlig v)\n                    end\n                end\n            end\n            change [hopp-räkning v] by (1)\n            if <(Hopp-räkning) = [2]> then\n                if <(DÖD?) = [0]> then\n                    broadcast (Blåsfisk: hopp v)\n                end\n                set [hopp-räkning v] to [0]\n            end\n            repeat until <(X-Fart) < [-7]>\n                change x by (X-Fart)\n                point in direction (-90)\n                if <(Hopp?) = [0]> then\n                    next costume\n                    if <(costume [number v]) = [8]> then\n                        switch costume to (vanlig v)\n                    end\n                    change [x-fart v] by (-0.5)\n                end\n            end\n            repeat until <(x position) < [-150]>\n                change x by (X-Fart)\n                if <(Hopp?) = [0]> then\n                    next costume\n                    if <(costume [number v]) = [8]> then\n                        switch costume to (vanlig v)\n                    end\n                end\n            end\n            change [hopp-räkning v] by (1)\n            if <(Hopp-räkning) = [2]> then\n                if <(DÖD?) = [0]> then\n                    broadcast (Blåsfisk: hopp v)\n                end\n                set [hopp-räkning v] to [0]\n            end\n        end\n    end\nend\nstop [this script v]\n\nwhen I receive [blåsfisk v]\nset [y-gravitation v] to [0]\nforever\n    change [y-gravitation v] by (-1)\n    change y by (Y-gravitation)\n    if <([abs v] of ((y position) - ([y position v] of [vatten v])) ) < [20]> then\n        Fixa övertramp\n    end\nend\n\ndefine Fixa övertramp\nrepeat until <([abs v] of ((y position) - ([y position v] of [vatten v])) ) > [20]>\n    change y by (1)\nend\nset [y-gravitation v] to [0]\n\nwhen I receive [blåsfisk: hopp v]\nwait until <([abs v] of ((x position) - ([x position v] of [spelare v])) ) < [70]>\nstart sound [Upp från vattnet v]\nset [hopp? v] to [1]\nset [y-gravitation v] to [15]\nswitch costume to (simma #7 v)\nrepeat (2)\n    next costume\nend\nwait (0.8) seconds\nrepeat (2)\n    switch costume to ((costume [number v]) - (1))\nend\nswitch costume to (vanlig v)\nset [hopp? v] to [0]\nstart sound [Vattenplask v]\n\nwhen flag clicked\nset [hopp-räkning v] to [0]\nset [x-fart v] to [0]\nset [hopp? v] to [0]\ngo to x: (-6) y: (-150)\nhide\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <([x position v] of [spelare v]) < (x position)> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <([x position v] of [spelare v]) > (x position)> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\n@Bläckfisk\n\nwhen flag clicked\ngo to x: (13) y: (-162)\nset [träffläge v] to [0]\ndelete all of [attacklista v]\nhide\n\nwhen I receive [boss 3: start v]\ndelete all of [attacklista v]\nset [träffläge v] to [0]\nset [boss igång v] to [1]\nset [bossliv v] to [3]\nswitch costume to (vanlig v)\ngo to x: (13) y: (-162)\nwait (6.5) seconds\nstart sound [Upp från vattnet2 v]\nwait (1) seconds\nshow\nset [y-fart v] to [2]\nrepeat (85)\n    change y by (Y-Fart)\nend\nrepeat (10)\n    change y by (Y-Fart)\n    change [y-fart v] by (-0.2)\nend\nset [story-läge v] to [0]\nbroadcast (Stoy-läge avslutat v)\nwait (1) seconds\nforever\n    repeat (3)\n        set [bläckfisk: attack v] to (pick random (1) to (2))\n        if <[attacklista v] contains [1]?> then\n            set [bläckfisk: attack v] to [2]\n            set [bläckfisk: attack- tentakel v] to (pick random (1) to (2))\n        end\n        if <<(length of [attacklista v]) = [2]> and <not <[attacklista v] contains [1]?>>> then\n            set [bläckfisk: attack v] to [1]\n        end\n        add (Bläckfisk: Attack) to [attacklista v]\n        set [bläckfisk: attack- tentakel v] to (pick random (1) to (2))\n        set [bläckfisk: attack- igång? v] to [1]\n        if <(Bläckfisk: Attack) = [1]> then\n            broadcast (Bläckfisk: Bläck från tentakel v)\n        end\n        if <(Bläckfisk: Attack) = [2]> then\n            broadcast (Bläckfisk: Slam v)\n        end\n        wait until <(Bläckfisk: Attack- Igång?) = [0]>\n        wait (2.5) seconds\n    end\n    Attack\n    delete all of [attacklista v]\n    wait (2.5) seconds\nend\n\ndefine Attack\nswitch costume to (slam #1 v)\nwait (1) seconds\nrepeat (2)\n    switch costume to ((costume [number v]) - (1))\nend\nwait (0.5) seconds\nrepeat (6)\n    next costume\nend\nset [träffläge v] to [1]\nrepeat (2)\n    next costume\nend\nbroadcast (Jordbävning v)\nstart sound [Träff mot marken/väggen v]\nreset timer\nwait until <<(timer) > [1.5]> or <(Skadeläge) > [0]>>\nwait (1) seconds\nset [träffläge v] to [0]\nrepeat (2)\n    switch costume to ((costume [number v]) - (1))\nend\nrepeat (4)\n    switch costume to ((costume [number v]) - (1))\nend\nset [bläckfisk: attack- igång? v] to [0]\n\nwhen I receive [bläckfisk: slam v]\nif <(Bläckfisk: Attack- Tentakel) = [1]> then\n    switch costume to (kolla vänster v)\nend\nif <(Bläckfisk: Attack- Tentakel) = [2]> then\n    switch costume to (kolla höger v)\nend\nwait (0) seconds\nrepeat (4)\n    next costume\nend\nwait until <(Bläckfisk: Attack- Igång?) = [0]>\nrepeat (4)\n    switch costume to ((costume [number v]) - (1))\nend\nswitch costume to (vanlig v)\n\ndefine Mellansnack\nrepeat (4)\n    switch costume to (vibing #1 v)\n    repeat (14)\n        next costume\n        wait (0.03) seconds\n    end\nend\nswitch costume to (vanlig v)\n\nwhen I receive [bläckskvätt v]\nwait (1) seconds\nrepeat (4)\n    next costume\nend\nwait (0.6) seconds\nif <(Bläckfisk: Attack- Igång?) = [1]> then\n    repeat (4)\n        switch costume to ((costume [number v]) - (1))\n    end\nelse\n    wait (0.5) seconds\n    repeat (2)\n        next costume\n    end\n    switch costume to (fokuserad #3 v)\n    repeat (3)\n        switch costume to ((costume [number v]) - (1))\n    end\nend\n\nwhen I receive [bläck: tentakel v]\nwait (0.5) seconds\nswitch costume to (fokuserad #1 v)\nrepeat (2)\n    next costume\nend\nif <(Bläckfisk: Attack- Tentakel) = [1]> then\n    repeat (2)\n        next costume\n    end\nend\nif <(Bläckfisk: Attack- Tentakel) = [2]> then\n    switch costume to (fokuserad #4 v)\n    repeat (2)\n        next costume\n    end\nend\n\nwhen I receive [boss 3: död v]\nset [pratbubbla igång v] to [1]\nset [story-läge v] to [1]\nwait until <(Pratbubbla igång) = [0]>\nrepeat (3)\n    switch costume to (slam #8 v)\n    repeat (11)\n        next costume\n    end\nend\nwait (0.5) seconds\nset [y-fart v] to [0]\nrepeat (15)\n    change y by (Y-Fart)\n    change [y-fart v] by (-0.5)\nend\nwait (0.5) seconds\nstart sound [Ner i vattnet v]\nbroadcast (Jordbävning v)\nhide\nset [boss igång v] to [0]\nbroadcast (Boss: Slut v)\n\nwhen I receive [boss 3: start v]\nforever\n    if <(Skadeläge) = [0]> then\n        if <<<touching (spelare v)?> and <([faller v] of [spelare v]) > [15]>> and <<(Träffläge) = [1]> and <([y position v] of [spelare v]) > ((y position) - (50))>>> then\n            if <([x position v] of [spelare v]) < (x position)> then\n                start sound [Slag v]\n                set [skadeläge v] to [11]\n                broadcast (Boss: Skadad v)\n            end\n            if <([x position v] of [spelare v]) > (x position)> then\n                start sound [Slag v]\n                set [skadeläge v] to [12]\n                broadcast (Boss: Skadad v)\n            end\n        end\n        if <<<touching (spelare v)?> and <not <([faller v] of [spelare v]) > [15]>>> and <<(Träffläge) = [1]> and <([y position v] of [spelare v]) < ((y position) - (25))>>> then\n            if <([x position v] of [spelare v]) < (x position)> then\n                set [skadeläge v] to [11]\n                broadcast (Skada v)\n            end\n            if <([x position v] of [spelare v]) > (x position)> then\n                set [skadeläge v] to [12]\n                broadcast (Skada v)\n            end\n        end\n    end\nend\n\nwhen I receive [boss: skadad v]\nif <(Värld) = [3]> then\n    if <(Bossliv) > [1]> then\n        set [träffläge v] to [0]\n        change [bossliv v] by (-1)\n        broadcast (Visa bosshjärtan v)\n        set [ghost v] effect to (20)\n        wait (1.5) seconds\n        set [ghost v] effect to (0)\n        set [skadeläge v] to [0]\n    else\n        set [story-läge v] to [1]\n        stop [other scripts in sprite v]\n        if <not <(costume [number v]) = [40]>> then\n            switch costume to (slam #1 v)\n            repeat until <(costume [number v]) = [40]>\n                next costume\n            end\n        end\n        broadcast (Jordbävning v)\n        broadcast (Boss 3: Död v)\n        broadcast (Story-läge v)\n    end\nend\n\nwhen I receive [continue-button v]\nstop [other scripts in sprite v]\nhide\n\n@Tentakel #1\n\nwhen flag clicked\nhide\ngo to x: (-113) y: (-105)\nset [y-fart v] to [10]\n\nwhen I receive [boss 3: start v]\nswitch costume to (klädsel4 v)\ngo to x: (-113) y: (-277)\nset [y-fart v] to [10]\nwait (4.5) seconds\nstart sound [Upp från vattnet v]\nshow\nrepeat (33)\n    change y by (Y-Fart)\n    change [y-fart v] by (-0.3)\nend\ngo to x: (-113) y: (-105)\nset [gung v] to [0]\nforever\n    repeat until <(Gung) < [-2]>\n        change y by (Gung)\n        change [gung v] by (-0.1)\n    end\n    repeat until <(Gung) > [2]>\n        change y by (Gung)\n        change [gung v] by (0.1)\n    end\nend\n\nwhen I receive [bläckfisk: bläck från tentakel v]\nstop [other scripts in sprite v]\nrepeat until <(Gung) > [2]>\n    change y by (Gung)\n    change [gung v] by (0.1)\nend\nset [gung v] to [2]\nrepeat until <(y position) > [-87]>\n    change y by (2)\nend\nrepeat (10)\n    change y by (Gung)\n    change [gung v] by (-0.2)\nend\nif <(Bläckfisk: Attack- Tentakel) = [1]> then\n    broadcast (Bläck: tentakel v)\nelse\n    stop [this script v]\nend\n\nwhen I receive [bläckskvätt v]\nif <(Bläckfisk: Attack- Tentakel) = [1]> then\n    switch costume to (pump #1 v)\n    repeat (2)\n        next costume\n    end\n    repeat (2)\n        switch costume to ((costume [number v]) - (1))\n    end\n    wait (0.8) seconds\n    repeat (2)\n        next costume\n    end\nend\n\nwhen I receive [bläcksprut över v]\nif <(Bläckfisk: Attack- Tentakel) = [1]> then\n    repeat (2)\n        switch costume to ((costume [number v]) - (1))\n    end\nend\n\nwhen I receive [bläckfisk: återgå v]\nif <(Bläckfisk: Attack- Tentakel) = [1]> then\n    wait (0) seconds\nelse\n    wait (1) seconds\nend\nset [gung v] to [0]\nrepeat (10)\n    change y by (Gung)\n    change [gung v] by (-0.2)\nend\nrepeat until <(y position) < [-126]>\n    change y by (-2)\nend\nrepeat (10)\n    change y by (Gung)\n    change [gung v] by (0.2)\nend\nforever\n    repeat until <(Gung) > [2]>\n        change y by (Gung)\n        change [gung v] by (0.1)\n    end\n    repeat until <(Gung) < [-2]>\n        change y by (Gung)\n        change [gung v] by (-0.1)\n    end\nend\n\nwhen I receive [bläckfisk: slam v]\nif <(Bläckfisk: Attack- Tentakel) = [1]> then\n    stop [other scripts in sprite v]\n    repeat until <(Gung) > [2]>\n        change y by (Gung)\n        change [gung v] by (0.1)\n    end\n    set [gung v] to [2]\n    repeat until <(y position) > [-85]>\n        change y by (2)\n    end\n    repeat (10)\n        change y by (Gung)\n        change [gung v] by (-0.2)\n    end\n    switch costume to (slam #3 \(mitt\) v)\n    wait (0) seconds\n    repeat (2)\n        switch costume to ((costume [number v]) - (1))\n    end\n    repeat (7)\n        next costume\n    end\n    broadcast (Jordbävning v)\n    start sound [Träff mot marken/väggen v]\n    wait (1) seconds\n    repeat (7)\n        switch costume to ((costume [number v]) - (1))\n    end\n    repeat (2)\n        next costume\n    end\n    wait (0.5) seconds\n    set [bläckfisk: attack- igång? v] to [0]\n    broadcast (Tentakel #1: Återgå v)\nend\n\nwhen I receive [tentakel #1: återgå v]\nset [gung v] to [0]\nrepeat (10)\n    change y by (Gung)\n    change [gung v] by (-0.2)\nend\nrepeat until <(y position) < [-126]>\n    change y by (-2)\nend\nrepeat (10)\n    change y by (Gung)\n    change [gung v] by (0.2)\nend\nforever\n    repeat until <(Gung) > [2]>\n        change y by (Gung)\n        change [gung v] by (0.1)\n    end\n    repeat until <(Gung) < [-2]>\n        change y by (Gung)\n        change [gung v] by (-0.1)\n    end\nend\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <(Bläckfisk: Attack- Tentakel) = [2]> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <(Bläckfisk: Attack- Tentakel) = [1]> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\nwhen I receive [boss 3: död v]\nstop [other scripts in sprite v]\nrepeat until <(y position) < [-280]>\n    change y by (Gung)\n    change [gung v] by (-0.2)\nend\nhide\n\nwhen I receive [continue-button v]\nstop [other scripts in sprite v]\nhide\n\n@Tentakel #2\n\nwhen flag clicked\nhide\ngo to x: (142) y: (-108)\nset [y-fart v] to [10]\n\nwhen I receive [boss 3: start v]\nswitch costume to (klädsel4 v)\ngo to x: (142) y: (-280)\nset [y-fart v] to [10]\nwait (1.5) seconds\nshow\nstart sound [Upp från vattnet v]\nrepeat (33)\n    change y by (Y-Fart)\n    change [y-fart v] by (-0.3)\nend\ngo to x: (142) y: (-108)\nset [gung v] to [0]\nforever\n    repeat until <(Gung) < [-2]>\n        change y by (Gung)\n        change [gung v] by (-0.1)\n    end\n    repeat until <(Gung) > [2]>\n        change y by (Gung)\n        change [gung v] by (0.1)\n    end\nend\n\nwhen I receive [bläckfisk: bläck från tentakel v]\nstop [other scripts in sprite v]\nrepeat until <(Gung) > [2]>\n    change y by (Gung)\n    change [gung v] by (0.1)\nend\nset [gung v] to [2]\nrepeat until <(y position) > [-87]>\n    change y by (2)\nend\nrepeat (10)\n    change y by (Gung)\n    change [gung v] by (-0.2)\nend\nif <(Bläckfisk: Attack- Tentakel) = [2]> then\n    broadcast (Bläck: tentakel v)\nelse\n    stop [this script v]\nend\n\nwhen I receive [bläckskvätt v]\nif <(Bläckfisk: Attack- Tentakel) = [2]> then\n    switch costume to (pump #1 v)\n    repeat (2)\n        next costume\n    end\n    repeat (2)\n        switch costume to ((costume [number v]) - (1))\n    end\n    wait (0.8) seconds\n    repeat (2)\n        next costume\n    end\nend\n\nwhen I receive [bläcksprut över v]\nif <(Bläckfisk: Attack- Tentakel) = [2]> then\n    repeat (2)\n        switch costume to ((costume [number v]) - (1))\n    end\nend\n\nwhen I receive [tentakel #2: återgå v]\nset [gung v] to [0]\nrepeat (10)\n    change y by (Gung)\n    change [gung v] by (-0.2)\nend\nrepeat until <(y position) < [-126]>\n    change y by (-2)\nend\nrepeat (10)\n    change y by (Gung)\n    change [gung v] by (0.2)\nend\nforever\n    repeat until <(Gung) > [2]>\n        change y by (Gung)\n        change [gung v] by (0.1)\n    end\n    repeat until <(Gung) < [-2]>\n        change y by (Gung)\n        change [gung v] by (-0.1)\n    end\nend\n\nwhen I receive [bläckfisk: slam v]\nif <(Bläckfisk: Attack- Tentakel) = [2]> then\n    stop [other scripts in sprite v]\n    repeat until <(Gung) > [2]>\n        change y by (Gung)\n        change [gung v] by (0.1)\n    end\n    set [gung v] to [2]\n    repeat until <(y position) > [-85]>\n        change y by (2)\n    end\n    repeat (10)\n        change y by (Gung)\n        change [gung v] by (-0.2)\n    end\n    switch costume to (slam #3 \(mitt\) v)\n    wait (0) seconds\n    repeat (2)\n        switch costume to ((costume [number v]) - (1))\n    end\n    repeat (7)\n        next costume\n    end\n    broadcast (Jordbävning v)\n    start sound [Träff mot marken/väggen v]\n    wait (1) seconds\n    repeat (7)\n        switch costume to ((costume [number v]) - (1))\n    end\n    repeat (2)\n        next costume\n    end\n    wait (0.5) seconds\n    set [bläckfisk: attack- igång? v] to [0]\n    broadcast (Tentakel #2: Återgå v)\nend\n\nwhen I receive [bläckfisk: återgå v]\nif <(Bläckfisk: Attack- Tentakel) = [2]> then\n    wait (0) seconds\nelse\n    wait (1) seconds\nend\nset [gung v] to [0]\nrepeat (10)\n    change y by (Gung)\n    change [gung v] by (-0.2)\nend\nrepeat until <(y position) < [-126]>\n    change y by (-2)\nend\nrepeat (10)\n    change y by (Gung)\n    change [gung v] by (0.2)\nend\nforever\n    repeat until <(Gung) > [2]>\n        change y by (Gung)\n        change [gung v] by (0.1)\n    end\n    repeat until <(Gung) < [-2]>\n        change y by (Gung)\n        change [gung v] by (-0.1)\n    end\nend\n\nwhen I receive [boss 3: död v]\nstop [other scripts in sprite v]\nrepeat until <(y position) < [-280]>\n    change y by (Gung)\n    change [gung v] by (-0.2)\nend\nhide\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <(Bläckfisk: Attack- Tentakel) = [2]> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <(Bläckfisk: Attack- Tentakel) = [1]> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\nwhen I receive [continue-button v]\nstop [other scripts in sprite v]\nhide\n\n@Bakgrunds-Tentakel #1\n\nwhen flag clicked\ngo to x: (-86) y: (-10)\nhide\nset [y-fart v] to [10]\n\nwhen I receive [boss 3: start v]\ngo to x: (-86) y: (-180)\nset [y-fart v] to [10]\nwait (3) seconds\nstart sound [Upp från vattnet v]\nshow\nrepeat (27)\n    change y by (Y-Fart)\n    change [y-fart v] by (-0.4)\nend\nset [gung v] to [0]\nforever\n    repeat until <(Gung) < [-2]>\n        change y by (Gung)\n        change [gung v] by (-0.1)\n    end\n    repeat until <(Gung) > [2]>\n        change y by (Gung)\n        change [gung v] by (0.1)\n    end\nend\n\nwhen I receive [boss 3: död v]\nstop [other scripts in sprite v]\nrepeat until <(y position) < [-250]>\n    change y by (Gung)\n    change [gung v] by (-0.2)\nend\nhide\n\nwhen I receive [continue-button v]\nstop [other scripts in sprite v]\nhide\n\n@Bakgrunds-Tentakel #2\n\nwhen flag clicked\ngo to x: (106) y: (-12)\nhide\nset [y-fart v] to [10]\n\nwhen I receive [boss 3: start v]\ngo to x: (106) y: (-180)\nset [y-fart v] to [10]\nwait (6) seconds\nstart sound [Upp från vattnet v]\nshow\nrepeat (27)\n    change y by (Y-Fart)\n    change [y-fart v] by (-0.4)\nend\nset [gung v] to [0]\nforever\n    repeat until <(Gung) < [-2]>\n        change y by (Gung)\n        change [gung v] by (-0.1)\n    end\n    repeat until <(Gung) > [2]>\n        change y by (Gung)\n        change [gung v] by (0.1)\n    end\nend\n\nwhen I receive [boss 3: död v]\nstop [other scripts in sprite v]\nrepeat until <(y position) < [-250]>\n    change y by (Gung)\n    change [gung v] by (-0.2)\nend\nhide\n\nwhen I receive [continue-button v]\nstop [other scripts in sprite v]\nhide\n\n@Bläckskvätt\n\nwhen flag clicked\nhide\n\nwhen I receive [bläckskvätt v]\nif <(Bläckfisk: Attack- Tentakel) = [1]> then\n    point in direction (-90)\n    if <(Bläckmönster!) = [1]> then\n        set x to (([x position v] of [tentakel #1 v]) + (33))\n        set y to (([y position v] of [tentakel #1 v]) + (78))\n    end\n    if <(Bläckmönster!) = [2]> then\n        set x to (([x position v] of [tentakel #1 v]) + (32))\n        set y to (([y position v] of [tentakel #1 v]) + (40))\n    end\n    if <(Bläckmönster!) = [3]> then\n        set x to (([x position v] of [tentakel #1 v]) + (33))\n        set y to (([y position v] of [tentakel #1 v]) + (3))\n    end\nend\nif <(Bläckfisk: Attack- Tentakel) = [2]> then\n    point in direction (90)\n    if <(Bläckmönster!) = [1]> then\n        set x to (([x position v] of [tentakel #2 v]) - (33))\n        set y to (([y position v] of [tentakel #2 v]) + (78))\n    end\n    if <(Bläckmönster!) = [2]> then\n        set x to (([x position v] of [tentakel #2 v]) - (32))\n        set y to (([y position v] of [tentakel #2 v]) + (40))\n    end\n    if <(Bläckmönster!) = [3]> then\n        set x to (([x position v] of [tentakel #2 v]) - (33))\n        set y to (([y position v] of [tentakel #2 v]) + (3))\n    end\nend\nstart sound [Skvätt v]\nswitch costume to (klädsel8 v)\nshow\nrepeat (7)\n    next costume\nend\nhide\n\n@Bläck\n\nwhen flag clicked\nhide\n\nwhen I receive [bläck: tentakel v]\nrepeat (3)\n    set [bläckmönster! v] to (pick random (1) to (3))\n    if <(Bläckfisk: Attack- Tentakel) = [1]> then\n        point in direction (-90)\n        if <(Bläckmönster!) = [1]> then\n            set x to (([x position v] of [tentakel #1 v]) + (22))\n            set y to (([y position v] of [tentakel #1 v]) + (81))\n        end\n        if <(Bläckmönster!) = [2]> then\n            set x to (([x position v] of [tentakel #1 v]) + (21))\n            set y to (([y position v] of [tentakel #1 v]) + (43))\n        end\n        if <(Bläckmönster!) = [3]> then\n            set x to (([x position v] of [tentakel #1 v]) + (22))\n            set y to (([y position v] of [tentakel #1 v]) + (6))\n        end\n        Sprut\n    end\n    if <(Bläckfisk: Attack- Tentakel) = [2]> then\n        point in direction (90)\n        if <(Bläckmönster!) = [1]> then\n            set x to (([x position v] of [tentakel #2 v]) - (24))\n            set y to (([y position v] of [tentakel #2 v]) + (78))\n        end\n        if <(Bläckmönster!) = [2]> then\n            set x to (([x position v] of [tentakel #2 v]) - (23))\n            set y to (([y position v] of [tentakel #2 v]) + (40))\n        end\n        if <(Bläckmönster!) = [3]> then\n            set x to (([x position v] of [tentakel #2 v]) - (24))\n            set y to (([y position v] of [tentakel #2 v]) + (3))\n        end\n        Sprut\n    end\nend\nbroadcast (Bläckfisk: Återgå v)\nset [bläckfisk: attack- igång? v] to [0]\n\ndefine Sprut\nwait (0.5) seconds\nbroadcast (Bläckskvätt v)\nwait (1) seconds\nstart sound [Bläck v]\nswitch costume to (#2 v)\nshow\nrepeat (3)\n    next costume\nend\nrepeat (7)\n    next costume\nend\nhide\nbroadcast (Bläcksprut över v)\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <(Bläckfisk: Attack- Tentakel) = [2]> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <(Bläckfisk: Attack- Tentakel) = [1]> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\nwhen I receive [continue-button v]\nstop [other scripts in sprite v]\nhide\n\n@Dimma\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [nästa bana v]\nstop [other scripts in sprite v]\nif <(Värld) = [4]> then\n    if <(Bana) = [1]> then\n        set [genomskinlighet v] to [50]\n        set [ghost v] effect to (50)\n        show\n        Dimma\n    end\n    if <<(Bana) = [3]> or <<(Bana) = [7]> or <(Bana) = [8]>>> then\n        set [genomskinlighet v] to [50]\n        set [ghost v] effect to (50)\n        show\n        wait (0.5) seconds\n        Stark dimma\n    end\nend\nif <(Värld) = [4]> then\n    if <(Genomskinlighet) > [50]> then\n        repeat until <(Genomskinlighet) < [50]>\n            change [ghost v] effect by (-0.25)\n            change [genomskinlighet v] by (-0.25)\n        end\n    end\n    if <(Genomskinlighet) < [50]> then\n        repeat until <(Genomskinlighet) > [50]>\n            change [ghost v] effect by (0.25)\n            change [genomskinlighet v] by (0.25)\n        end\n    end\n    Dimma\nend\n\ndefine Dimma\nforever\n    wait (pick random (1) to (3)) seconds\n    set [slumpgenerator: dimma v] to (pick random (1) to (2))\n    if <(Slumpgenerator: Dimma) = [2]> then\n        set [dimkraft v] to [0.25]\n        repeat until <(Genomskinlighet) > [65]>\n            change [ghost v] effect by (Dimkraft)\n            change [genomskinlighet v] by (0.25)\n        end\n    end\n    if <(Slumpgenerator: Dimma) = [1]> then\n        set [dimkraft v] to [-0.25]\n        repeat until <(Genomskinlighet) < [35]>\n            change [ghost v] effect by (Dimkraft)\n            change [genomskinlighet v] by (-0.25)\n        end\n    end\nend\n\ndefine Stark dimma\nforever\n    set [dimkraft v] to [-0.25]\n    repeat until <(Genomskinlighet) < [10]>\n        change [ghost v] effect by (Dimkraft)\n        change [genomskinlighet v] by (-0.25)\n    end\n    wait (5) seconds\n    set [dimkraft v] to [0.25]\n    repeat until <(Genomskinlighet) > [50]>\n        change [ghost v] effect by (Dimkraft)\n        change [genomskinlighet v] by (0.25)\n    end\n    wait (2) seconds\nend\n\nwhen I receive [continue-button v]\nstop [other scripts in sprite v]\ngo to x: (0) y: (0)\nhide\n\n@Mygga #1\n\nwhen I start as a clone\nset [fart v] to [1]\nshow\nrepeat until <(distance to [spelare v]) < [90]>\n    move (1) steps\n    next costume\n    if <<([abs v] of ((X-Position) - (x position)) ) > [30]> or <([abs v] of ((Y-position) - (y position)) ) > [30]>> then\n        move (-2) steps\n        turn left (pick random (150) to (210)) degrees\n    end\n    if <(Nästa bana) = [1]> then\n        delete this clone\n    end\nend\nforever\n    move (Fart) steps\n    point towards (spelare v)\n    next costume\n    if <(Nästa bana) = [1]> then\n        delete this clone\n    end\n    if <<([hastighet y v] of [spelare v]) > [1]> and <(distance to [spelare v]) < [90]>> then\n        repeat (10)\n            change [fart v] by (-0.5)\n            move (Fart) steps\n            next costume\n            if <(Nästa bana) = [1]> then\n                delete this clone\n            end\n        end\n        repeat (10)\n            change [fart v] by (0.5)\n            move (Fart) steps\n            next costume\n            if <(Nästa bana) = [1]> then\n                delete this clone\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [nästa bana v]\nstop [other scripts in sprite v]\nif <(Värld) = [4]> then\n    if <(Bana) = [2]> then\n        go to x: (-59) y: (-52)\n        set [x-position v] to (x position)\n        set [y-position v] to (y position)\n        repeat (3)\n            create clone of (_myself_ v)\n            change x by (5)\n        end\n    end\n    if <(Bana) = [5]> then\n        go to x: (15) y: (25)\n        set [x-position v] to (x position)\n        set [y-position v] to (y position)\n        repeat (3)\n            create clone of (_myself_ v)\n            change x by (5)\n        end\n    end\n    if <(Bana) = [8]> then\n        go to x: (-99) y: (-5)\n        set [x-position v] to (x position)\n        set [y-position v] to (y position)\n        repeat (5)\n            create clone of (_myself_ v)\n            change x by (5)\n        end\n    end\nend\n\nwhen I start as a clone\nif <(Bana) = [2]> then\n    wait until <(Bana) = [3]>\n    repeat (3)\n        delete this clone\n    end\nend\nif <(Bana) = [5]> then\n    wait until <(Bana) = [6]>\n    repeat (3)\n        delete this clone\n    end\nend\nif <(Bana) = [8]> then\n    wait until <(Bana) = [9]>\n    repeat (5)\n        delete this clone\n    end\nend\n\nwhen I receive [continue-button v]\nrepeat (5)\n    delete this clone\nend\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <([x position v] of [spelare v]) < (x position)> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <([x position v] of [spelare v]) > (x position)> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\n@Mygga #2\n\nwhen I start as a clone\nset [fart v] to [1]\nshow\nrepeat until <(distance to [spelare v]) < [90]>\n    move (1) steps\n    next costume\n    if <<([abs v] of ((X-Position) - (x position)) ) > [30]> or <([abs v] of ((Y-position) - (y position)) ) > [30]>> then\n        move (-2) steps\n        turn left (pick random (150) to (210)) degrees\n    end\n    if <(Nästa bana) = [1]> then\n        delete this clone\n    end\nend\nforever\n    move (Fart) steps\n    point towards (spelare v)\n    next costume\n    if <(Nästa bana) = [1]> then\n        delete this clone\n    end\n    if <<([hastighet y v] of [spelare v]) > [1]> and <(distance to [spelare v]) < [90]>> then\n        repeat (10)\n            change [fart v] by (-0.5)\n            move (Fart) steps\n            next costume\n            if <(Nästa bana) = [1]> then\n                delete this clone\n            end\n        end\n        repeat (10)\n            change [fart v] by (0.5)\n            move (Fart) steps\n            next costume\n            if <(Nästa bana) = [1]> then\n                delete this clone\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [nästa bana v]\nstop [other scripts in sprite v]\nif <(Värld) = [4]> then\n    if <(Bana) = [3]> then\n        go to x: (65) y: (-10)\n        set [x-position v] to (x position)\n        set [y-position v] to (y position)\n        repeat (3)\n            create clone of (_myself_ v)\n            change x by (5)\n        end\n    end\n    if <(Bana) = [8]> then\n        go to x: (55) y: (-26)\n        set [x-position v] to (x position)\n        set [y-position v] to (y position)\n        repeat (3)\n            create clone of (_myself_ v)\n            change x by (5)\n        end\n    end\nend\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <([x position v] of [spelare v]) < (x position)> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <([x position v] of [spelare v]) > (x position)> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\nwhen I start as a clone\nif <(Bana) = [3]> then\n    wait until <(Bana) = [4]>\n    repeat (3)\n        delete this clone\n    end\nend\nif <(Bana) = [8]> then\n    wait until <(Bana) = [9]>\n    repeat (3)\n        delete this clone\n    end\nend\n\nwhen I receive [continue-button v]\nrepeat (5)\n    delete this clone\nend\n\n@Krokodil\n\nwhen flag clicked\ngo to x: (22) y: (-95)\npoint in direction (90)\nset rotation style [left-right v]\nswitch costume to (innan gap v)\nhide\nset [attack v] to [0]\n\nwhen I receive [nästa bana v]\nstop [other scripts in sprite v]\nhide\nif <(Värld) = [4]> then\n    if <(Bana) = [4]> then\n        go to x: (22) y: (-105)\n        point in direction (90)\n    end\n    if <(Bana) = [5]> then\n        go to x: (50) y: (-105)\n        point in direction (90)\n    end\n    if <(Bana) = [7]> then\n        go to x: (-70) y: (-105)\n        point in direction (90)\n    end\n    if <<<(Bana) = [4]> or <(Bana) = [5]>> or <(Bana) = [7]>> then\n        set [attack v] to [0]\n        switch costume to (lurar v)\n        show\n        broadcast (Krokodil v)\n        point in direction (90)\n        set [x-fart v] to [2]\n        forever\n            set [riktning v] to [1]\n            repeat until <(x position) > [140]>\n                change x by (X-Fart)\n                if <(DÖD?) = [0]> then\n                    if <<([abs v] of ((x position) - ([x position v] of [spelare v])) ) < [150]> and <([x position v] of [spelare v]) > (x position)>> then\n                        if <(Attack) = [0]> then\n                            broadcast (Krokodil: Attack v)\n                            set [attack v] to [1]\n                        end\n                        wait until <(Attack) = [0]>\n                    end\n                end\n            end\n            point in direction (-90)\n            repeat (16)\n                change [x-fart v] by (-0.25)\n                change x by (X-Fart)\n            end\n            set [riktning v] to [0]\n            repeat until <(x position) < [-140]>\n                change x by (X-Fart)\n                if <(DÖD?) = [0]> then\n                    if <<([abs v] of ((x position) - ([x position v] of [spelare v])) ) < [150]> and <([x position v] of [spelare v]) < (x position)>> then\n                        if <(Attack) = [0]> then\n                            broadcast (Krokodil: Attack v)\n                            set [attack v] to [1]\n                        end\n                        wait until <(Attack) = [0]>\n                    end\n                end\n            end\n            point in direction (90)\n            repeat (16)\n                change [x-fart v] by (0.25)\n                change x by (X-Fart)\n            end\n        end\n    end\nend\n\nwhen I receive [krokodil v]\nset [y-gravitation v] to [0]\nforever\n    change [y-gravitation v] by (-1)\n    change y by (Y-Gravitation)\n    if <([abs v] of ((y position) - ([y position v] of [vatten v])) ) < [30]> then\n        Fixa övertramp\n    end\nend\n\ndefine Fixa övertramp\nrepeat until <([abs v] of ((y position) - ([y position v] of [vatten v])) ) > [30]>\n    change y by (1)\nend\nset [y-gravitation v] to [0]\n\nwhen I receive [krokodil: attack v]\nswitch costume to (innan gap v)\nif <(Riktning) = [1]> then\n    set [x-fart v] to [2]\nelse\n    set [x-fart v] to [-2]\nend\nrepeat (3)\n    next costume\n    if <(Riktning) = [1]> then\n        change [x-fart v] by (0.8)\n    else\n        change [x-fart v] by (-0.8)\n    end\n    change x by (X-Fart)\nend\nif <(Riktning) = [1]> then\n    repeat until <([x position v] of [spelare v]) < (x position)>\n        change x by (X-Fart)\n    end\nelse\n    repeat until <([x position v] of [spelare v]) > (x position)>\n        change x by (X-Fart)\n    end\nend\nrepeat (12)\n    change x by (X-Fart)\n    if <(Riktning) = [1]> then\n        change [x-fart v] by (-0.2)\n    else\n        change [x-fart v] by (0.2)\n    end\nend\nrepeat (3)\n    switch costume to ((costume [number v]) - (1))\n    change x by (X-Fart)\nend\nset [attack v] to [0]\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <([x position v] of [spelare v]) < (x position)> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <([x position v] of [spelare v]) > (x position)> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\n@Grasshopper\n\ndefine Fixa övertramp\nrepeat until <not <touching (bana v)?>>\n    change y by (1)\nend\nset [gräshopps-y v] to [0]\n\nwhen I receive [nästa bana v]\nstop [other scripts in sprite v]\nhide\nif <(Värld) = [4]> then\n    if <(Bana) = [6]> then\n        go to x: (194) y: (-50)\n    end\n    if <(Bana) = [7]> then\n        go to x: (92) y: (-66)\n    end\n    if <(Bana) = [8]> then\n        go to x: (117) y: (-73)\n    end\n    if <<(Bana) = [6]> or <<(Bana) = [7]> or <(Bana) = [8]>>> then\n        broadcast (Gräshoppa v)\n        switch costume to (klädsel4 v)\n        show\n        wait (1) seconds\n        forever\n            broadcast (Gärshoppehopp v)\n            start sound [Hop v]\n            point in direction (90)\n            set [x-fart v] to [-7]\n            set [gräshopps-y v] to [15]\n            repeat until <<(Gräshopps-Y) = [0]> and <(På nedgång?) = [1]>>\n                if <(Gräshopps-Y) < [0]> then\n                    set [på nedgång? v] to [1]\n                else\n                    set [på nedgång? v] to [0]\n                end\n                change x by (X-Fart)\n            end\n            set [på nedgång? v] to [0]\n            set [gräshopps-y v] to [3]\n            repeat (7)\n                change [x-fart v] by (1)\n                change x by (X-Fart)\n            end\n            if <(Bana) = [6]> then\n                go to x: (-44) y: (-68)\n            end\n            if <(Bana) = [7]> then\n                go to x: (-139) y: (-76)\n            end\n            if <(Bana) = [8]> then\n                go to x: (-114) y: (-79)\n            end\n            wait (1) seconds\n            broadcast (Gärshoppehopp v)\n            start sound [Hop v]\n            point in direction (-90)\n            set [x-fart v] to [7.2]\n            set [gräshopps-y v] to [15]\n            repeat until <<(Gräshopps-Y) = [0]> and <(På nedgång?) = [1]>>\n                if <(Gräshopps-Y) < [0]> then\n                    set [på nedgång? v] to [1]\n                else\n                    set [på nedgång? v] to [0]\n                end\n                change x by (X-Fart)\n            end\n            set [på nedgång? v] to [0]\n            set [gräshopps-y v] to [3]\n            repeat (7)\n                change [x-fart v] by (-1)\n                change x by (X-Fart)\n            end\n            wait (1) seconds\n        end\n    end\nend\n\nwhen I receive [gräshoppa v]\nif <(Värld) = [4]> then\n    if <<<(Bana) = [6]> or <(Bana) = [7]>> or <(Bana) = [8]>> then\n        set [gräshopps-y v] to [0]\n        forever\n            change [gräshopps-y v] by (-1)\n            change y by (Gräshopps-Y)\n            if <touching (bana v)?> then\n                Fixa övertramp\n            end\n        end\n    end\nend\nstop [this script v]\n\nwhen flag clicked\nhide\nset [på nedgång? v] to [0]\n\nwhen I receive [gärshoppehopp v]\nswitch costume to (klädsel4 v)\nrepeat (4)\n    next costume\nend\nwait (0.7) seconds\nrepeat (6)\n    switch costume to ((costume [number v]) - (1))\nend\nrepeat (2)\n    next costume\nend\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <([x position v] of [spelare v]) < (x position)> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <([x position v] of [spelare v]) > (x position)> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\n@Bur\n\nwhen flag clicked\ngo to x: (2) y: (177)\nswitch costume to (tom v)\nhide\n\nwhen I receive [nästa bana v]\nhide\nif <(Värld) = [4]> then\n    if <(Bana) = [10]> then\n        go to x: (2) y: (177)\n        switch costume to (bunny blue v)\n        show\n    end\nend\n\nwhen I receive [finalboss: slut v]\nswitch costume to (bunny blue v)\nset [y-fart v] to [0]\nrepeat until <touching (bana v)?>\n    change y by (Y-Fart)\n    change [y-fart v] by (-1)\nend\nset [y-fart v] to [4]\nrepeat (8)\n    change y by (Y-Fart)\n    change [y-fart v] by (-1)\nend\n\nwhen I receive [bb: rescued v]\nstart sound [Rassel v]\nrepeat (3)\n    switch costume to (lock #1 v)\n    repeat (7)\n        next costume\n    end\nend\nwait (0.5) seconds\nbroadcast (Låset av v)\nswitch costume to (låslös v)\n\nwhen I receive [bb: ut ur buren v]\nswitch costume to (låslös tom v)\n\n@Lås\n\nwhen flag clicked\nhide\n\nwhen I receive [låset av v]\ngo to (bur v)\nchange y by (-150)\nchange x by (-35)\npoint in direction (90)\nswitch costume to (klädsel1 v)\nshow\nset [y-fart v] to [2]\nrepeat until <touching (bana v)?>\n    change y by (Y-Fart)\n    turn left (6) degrees\n    change [y-fart v] by (-1)\nend\nhide\nbroadcast (BB: Ut ur buren v)\n\n@Ben\n\nwhen flag clicked\nhide\n\nwhen I receive [klamp: ben v]\nhide\nset [y-fart v] to [9]\nif <([direction v] of [klamp v]) > [0]> then\n    set [x-fart v] to [11]\nend\nif <([direction v] of [klamp v]) < [0]> then\n    set [x-fart v] to [-11]\nend\nrepeat (5)\n    go to (klamp v)\n    create clone of (_myself_ v)\n    wait (0.2) seconds\n    if <([direction v] of [klamp v]) > [0]> then\n        change [x-fart v] by (-1)\n    end\n    if <([direction v] of [klamp v]) < [0]> then\n        change [x-fart v] by (1)\n    end\nend\n\nwhen I start as a clone\ngo to (klamp v)\npoint in direction (pick random (0) to (360))\nswitch costume to (klädsel1 v)\nshow\nstart sound [Kast v]\nrepeat until <touching (bana v)?>\n    turn left (15) degrees\n    change y by ((Y-Fart) * (1.8))\n    change x by (X-Fart)\n    change [y-fart v] by (-1)\nend\nrepeat (3)\n    next costume\nend\ndelete this clone\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <([x position v] of [spelare v]) < (x position)> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <([x position v] of [spelare v]) > (x position)> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\nwhen I receive [continue-button v]\nstop [other scripts in sprite v]\nhide\n\n@Raket\n\nwhen flag clicked\nhide\n\nwhen I receive [klamp: raket v]\nswitch costume to (raket v)\nset x to ([x position v] of [klamp v])\nset y to (([y position v] of [klamp v]) + (10))\npoint in direction (90)\nshow\nset [y-fart v] to [-2]\nstart sound [Uppskjutning v]\nrepeat until <(y position) > [200]>\n    change y by (Y-Fart)\n    turn right (pick random (-5) to (5)) degrees\n    change [y-fart v] by (2)\nend\nhide\nwait (1) seconds\nstart sound [Smäll v]\nbroadcast (Eldbollar från himlen v)\n\nwhen I receive [eldbollar från himlen v]\nswitch costume to (raketavfall v)\nset [y-fart v] to [-8]\npoint in direction (90)\nset y to (180)\nrepeat (20)\n    set x to (pick random (-210) to (210))\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nrepeat (pick random (16) to (20))\n    change y by (Y-Fart)\n    change [y-fart v] by (0.3)\nend\nrepeat (3)\n    move (pick random (-5) to (5)) steps\n    point in direction (pick random (0) to (360))\n    next costume\nend\ndelete this clone\n\nwhen I receive [continue-button v]\nrepeat (22)\n    delete this clone\nend\nstop [other scripts in sprite v]\nhide\n\n@Smällfärg\n\nwhen I receive [klamp: raket v]\nwait (1.6) seconds\nset [ghost v] effect to (50)\nshow\nrepeat (20)\n    change [ghost v] effect by (2.5)\nend\nhide\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\n@Eldbollar\n\nwhen flag clicked\nhide\n\nwhen I receive [eldbollar från himlen v]\nwait (1) seconds\nset [klamp: attack igång? v] to [0]\nset y to (180)\nrepeat (8)\n    wait (0.2) seconds\n    set x to (pick random (-210) to (210))\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nrepeat until <<<touching (bana v)?> or <touching (vatten v)?>> or <<touching (bur v)?> or <touching (klamp v)?>>>\n    change y by (-3)\n    change x by (pick random (-1) to (1))\n    next costume\n    if <(costume [number v]) = [5]> then\n        switch costume to (klädsel2 v)\n    end\nend\nswitch costume to (klädsel8 v)\nrepeat (2)\n    next costume\nend\ndelete this clone\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <([x position v] of [spelare v]) < (x position)> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <([x position v] of [spelare v]) > (x position)> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\nwhen I receive [continue-button v]\nrepeat (35)\n    delete this clone\nend\nstop [other scripts in sprite v]\nhide\n\n@Boomerang\n\nwhen I receive [klamp: boomerang v]\nwait (0.1) seconds\ngo to (klamp v)\nset x to (([x position v] of [klamp v]) - (5))\nset y to (([y position v] of [klamp v]) + (5))\npoint in direction (180)\nif <([direction v] of [klamp v]) > [0]> then\n    set [x-fart v] to [13]\nend\nif <([direction v] of [klamp v]) < [0]> then\n    set [x-fart v] to [-13]\nend\nshow\nstart sound [Kast v]\nrepeat until <<([abs v] of ((x position) - ([x position v] of [spelare v])) ) < [30]> or <touching (_edge_ v)?>>\n    change x by (X-Fart)\n    if <([direction v] of [klamp v]) > [0]> then\n        turn right (20) degrees\n    end\n    if <([direction v] of [klamp v]) < [0]> then\n        turn left (20) degrees\n    end\nend\nif <([direction v] of [klamp v]) > [0]> then\n    repeat (26)\n        change [x-fart v] by (-1)\n        change x by (X-Fart)\n        turn right (20) degrees\n    end\nend\nif <([direction v] of [klamp v]) < [0]> then\n    repeat (26)\n        change [x-fart v] by (1)\n        change x by (X-Fart)\n        turn left (20) degrees\n    end\nend\nrepeat until <([abs v] of ((x position) - ([x position v] of [klamp v])) ) < [20]>\n    change x by (X-Fart)\n    if <([direction v] of [klamp v]) > [0]> then\n        turn right (20) degrees\n    end\n    if <([direction v] of [klamp v]) < [0]> then\n        turn left (20) degrees\n    end\nend\nset [klamp: attack igång? v] to [0]\npoint in direction (90)\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [tick - spelare v]\nif <(Skadeläge) = [0]> then\n    if <touching (spelare v)?> then\n        if <([x position v] of [spelare v]) < (x position)> then\n            set [skadeläge v] to [11]\n            broadcast (Skada v)\n        end\n        if <([x position v] of [spelare v]) > (x position)> then\n            set [skadeläge v] to [12]\n            broadcast (Skada v)\n        end\n    end\nend\n\nwhen I receive [continue-button v]\nstop [other scripts in sprite v]\nhide\n\n@Nyckel\n\nwhen flag clicked\nswitch costume to (klädsel2 v)\nhide\n\nwhen I receive [finalboss: slut v]\ngo to x: (240) y: (-30)\npoint in direction (-120)\nset [gravitation v] to [6]\nset [kraft v] to [-7]\nswitch costume to (klädsel2 v)\nshow\nrepeat until <<touching (banlinje v)?> and <(Gravitation) < [0]>>\n    change y by ((Gravitation) * (1.8))\n    change x by (Kraft)\n    turn left (15) degrees\n    change [gravitation v] by (-0.2)\nend\npoint in direction (90)\nbroadcast (Ta nyckeln! v)\nforever\n    wait (1) seconds\n    switch costume to (klädsel2 v)\n    repeat (3)\n        repeat (13)\n            next costume\n            if <(costume [number v]) = [14]> then\n                switch costume to (klädsel2 v)\n            end\n        end\n    end\nend\n\nwhen I receive [kan ta nyckeln v]\nwait (0.5) seconds\nwait until <touching (spelare v)?>\nstop [other scripts in sprite v]\nstart sound [Ring v]\nswitch costume to (krympa #1 v)\nrepeat (2)\n    next costume\nend\nhide\nset [story-läge v] to [1]\nbroadcast (Story-läge v)\nbroadcast (BB: Rescued v)\n\n