ColorSwitch - A Platformer

Instructions: Use arrow keys to move.\nPress space to change colors.\nPress s to skip levels.\nEnjoy!

@Stage\n\nwhen flag clicked\nforever\n    play sound [Go Cart v] until done\nend\n\n@Platformer\n\nwhen I start as a clone\nrepeat (20)\n    change size by (-5)\n    change [ghost v] effect by (10)\nend\nset size to (100) %\ndelete this clone\n\nwhen [space v] key pressed\nnext costume\n\nwhen flag clicked\nclear graphic effects\nswitch costume to (swappy c v)\nswitch backdrop to (backdrop1 v)\nbroadcast (message1 v)\nforever\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n        change [xv v] by (-0.7)\n    end\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n        change [xv v] by (0.7)\n    end\n    set [xv v] to ((xv) * (0.9))\n    change x by (xv)\nend\n\nwhen I receive [message1 v]\ngo to x: (-183) y: (-130)\nset [xv v] to [0]\nset [yv v] to [0]\nshow\nforever\n    if <(costume [number v]) = [1]> then\n        set [1 v] to [0]\n        if <<touching color (#000008)?> or <touching color (#00ffff)?>> then\n            change y by (1)\n            change [1 v] by (1)\n            if <<touching color (#000008)?> or <touching color (#00ffff)?>> then\n                change y by (1)\n                change [1 v] by (1)\n                if <<touching color (#000008)?> or <touching color (#00ffff)?>> then\n                    change y by (1)\n                    change [1 v] by (1)\n                    if <<touching color (#000008)?> or <touching color (#00ffff)?>> then\n                        change y by (1)\n                        change [1 v] by (1)\n                        if <<touching color (#000008)?> or <touching color (#00ffff)?>> then\n                            change y by (1)\n                            change [1 v] by (1)\n                            if <<touching color (#000008)?> or <touching color (#00ffff)?>> then\n                                change x by ((xv) * (-1))\n                                set [xv v] to [0]\n                                change y by (-5)\n                                if <key (up arrow v) pressed?> then\n                                    change x by (5)\n                                    set [c n v] to [-5]\n                                    if <<touching color (#000008)?> or <touching color (#00ffff)?>> then\n                                        set [xv v] to [-10]\n                                        set [yv v] to [12]\n                                    else\n                                        change x by (-10)\n                                        set [c n v] to [5]\n                                        if <<touching color (#000008)?> or <touching color (#00ffff)?>> then\n                                            set [xv v] to [10]\n                                            set [yv v] to [12]\n                                        end\n                                    end\n                                    change x by (c n)\n                                else\n                                    change [xv v] by ((0) - ((xv) / (1)))\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        set [yv v] to ((yv) * (0.9))\n        change y by (yv)\n        if <<touching color (#000008)?> or <touching color (#00ffff)?>> then\n            change y by ((yv) * (-1))\n            set [yv v] to [0]\n        end\n        change y by (-1)\n        if <key (up arrow v) pressed?> then\n            if <<touching color (#000008)?> or <touching color (#00ffff)?>> then\n                set [yv v] to [12]\n            end\n        end\n        change y by (1)\n        if <(yv) < [4]> then\n            change y by (-1)\n            if <not <<touching color (#000008)?> or <touching color (#00ffff)?>>> then\n                change [yv v] by (-1)\n            end\n            change y by (1)\n        end\n    end\n    if <(costume [number v]) = [2]> then\n        set [1 v] to [0]\n        if <<touching color (#000008)?> or <touching color (#00ff55)?>> then\n            change y by (1)\n            change [1 v] by (1)\n            if <<touching color (#000008)?> or <touching color (#00ff55)?>> then\n                change y by (1)\n                change [1 v] by (1)\n                if <<touching color (#000008)?> or <touching color (#00ff55)?>> then\n                    change y by (1)\n                    change [1 v] by (1)\n                    if <<touching color (#000008)?> or <touching color (#00ff55)?>> then\n                        change y by (1)\n                        change [1 v] by (1)\n                        if <<touching color (#000008)?> or <touching color (#00ff55)?>> then\n                            change y by (1)\n                            change [1 v] by (1)\n                            if <<touching color (#000008)?> or <touching color (#00ff55)?>> then\n                                change x by ((xv) * (-1))\n                                set [xv v] to [0]\n                                change y by (-5)\n                                if <key (up arrow v) pressed?> then\n                                    change x by (5)\n                                    set [c n v] to [-5]\n                                    if <<touching color (#000008)?> or <touching color (#00ff55)?>> then\n                                        set [xv v] to [-10]\n                                        set [yv v] to [12]\n                                    else\n                                        change x by (-10)\n                                        set [c n v] to [5]\n                                        if <<touching color (#000008)?> or <touching color (#00ff55)?>> then\n                                            set [xv v] to [10]\n                                            set [yv v] to [12]\n                                        end\n                                    end\n                                    change x by (c n)\n                                else\n                                    change [xv v] by ((0) - ((xv) / (1)))\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        set [yv v] to ((yv) * (0.9))\n        change y by (yv)\n        if <<touching color (#000008)?> or <touching color (#00ff55)?>> then\n            change y by ((yv) * (-1))\n            set [yv v] to [0]\n        end\n        change y by (-1)\n        if <key (up arrow v) pressed?> then\n            if <<touching color (#000008)?> or <touching color (#00ff55)?>> then\n                set [yv v] to [12]\n            end\n        end\n        change y by (1)\n        if <(yv) < [4]> then\n            change y by (-1)\n            if <not <<touching color (#000008)?> or <touching color (#00ff55)?>>> then\n                change [yv v] by (-1)\n            end\n            change y by (1)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching color (#fffd00)?> then\n        broadcast (message1 v)\n        switch backdrop to (next backdrop v)\n    end\nend\n\nwhen flag clicked\ncreate clone of (_myself_ v)\nset size to (100) %\nforever\n    if <touching color (#0021ff)?> then\n        go to x: (-91) y: (153)\n    end\n    if <touching color (#0017ab)?> then\n        go to x: (32) y: (146)\n    end\n    if <touching color (#001284)?> then\n        go to x: (151) y: (153)\n    end\nend\n\nwhen [s v] key pressed\nnext backdrop\ngo to x: (-183) y: (-130)\n\n