Color - A Platformer


@Stage\n\n@Player\n\nwhen flag clicked\ngo to x: (-165) y: (-130)\nset size to (100) %\n\ndefine Blue\nswitch costume to (costume6 v)\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>> then\n        switch costume to (costume6 v)\n        change [xv v] by (1)\n    end\n    if <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>> then\n        switch costume to (costume7 v)\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <<touching color (#bac6e1)?> or <touching color (#dedede)?>> then\n        change y by (1)\n        if <<touching color (#bac6e1)?> or <touching color (#dedede)?>> then\n            change y by (1)\n            if <<touching color (#bac6e1)?> or <touching color (#dedede)?>> then\n                change y by (1)\n                if <<touching color (#bac6e1)?> or <touching color (#dedede)?>> then\n                    change y by (1)\n                    if <<touching color (#bac6e1)?> or <touching color (#dedede)?>> then\n                        change y by (1)\n                        if <<touching color (#bac6e1)?> or <touching color (#dedede)?>> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-5]\n                                else\n                                    set [xv v] to [5]\n                                end\n                                set [yv v] to [10]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <<touching color (#bac6e1)?> or <touching color (#dedede)?>> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching color (#bac6e1)?> or <touching color (#dedede)?>> then\n        if <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n            set [yv v] to [15]\n        end\n    end\n    change y by (1)\n    if <touching (_edge_ v)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        go to x: (-165) y: (-130)\n        broadcast (next level v)\n        repeat (10)\n            go to x: (-165) y: (-130)\n            change [ghost v] effect by (-10)\n        end\n    end\n    if <<touching color (#ffc8b0)?> or <touching color (#b6de72)?>> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        go to x: (-165) y: (-130)\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        broadcast (dead v)\n    end\nend\n\nwhen flag clicked\nGreen\n\nwhen I receive [color switch! v]\nif <<(Color Switches) = [1]> or <(Color Switches) = [6]>> then\n    stop [other scripts in sprite v]\n    Red/Pink\nend\nif <<(Color Switches) = [2]> or <(Color Switches) = [4]>> then\n    stop [other scripts in sprite v]\n    Blue\nend\nif <<<(Color Switches) = [3]> or <(Color Switches) = [5]>> or <(Color Switches) = [7]>> then\n    stop [other scripts in sprite v]\n    Green\nend\n\nwhen I receive [greendead v]\nstop [other scripts in sprite v]\nGreen\n\nwhen I receive [pinkdead v]\nstop [other scripts in sprite v]\nRed/Pink\n\ndefine Red/Pink\nswitch costume to (costume4 v)\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>> then\n        switch costume to (costume4 v)\n        change [xv v] by (1)\n    end\n    if <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>> then\n        switch costume to (costume5 v)\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <<touching color (#deae99)?> or <touching color (#dedede)?>> then\n        change y by (1)\n        if <<touching color (#deae99)?> or <touching color (#dedede)?>> then\n            change y by (1)\n            if <<touching color (#deae99)?> or <touching color (#dedede)?>> then\n                change y by (1)\n                if <<touching color (#deae99)?> or <touching color (#dedede)?>> then\n                    change y by (1)\n                    if <<touching color (#deae99)?> or <touching color (#dedede)?>> then\n                        change y by (1)\n                        if <<touching color (#deae99)?> or <touching color (#dedede)?>> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-5]\n                                else\n                                    set [xv v] to [5]\n                                end\n                                set [yv v] to [10]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <<touching color (#deae99)?> or <touching color (#dedede)?>> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching color (#deae99)?> or <touching color (#dedede)?>> then\n        if <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n            set [yv v] to [15]\n        end\n    end\n    change y by (1)\n    if <touching (_edge_ v)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        go to x: (-165) y: (-130)\n        broadcast (next level v)\n        repeat (10)\n            go to x: (-165) y: (-130)\n            change [ghost v] effect by (-10)\n        end\n    end\n    if <<touching color (#bac6e1)?> or <touching color (#b6de72)?>> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        go to x: (-165) y: (-130)\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        broadcast (dead v)\n    end\nend\n\nwhen I receive [bluedead v]\nstop [other scripts in sprite v]\nBlue\n\ndefine Green\nswitch costume to (costume2 v)\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>> then\n        switch costume to (costume2 v)\n        change [xv v] by (1)\n    end\n    if <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>> then\n        switch costume to (costume3 v)\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <<touching color (#9dba60)?> or <touching color (#dedede)?>> then\n        change y by (1)\n        if <<touching color (#9dba60)?> or <touching color (#dedede)?>> then\n            change y by (1)\n            if <<touching color (#9dba60)?> or <touching color (#dedede)?>> then\n                change y by (1)\n                if <<touching color (#9dba60)?> or <touching color (#dedede)?>> then\n                    change y by (1)\n                    if <<touching color (#9dba60)?> or <touching color (#dedede)?>> then\n                        change y by (1)\n                        if <<touching color (#9dba60)?> or <touching color (#dedede)?>> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-5]\n                                else\n                                    set [xv v] to [5]\n                                end\n                                set [yv v] to [10]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <<touching color (#9dba60)?> or <touching color (#dedede)?>> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching color (#9dba60)?> or <touching color (#dedede)?>> then\n        if <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n            set [yv v] to [15]\n        end\n    end\n    change y by (1)\n    if <touching (_edge_ v)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        go to x: (-165) y: (-130)\n        broadcast (next level v)\n        repeat (10)\n            go to x: (-165) y: (-130)\n            change [ghost v] effect by (-10)\n        end\n    end\n    if <<touching color (#bac6e1)?> or <touching color (#deae99)?>> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        go to x: (-165) y: (-130)\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        broadcast (dead v)\n    end\nend\n\nwhen [up arrow v] key pressed\nplay sound [Pop2 v] until done\n\nwhen [r v] key pressed\nbroadcast (dead v)\n\n@Levels\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [deaths v] to [0]\nset [time v] to [0]\nhide variable [deaths v]\nhide variable [time v]\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [1]> then\n        set [level v] to [1]\n        set [color switches v] to [0]\n    end\n    if <(costume [number v]) = [2]> then\n        set [level v] to [2]\n        set [color switches v] to [0]\n    end\n    if <(costume [number v]) = [3]> then\n        set [level v] to [3]\n        set [color switches v] to [1]\n    end\n    if <(costume [number v]) = [4]> then\n        set [level v] to [4]\n    end\n    if <(costume [number v]) = [5]> then\n        set [level v] to [5]\n        set [color switches v] to [2]\n    end\n    if <(costume [number v]) = [6]> then\n        set [level v] to [6]\n    end\n    if <(costume [number v]) = [7]> then\n        set [level v] to [7]\n        set [color switches v] to [1]\n    end\n    if <(costume [number v]) = [8]> then\n        set [level v] to [8]\n        set [color switches v] to [3]\n    end\n    if <(costume [number v]) = [9]> then\n        set [level v] to [9]\n        set [color switches v] to [3]\n    end\n    if <(costume [number v]) = [10]> then\n        set [level v] to [10]\n        set [color switches v] to [4]\n    end\n    if <(costume [number v]) = [11]> then\n        set [level v] to [11]\n        set [color switches v] to [5]\n    end\n    if <(costume [number v]) = [12]> then\n        set [level v] to [12]\n        set [color switches v] to [5]\n    end\n    if <(costume [number v]) = [13]> then\n        set [level v] to [13]\n        set [color switches v] to [6]\n    end\n    if <(costume [number v]) = [14]> then\n        set [level v] to [14]\n        set [color switches v] to [6]\n    end\n    if <(costume [number v]) = [15]> then\n        set [level v] to [15]\n        set [color switches v] to [6]\n    end\n    if <(costume [number v]) = [16]> then\n        set [level v] to [16]\n        set [color switches v] to [7]\n    end\n    if <(costume [number v]) = [17]> then\n        set [level v] to [17]\n        show variable [deaths v]\n        show variable [time v]\n    end\nend\n\nwhen I receive [dead v]\nif <<<(costume [number v]) = [3]> or <(costume [number v]) = [10]>> or <(costume [number v]) = [13]>> then\n    broadcast (greendead v)\nend\nif <<<(costume [number v]) = [5]> or <(costume [number v]) = [8]>> or <(costume [number v]) = [16]>> then\n    broadcast (pinkdead v)\nend\nif <<(costume [number v]) = [7]> or <(costume [number v]) = [11]>> then\n    broadcast (bluedead v)\nend\n\nwhen I receive [dead v]\nchange [deaths v] by (1)\n\nwhen flag clicked\nrepeat until <(Level) = [17]>\n    wait (1) seconds\n    change [time v] by (1)\nend\n\n@Grass\n\nwhen flag clicked\nhide\ngo to x: (-82) y: (-82)\nforever\n    if <(Level) = [12]> then\n        switch costume to (costume1 v)\n        show\n        forever\n            glide (2.5) secs to x: (135) y: (-87)\n            glide (2.5) secs to x: (-82) y: (-82)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [13]> then\n        go to x: (-19) y: (12)\n        stop [other scripts in sprite v]\n        switch costume to (costume2 v)\n        show\n        forever\n            glide (2.5) secs to x: (167) y: (12)\n            glide (2.5) secs to x: (-19) y: (11)\n        end\n    end\nend\n\nwhen I receive [hidegrass v]\nhide\nstop [other scripts in sprite v]\n\n@Font by @-Fontify-\n\n@Color Switch!\n\nwhen flag clicked\nforever\n    if <(Level) = [5]> then\n        go to x: (-4) y: (-54)\n        clear graphic effects\n        show\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nclear graphic effects\nhide\n\nwhen flag clicked\nforever\n    if <(Level) = [1]> then\n        hide\n    end\n    if <(Level) = [2]> then\n        hide\n    end\n    if <(Level) = [4]> then\n        hide\n    end\n    if <(Level) = [9]> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [7]> then\n        go to x: (13) y: (63)\n        clear graphic effects\n        show\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [8]> then\n        go to x: (-132) y: (52)\n        clear graphic effects\n        show\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [3]> then\n        go to x: (-3) y: (-119)\n        clear graphic effects\n        show\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        broadcast (color switch! v)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        go to x: (10) y: (162)\n        wait (1) seconds\n    end\nend\n\nwhen I receive [dead v]\nif <(Level) = [3]> then\n    go to x: (-3) y: (-119)\n    clear graphic effects\n    show\nend\nif <(Level) = [5]> then\n    go to x: (-4) y: (-54)\n    clear graphic effects\n    show\nend\nif <(Level) = [7]> then\n    hide\n    go to x: (13) y: (63)\n    clear graphic effects\n    show\nend\nif <(Level) = [8]> then\n    go to x: (-132) y: (52)\n    clear graphic effects\n    show\nend\nif <(Level) = [10]> then\n    go to x: (-5) y: (123)\n    clear graphic effects\n    show\nend\nif <(Level) = [11]> then\n    go to x: (-9) y: (39)\n    clear graphic effects\n    show\nend\nif <(Level) = [13]> then\n    go to x: (-106) y: (45)\n    clear graphic effects\n    show\nend\nif <(Level) = [16]> then\n    go to x: (2) y: (-43)\n    clear graphic effects\n    show\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [10]> then\n        go to x: (-5) y: (123)\n        clear graphic effects\n        show\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [11]> then\n        go to x: (-9) y: (39)\n        clear graphic effects\n        show\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [13]> then\n        go to x: (-106) y: (45)\n        clear graphic effects\n        show\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [16]> then\n        go to x: (2) y: (-43)\n        clear graphic effects\n        show\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [14]> then\n        broadcast (hidegrass v)\n    end\nend\n\n@Clouds\n\nwhen flag clicked\ngo to [back v] layer\nset [ghost v] effect to (50)\nforever\n    go to x: (-430) y: (17)\n    show\n    switch costume to (pick random (1) to (3))\n    glide (20) secs to x: (456) y: (-19)\n    hide\n    wait (pick random (1) to (3)) seconds\nend\n\nwhen flag clicked\nforever\n    play sound [Nature Sounds v] until done\nend\n\nwhen flag clicked\nforever\n    play sound [Music v] until done\nend\n\n@Thumbnail\n\nwhen flag clicked\nshow\nclear graphic effects\ngo to x: (0) y: (0)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n