~U.N.P.O.L.L.U.T.E.~ - a environment-related scrolling platformer # games
@Stage\n\nwhen flag clicked\nhide variable [☁ times won v]\nset volume to (100) %\nforever\n    play sound [Menu v] until done\nend\n\nwhen I receive [cutscenes v]\nFade sound\nset volume to (100) %\nstop [other scripts in sprite v]\nforever\n    play sound [Game v] until done\nend\n\nwhen I receive [wen v]\nshow variable [☁ times won v]\nchange [☁ times won v] by (1)\nFade sound\nset volume to (100) %\nstop [other scripts in sprite v]\nforever\n    play sound [Win v] until done\nend\n\nwhen I receive [looz v]\nshow variable [☁ times won v]\nFade sound\nset volume to (100) %\nstop [other scripts in sprite v]\nforever\n    play sound [Lose v] until done\nend\n\ndefine Fade sound\nrepeat (20)\n    change volume by (-5)\nend\nstop all sounds\n\n@Player\n\ndefine scroll\nturn right ((*Xv) * (3)) degrees\nif <<(*scroll x) < [-1000]> or <(*scroll x) > [1000]>> then\n    change [*scroll x v] by (round ((*Xv) / (10)))\nelse\n    change x by (() - (round ((x position) / (10))))\n    change [*scroll x v] by (round ((x position) / (10)))\n    broadcast (movex v)\nend\nif <(*scroll y) < [-10]> then\n    change [*scroll y v] by (round ((*Yv) / (10)))\nelse\n    change y by (() - (round ((y position) / (10))))\n    change [*scroll y v] by (round ((y position) / (10)))\n    broadcast (movey v)\nend\n\ndefine Movement + collisions\nif <<(!bad clouds remaining) = [0]> and <touching (teleporter v)?>> then\n    glide (1) secs to (teleporter v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    change [#level v] by (1)\n    Reset Player\n    broadcast (next level v)\nend\nif <<touching color (#c56ddb)?> or <touching color (#00ff08)?>> then\n    broadcast (die v)\n    wait (1.5) seconds\n    Reset Player\nend\nif <(#talkdone) > [0]> then\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [*xv v] by (1)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [*xv v] by (-1)\n    end\nend\nset [*xv v] to ((*Xv) * (0.92))\nchange x by (*Xv)\nif <touching (ground hitbox v)?> then\n    change y by (1)\n    if <touching (ground hitbox v)?> then\n        change y by (1)\n        if <touching (ground hitbox v)?> then\n            change y by (1)\n            if <touching (ground hitbox v)?> then\n                change y by (1)\n                if <touching (ground hitbox v)?> then\n                    change y by (-4)\n                    change x by ((*Xv) * (-1))\n                    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                        set [*yv v] to [12]\n                        if <(*Xv) > [0]> then\n                            set [*xv v] to [-10]\n                        else\n                            set [*xv v] to [10]\n                        end\n                    else\n                        set [*xv v] to [0]\n                    end\n                end\n            end\n        end\n    end\nend\nchange y by (*Yv)\nif <touching (ground hitbox v)?> then\n    change y by ((*Yv) * (-1))\n    set [*yv v] to [0]\n    change y by (-2)\n    set [*yv v] to ((<<key (up arrow v) pressed?> or <key (w v) pressed?>> * <touching (ground hitbox v)?>) * (12))\n    change y by (2)\nend\nif <key (q v) pressed?> then\n    set [*yv v] to [8]\nend\nchange [*yv v] by (-1)\n\nwhen flag clicked\nReset Player\nset [#level v] to [1]\nhide\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    go to x: ([x position v] of [player v]) y: ([y position v] of [player v])\n    point towards (mouse-pointer v)\nend\n\nwhen I receive [start v]\nshow\ngo to x: (0) y: (0)\nswitch costume to (player eye v)\ncreate clone of (_myself_ v)\nswitch costume to (player body v)\nReset Player\nforever\n    go to [front v] layer\n    go [backward v] (1) layers\n    Movement + collisions\n    scroll\nend\n\ndefine Reset Player\ngo to x: (0) y: (0)\nclear graphic effects\nset [*yv v] to [0]\nset [*xv v] to [0]\nset [*scroll x v] to [-1000]\nset [*scroll y v] to [10]\n\nwhen I receive [die v]\nrepeat (3)\n    show\n    wait (0.25) seconds\n    hide\n    wait (0.25) seconds\nend\nshow\n\nwhen I receive [wen v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [looz v]\nhide\nstop [other scripts in sprite v]\n\nset [#level v] to [3]\n\n@Ground Hitbox\n\nwhen I receive [movex v]\nset x to (() - (*scroll x))\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\nwhen I receive [movey v]\nset y to (() - (*scroll y))\n\nwhen I receive [start v]\nforever\n    go to [front v] layer\n    go to [front v] layer\n    switch costume to (#Level)\nend\n\nwhen I receive [looz v]\nstop [other scripts in sprite v]\n\nwhen I receive [wen v]\nstop [other scripts in sprite v]\n\n@Ground Art\n\nwhen I receive [movex v]\nset x to (() - (*scroll x))\n\nwhen I receive [movey v]\nset y to (() - (*scroll y))\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nshow\nforever\n    switch costume to (#Level)\nend\n\nwhen I receive [looz v]\nstop [other scripts in sprite v]\n\nwhen I receive [wen v]\nstop [other scripts in sprite v]\n\n@Air Gun\n\nwhen flag clicked\nhide\n\ndefine Spawn Clones\nrepeat (2)\n    change [_clone id v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <(_clone ID) = [1]> then\n    set rotation style [left-right v]\n    switch costume to (tank v)\n    point in direction (90)\n    forever\n        go to [front v] layer\n        go [backward v] (5) layers\n        go to (player v)\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            point in direction (90)\n        end\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            point in direction (-90)\n        end\n    end\nelse\n    if <(_clone ID) = [2]> then\n        switch costume to (rope and nozzle v)\n        forever\n            go to (player v)\n            go to [back v] layer\n            go [forward v] (10) layers\n            point towards (mouse-pointer v)\n        end\n    else\n        set [_!hit? v] to [1]\n        switch costume to (goodair v)\n        set [_x v] to ((x position) + (*scroll x))\n        set [_y v] to ((y position) + (*scroll y))\n        repeat until <<<touching (ground hitbox v)?> or <touching (_edge_ v)?>> or <touching (enemy ☁s v)?>>\n            go to [front v] layer\n            change [_x v] by (([sin v] of (direction) ) * (10))\n            change [_y v] by (([cos v] of (direction) ) * (10))\n            go to x: ((_x) - (*scroll x)) y: ((_y) - (*scroll y))\n        end\n        set [_!hit? v] to [0]\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nif <(_clone ID) = [2]> then\n    forever\n        if <mouse down?> then\n            if <(_clouds left) > [0]> then\n                set [_clone id v] to [3]\n                change [_clouds left v] by (-1)\n                move (60) steps\n                create clone of (_myself_ v)\n                go to (player v)\n                wait until <not <mouse down?>>\n                wait (0.75) seconds\n            end\n        end\n    end\nend\n\nwhen I receive [start v]\nset [_clouds left v] to [5]\nset [_!hit? v] to [0]\nset [_clone id v] to [0]\nshow\nSpawn Clones\nset [ghost v] effect to (100)\ngo to x: (2000) y: (2000)\nhide\n\nwhen I receive [die v]\nrepeat (3)\n    show\n    wait (0.25) seconds\n    hide\n    wait (0.25) seconds\nend\nshow\n\nwhen I receive [wen v]\nstop [other scripts in sprite v]\n\nwhen I receive [looz v]\nstop [other scripts in sprite v]\n\n@Empty/ notes\n\n@Background\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nshow\ngo to x: (0) y: (0)\nclear graphic effects\ngo to [back v] layer\n\nwhen I receive [clean air a little bit v]\nchange [brightness v] effect by (1)\nchange [ghost v] effect by (1)\n\nwhen I receive [die v]\nwait (1.5) seconds\nset [ghost v] effect to (#previous background)\nset [brightness v] effect to (#previous background)\n\nwhen flag clicked\nswitch costume to (costume1 v)\nset [#previous background v] to [0]\nwait until <(#Level) = [2]>\nset [#previous background v] to [5]\nwait until <(#Level) = [3]>\nset [#previous background v] to [12]\n\nwhen I receive [wen v]\ncreate clone of (_myself_ v)\n\nwhen I receive [looz v]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nshow\nset [ghost v] effect to (100)\nset [brightness v] effect to (0)\ngo [forward v] (10000) layers\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (0.1) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\n@Cutscenes\n\nwhen I receive [cutscenes v]\nshow\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nswitch costume to (1 v)\nswitch backdrop to (cutscene v)\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nforever\n    wait until <<mouse down?> or <key (space v) pressed?>>\n    if <key (space v) pressed?> then\n        switch costume to (6 v)\n    end\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    if <(costume [number v]) = [6]> then\n        switch backdrop to (unpolluted v)\n        hide\n        broadcast (start v)\n        stop [this script v]\n    else\n        next costume\n        wait (0.1) seconds\n        repeat (20)\n            change [ghost v] effect by (-5)\n        end\n        wait until <not <mouse down?>>\n    end\nend\n\n@Enemy ☁s\n\nwhen flag clicked\nhide\n\ndefine Spawn Clones\nif <(#Level) = [1]> then\n    repeat (5)\n        change [!bad clouds remaining v] by (1)\n        change [!clone id v] by (1)\n        create clone of (_myself_ v)\n    end\nelse\n    if <(#Level) = [2]> then\n        repeat (7)\n            change [!bad clouds remaining v] by (1)\n            change [!clone id v] by (1)\n            create clone of (_myself_ v)\n        end\n    else\n        if <(#Level) = [3]> then\n            repeat (20)\n                change [!bad clouds remaining v] by (1)\n                change [!clone id v] by (1)\n                create clone of (_myself_ v)\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nif <(#Level) = [1]> then\n    if <(!clone ID) = [1]> then\n        set [!x v] to ((300) + (*scroll x))\n        set [!y v] to ((-10) + (*scroll y))\n    else\n        if <(!clone ID) = [2]> then\n            set [!x v] to ((500) + (*scroll x))\n            set [!y v] to ((-10) + (*scroll y))\n        else\n            if <(!clone ID) = [3]> then\n                set [!x v] to ((700) + (*scroll x))\n                set [!y v] to ((-10) + (*scroll y))\n            else\n                if <(!clone ID) = [4]> then\n                    set [!x v] to ((715) + (*scroll x))\n                    set [!y v] to ((375) + (*scroll y))\n                else\n                    set [!x v] to ((1050) + (*scroll x))\n                    set [!y v] to ((-10) + (*scroll y))\n                end\n            end\n        end\n    end\nelse\n    if <(#Level) = [2]> then\n        if <(!clone ID) = [1]> then\n            set [!x v] to ((300) + (*scroll x))\n            set [!y v] to ((-10) + (*scroll y))\n        else\n            if <(!clone ID) = [2]> then\n                set [!x v] to ((500) + (*scroll x))\n                set [!y v] to ((-10) + (*scroll y))\n            else\n                if <(!clone ID) = [3]> then\n                    set [!x v] to ((700) + (*scroll x))\n                    set [!y v] to ((-10) + (*scroll y))\n                else\n                    if <(!clone ID) = [4]> then\n                        set [!x v] to ((715) + (*scroll x))\n                        set [!y v] to ((375) + (*scroll y))\n                    else\n                        if <(!clone ID) = [5]> then\n                            set [!x v] to ((1050) + (*scroll x))\n                            set [!y v] to ((-10) + (*scroll y))\n                        else\n                            if <(!clone ID) = [6]> then\n                                set [!x v] to ((950) + (*scroll x))\n                                set [!y v] to ((460) + (*scroll y))\n                            else\n                                set [!x v] to ((1100) + (*scroll x))\n                                set [!y v] to ((200) + (*scroll y))\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    else\n        if <(#Level) = [3]> then\n            if <(!clone ID) = [1]> then\n                set [!x v] to ((350) + (*scroll x))\n                set [!y v] to ((15) + (*scroll y))\n            else\n                if <(!clone ID) = [2]> then\n                    set [!x v] to ((900) + (*scroll x))\n                    set [!y v] to ((100) + (*scroll y))\n                else\n                    if <(!clone ID) = [3]> then\n                        set [!x v] to ((1000) + (*scroll x))\n                        set [!y v] to ((400) + (*scroll y))\n                    else\n                        if <(!clone ID) = [4]> then\n                            set [!x v] to ((1150) + (*scroll x))\n                            set [!y v] to ((500) + (*scroll y))\n                        else\n                            if <(!clone ID) = [5]> then\n                                set [!x v] to ((800) + (*scroll x))\n                                set [!y v] to ((900) + (*scroll y))\n                            else\n                                if <(!clone ID) = [6]> then\n                                    set [!x v] to ((700) + (*scroll x))\n                                    set [!y v] to ((900) + (*scroll y))\n                                else\n                                    if <(!clone ID) = [7]> then\n                                        set [!x v] to ((700) + (*scroll x))\n                                        set [!y v] to ((650) + (*scroll y))\n                                    else\n                                        if <(!clone ID) = [8]> then\n                                            set [!x v] to ((250) + (*scroll x))\n                                            set [!y v] to ((650) + (*scroll y))\n                                        else\n                                            if <(!clone ID) = [9]> then\n                                                set [!x v] to ((100) + (*scroll x))\n                                                set [!y v] to ((700) + (*scroll y))\n                                            else\n                                                if <(!clone ID) = [10]> then\n                                                    set [!x v] to ((-150) + (*scroll x))\n                                                    set [!y v] to ((200) + (*scroll y))\n                                                else\n                                                    if <(!clone ID) = [11]> then\n                                                        set [!x v] to ((-150) + (*scroll x))\n                                                        set [!y v] to ((950) + (*scroll y))\n                                                    else\n                                                        if <(!clone ID) = [12]> then\n                                                            set [!x v] to ((-150) + (*scroll x))\n                                                            set [!y v] to ((800) + (*scroll y))\n                                                        else\n                                                            if <(!clone ID) = [13]> then\n                                                                set [!x v] to ((-200) + (*scroll x))\n                                                                set [!y v] to ((-100) + (*scroll y))\n                                                            else\n                                                                if <(!clone ID) = [14]> then\n                                                                    set [!x v] to ((-200) + (*scroll x))\n                                                                    set [!y v] to ((130) + (*scroll y))\n                                                                else\n                                                                    if <(!clone ID) = [15]> then\n                                                                        set [!x v] to ((950) + (*scroll x))\n                                                                        set [!y v] to ((400) + (*scroll y))\n                                                                    else\n                                                                        if <(!clone ID) = [16]> then\n                                                                            set [!x v] to ((1100) + (*scroll x))\n                                                                            set [!y v] to ((-30) + (*scroll y))\n                                                                        else\n                                                                            if <(!clone ID) = [17]> then\n                                                                                set [!x v] to ((1300) + (*scroll x))\n                                                                                set [!y v] to ((-30) + (*scroll y))\n                                                                            else\n                                                                                if <(!clone ID) = [18]> then\n                                                                                    set [!x v] to ((1500) + (*scroll x))\n                                                                                    set [!y v] to ((-10) + (*scroll y))\n                                                                                else\n                                                                                    if <(!clone ID) = [19]> then\n                                                                                        set [!x v] to ((2100) + (*scroll x))\n                                                                                        set [!y v] to ((230) + (*scroll y))\n                                                                                    else\n                                                                                        set [!x v] to ((2150) + (*scroll x))\n                                                                                        set [!y v] to ((850) + (*scroll y))\n                                                                                    end\n                                                                                end\n                                                                            end\n                                                                        end\n                                                                    end\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nset [brightness v] effect to (0)\nset [ghost v] effect to (0)\nset size to (100) %\nforever\n    if <touching (_edge_ v)?> then\n        hide\n    else\n        show\n    end\n    set [!y v] to ((!y) + ([cos v] of (((timer) - (100)) * (300)) ))\n    go to x: ((!x) - (*scroll x)) y: ((!y) - (*scroll y))\nend\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    go [forward v] (100) layers\n    if <<(_!hit?) = [1]> and <touching (air gun v)?>> then\n        broadcast (clean air a little bit v)\n        repeat (20)\n            change [brightness v] effect by (5)\n        end\n        change [!bad clouds remaining v] by (-1)\n        wait until <<touching (air gun v)?> and <not <(_!hit?) = [1]>>>\n        repeat (10)\n            change [ghost v] effect by (10)\n            change size by (-10)\n        end\n        change [_clouds left v] by (1)\n        delete this clone\n    end\nend\n\nwhen I receive [next level v]\nif  then\n    delete this clone\nend\nset [*scroll x v] to [-1000]\nset [*scroll y v] to [10]\nset [!bad clouds remaining v] to [0]\nclear graphic effects\nshow\nset [!clone id v] to [0]\nSpawn Clones\nhide\n\nwhen I receive [wen v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [looz v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [die v]\nwait (1.52) seconds\nif  then\n    delete this clone\nend\nset [*scroll x v] to [-1000]\nset [*scroll y v] to [10]\nset [!bad clouds remaining v] to [0]\nclear graphic effects\nshow\nset [!clone id v] to [0]\nSpawn Clones\nhide\n\nwhen I receive [start v]\nset [!bad clouds remaining v] to [0]\nclear graphic effects\nshow\nset [!clone id v] to [0]\nSpawn Clones\nhide\n\n@cloud count\n\nwhen flag clicked\nhide variable [_clouds left v]\nhide variable [!bad clouds remaining v]\nhide\n\nwhen I receive [start v]\nswitch costume to (clouds left v)\ngo to x: (-190) y: (150)\ncreate clone of (_myself_ v)\nswitch costume to (clouds to be eliminated v)\ngo to x: (-185) y: (95)\nshow\ngo to [front v] layer\nshow variable [_clouds left v]\nshow variable [!bad clouds remaining v]\n\nwhen I start as a clone\nshow\ngo to [front v] layer\n\nwhen I receive [wen v]\ngo to [back v] layer\nstop [other scripts in sprite v]\n\nwhen I receive [looz v]\ngo to [back v] layer\nstop [other scripts in sprite v]\n\n@Assignments\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [start v]\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        glide (0.5) secs to x: (0) y: (120)\n    else\n        glide (0.5) secs to x: (0) y: (0)\n    end\n    go to [front v] layer\nend\n\nwhen I receive [wen v]\nstop [other scripts in sprite v]\n\nwhen I receive [looz v]\nstop [other scripts in sprite v]\n\n@Mission Control\n\nwhen flag clicked\nswitch costume to (1 v)\nset [#talkdone v] to [0]\nset [#times dead v] to [0]\nset [pixelate v] effect to (200)\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [start v]\nshow\nwait until <(#Level) = [1]>\nset [pixelate v] effect to (200)\nset [ghost v] effect to (100)\nrepeat (20)\n    change [pixelate v] effect by (-10)\n    change [ghost v] effect by (-5)\nend\nrepeat until <(costume [number v]) > [10]>\n    hide variable [_clouds left v]\n    wait until <<<key (s v) pressed?> or <key (down arrow v) pressed?>> or <key (x v) pressed?>>\n    if <key (x v) pressed?> then\n        switch costume to (10 v)\n    end\n    repeat (20)\n        change [pixelate v] effect by (10)\n        change [ghost v] effect by (5)\n    end\n    wait (0.1) seconds\n    next costume\n    set [pixelate v] effect to (200)\n    set [ghost v] effect to (100)\n    repeat (20)\n        change [pixelate v] effect by (-10)\n        change [ghost v] effect by (-5)\n    end\nend\nwait until <<key (s v) pressed?> or <key (down arrow v) pressed?>>\nrepeat (20)\n    change [pixelate v] effect by (10)\n    change [ghost v] effect by (5)\nend\nshow variable [_clouds left v]\nset [#talkdone v] to [1]\nwait until <(!bad clouds remaining) = [0]>\nset [pixelate v] effect to (200)\nset [ghost v] effect to (100)\nshow\nswitch costume to (12 v)\nrepeat (20)\n    change [pixelate v] effect by (-10)\n    change [ghost v] effect by (-5)\nend\nhide variable [_clouds left v]\nwait until <<key (s v) pressed?> or <key (down arrow v) pressed?>>\nrepeat (20)\n    change [pixelate v] effect by (10)\n    change [ghost v] effect by (5)\nend\nwait (0.1) seconds\nnext costume\nrepeat (20)\n    change [pixelate v] effect by (-10)\n    change [ghost v] effect by (-5)\nend\nwait until <<key (s v) pressed?> or <key (down arrow v) pressed?>>\nrepeat (20)\n    change [pixelate v] effect by (10)\n    change [ghost v] effect by (5)\nend\nshow variable [_clouds left v]\nwait until <(#Level) = [2]>\nswitch costume to (19 v)\nset [#talkdone v] to [0]\nset [pixelate v] effect to (200)\nset [ghost v] effect to (100)\nrepeat (20)\n    change [pixelate v] effect by (-10)\n    change [ghost v] effect by (-5)\nend\nrepeat until <(costume [number v]) > [21]>\n    hide variable [_clouds left v]\n    wait until <<<key (s v) pressed?> or <key (down arrow v) pressed?>> or <key (x v) pressed?>>\n    if <key (x v) pressed?> then\n        switch costume to (21 v)\n    end\n    repeat (20)\n        change [pixelate v] effect by (10)\n        change [ghost v] effect by (5)\n    end\n    wait (0.1) seconds\n    next costume\n    set [pixelate v] effect to (200)\n    set [ghost v] effect to (100)\n    repeat (20)\n        change [pixelate v] effect by (-10)\n        change [ghost v] effect by (-5)\n    end\nend\nwait until <<key (s v) pressed?> or <key (down arrow v) pressed?>>\nrepeat (20)\n    change [pixelate v] effect by (10)\n    change [ghost v] effect by (5)\nend\nshow variable [_clouds left v]\nset [#talkdone v] to [1]\nwait until <(#Level) = [3]>\nswitch costume to (23 v)\nset [#talkdone v] to [0]\nset [pixelate v] effect to (200)\nset [ghost v] effect to (100)\nrepeat (20)\n    change [pixelate v] effect by (-10)\n    change [ghost v] effect by (-5)\nend\nrepeat until <(costume [number v]) > [25]>\n    hide variable [_clouds left v]\n    wait until <<<key (s v) pressed?> or <key (down arrow v) pressed?>> or <key (x v) pressed?>>\n    if <key (x v) pressed?> then\n        switch costume to (25 v)\n    end\n    repeat (20)\n        change [pixelate v] effect by (10)\n        change [ghost v] effect by (5)\n    end\n    wait (0.1) seconds\n    next costume\n    set [pixelate v] effect to (200)\n    set [ghost v] effect to (100)\n    repeat (20)\n        change [pixelate v] effect by (-10)\n        change [ghost v] effect by (-5)\n    end\nend\nwait until <<key (s v) pressed?> or <key (down arrow v) pressed?>>\nrepeat (20)\n    change [pixelate v] effect by (10)\n    change [ghost v] effect by (5)\nend\nshow variable [_clouds left v]\nset [#talkdone v] to [1]\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go [forward v] (100000000000) layers\nend\n\nwhen I receive [die v]\nwait (1.6) seconds\nhide variable [_clouds left v]\nchange [#times dead v] by (1)\nif <(#times dead) = [1]> then\n    switch costume to (14 v)\nelse\n    switch costume to (pick random (15) to (18))\nend\nset [pixelate v] effect to (200)\nset [ghost v] effect to (100)\nrepeat (20)\n    change [pixelate v] effect by (-10)\n    change [ghost v] effect by (-5)\nend\nwait (0.1) seconds\nwait until <<key (s v) pressed?> or <key (down arrow v) pressed?>>\nrepeat (20)\n    change [pixelate v] effect by (10)\n    change [ghost v] effect by (5)\nend\nshow variable [_clouds left v]\nstop [this script v]\n\nwhen I receive [wen v]\nhide variable [_clouds left v]\nhide variable [!bad clouds remaining v]\nstop [other scripts in sprite v]\n\nwhen I receive [looz v]\nhide variable [_clouds left v]\nhide variable [!bad clouds remaining v]\nstop [other scripts in sprite v]\n\n@Menu Stuff\n\nwhen flag clicked\nset [#level v] to [1]\nreset timer\nshow\nclear graphic effects\nset size to (100) %\nswitch costume to (background v)\ngo to [front v] layer\nset [?fade? v] to [false]\nset [?clone id v] to [0]\ngo to x: (0) y: (0)\nCreate Clones\n\ndefine Create Clones\nrepeat (5)\n    change [?clone id v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <(?clone ID) = [1]> then\n    go to [front v] layer\n    forever\n        go to x: (0) y: ((120) + (([cos v] of (((timer) - (1)) * (200)) ) * (10)))\n        if <touching (mouse-pointer v)?> then\n            switch costume to (title2 v)\n            set [ghost v] effect to (50)\n        else\n            switch costume to (title v)\n            set [ghost v] effect to (0)\n        end\n    end\nelse\n    if <(?clone ID) = [2]> then\n        go to [front v] layer\n        forever\n            go to x: (0) y: ((50) + (([sin v] of (((timer) - (1)) * (200)) ) * (10)))\n            if <touching (mouse-pointer v)?> then\n                switch costume to (subtitle2 v)\n                set [ghost v] effect to (50)\n            else\n                switch costume to (subtitle v)\n                set [ghost v] effect to (0)\n            end\n        end\n    else\n        if <(?clone ID) = [3]> then\n            go to [front v] layer\n            forever\n                go to x: ((0) + (([cos v] of (((timer) - (1)) * (200)) ) * (10))) y: (-20)\n                if <touching (mouse-pointer v)?> then\n                    if <mouse down?> then\n                        set [?fade? v] to [true]\n                    end\n                    switch costume to (play button2 v)\n                    set [ghost v] effect to (30)\n                else\n                    switch costume to (play button v)\n                    set [ghost v] effect to (0)\n                end\n            end\n        else\n            if <(?clone ID) = [4]> then\n                go to [front v] layer\n                forever\n                    go to x: ((0) + (([sin v] of (((timer) - (1)) * (200)) ) * (15))) y: (-120)\n                    if <touching (mouse-pointer v)?> then\n                        switch costume to (instructions2 v)\n                        set [ghost v] effect to (30)\n                    else\n                        switch costume to (instructions v)\n                        set [ghost v] effect to (0)\n                    end\n                end\n            else\n                wait until <(?fade?) = [true]>\n                switch costume to (fade v)\n                set [ghost v] effect to (100)\n                go to [front v] layer\n                repeat (25)\n                    change [ghost v] effect by (-4)\n                end\n                broadcast (cutscenes v)\n            end\n        end\n    end\nend\n\nwhen I receive [cutscenes v]\nhide\ndelete this clone\n\n@Teleporter\n\nwhen I receive [start v]\ngo to [front v] layer\nshow\nforever\n    if <(!bad clouds remaining) = [0]> then\n        switch costume to (teleporter activated v)\n    else\n        switch costume to (teleporter idle v)\n    end\n    if <touching (_edge_ v)?> then\n        hide\n    else\n        show\n    end\n    if <<(*scroll x) < [-1000]> or <(*scroll x) > [1000]>> then\n    if <(*scroll y) < [-10]> then\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [wen v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [looz v]\nstop [other scripts in sprite v]\nhide\n\n@TN\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\nforever\n    go to [front v] layer\n    go [forward v] (99) layers\nend\n\n@Win/Lose\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nwait (1) seconds\nforever\n    if <(_clouds left) = [0]> then\n        broadcast (looz v)\n        wait (0.75) seconds\n        show\n        go to [front v] layer\n        go [forward v] (100) layers\n        switch costume to (lose 1 v)\n        wait until <mouse down?>\n        wait until <not <mouse down?>>\n        switch costume to (lose 2 v)\n        stop [this script v]\n    else\n        if <(#Level) = [4]> then\n            broadcast (wen v)\n            wait (0.75) seconds\n            show\n            go to [front v] layer\n            go [backward v] (100) layers\n            switch costume to (win 1 v)\n            wait until <mouse down?>\n            wait until <not <mouse down?>>\n            switch costume to (win 2 v)\n            stop [this script v]\n        end\n    end\nend\n\n