Flat (platformer)
@Stage\n\nwhen I receive [message1 v]\nnext backdrop\n\n@ Ball\n\nwhen flag clicked\nset [deaths v] to [0]\nforever\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nset [y spawn v] to [-110]\nset [x spawn v] to [-224]\ngo to x: (X Spawn) y: (Y Spawn)\nset size to (50) %\nforever\n    if on edge, bounce\n    change [y v] by (-.5)\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [x v] by (-1)\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [x v] by (1)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change y by (1)\n                            if <touching color (#000000)?> then\n                                change y by (-6)\n                                change x by ((x) * (-1))\n                                if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                                    set [y v] to [10]\n                                    if <(x) > [0]> then\n                                        set [x v] to [-10]\n                                    else\n                                        set [x v] to [10]\n                                    end\n                                else\n                                    set [x v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (y)\n    if <touching color (#000000)?> then\n        change y by ((y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-0.5)\n    if <<touching color (#000000)?> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        set [y v] to [8]\n    end\n    change y by (0.5)\n    if <touching color (#ff0000)?> then\n        go to x: (X Spawn) y: (Y Spawn)\n        change [deaths v] by (1)\n    end\n    if <touching color (#003fff)?> then\n        set [y v] to [16]\n    end\n    if <<(x position) > [227]> and <(y position) > [-155]>> then\n        broadcast (message1 v)\n        go to x: (X Spawn) y: (Y Spawn)\n    end\nend\n\nwhen I start as a clone\nrepeat (10)\n    change [ghost v] effect by (25)\n    change size by (-3)\nend\ndelete this clone\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\n@TN\n\nwhen flag clicked\nshow variable [deaths v]\nhide\n\n