Scroling platformer ⚽️
@Stage\n\n@Sprite1\n\nwhen flag clicked\nswitch costume to (costume1 v)\nset [x v] to [0]\ngo to x: (-170) y: (-112)\nset [y v] to [0]\nforever\n    if <touching color (#ff0000)?> then\n        set [scrolly v] to [0]\n        set [scrollx v] to [0]\n        set [x v] to [0]\n        go to x: (-170) y: (-112)\n        set [y v] to [0]\n    end\n    if <key (right arrow v) pressed?> then\n        switch costume to (costume1 v)\n        change [x v] by (1)\n    end\n    if <key (left arrow v) pressed?> then\n        switch costume to (costume2 v)\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 (#a76600)?> then\n        change y by (1)\n        if <touching color (#a76600)?> then\n            change y by (1)\n            if <touching color (#a76600)?> then\n                change y by (1)\n                if <touching color (#a76600)?> then\n                    change y by (1)\n                    if <touching color (#a76600)?> then\n                        change y by (1)\n                        if <touching color (#a76600)?> then\n                            change x by ((x) * (-1))\n                            change y by (-5)\n                        end\n                        if <key (up arrow v) pressed?> then\n                            if <(x) > [0]> then\n                                set [x v] to [-5]\n                            else\n                                set [x v] to [5]\n                            end\n                            set [y v] to [10]\n                        else\n                            set [x v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y v] by (-1)\n    change y by (y)\n    if <touching color (#a76600)?> then\n        change y by ((y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#a76600)?> then\n        if <key (up arrow v) pressed?> then\n            set [y v] to [15]\n        end\n    end\n    change y by (1)\n    change [scrolly v] by ((y position) * (-1))\n    change [scrollx v] by ((x position) * (-1))\n    go to x: (0) y: (0)\nend\n\nwhen flag clicked\nforever\n    if <touching color (#549a10)?> then\n        broadcast (message1 v)\n    end\nend\n\nwhen flag clicked\nshow variable [time v]\nshow variable [high score v]\nset [time v] to [0]\nrepeat until <(A) = [1]>\n    wait (1) seconds\n    change [time v] by (1)\nend\n\nwhen flag clicked\nforever\n    if <(Time) < (High score)> then\n        if <(A) = [1]> then\n            set [high score v] to (Time)\n        end\n    end\nend\n\n@ground\n\nwhen flag clicked\nset [scrolly v] to [0]\nset [scrollx v] to [0]\nforever\n    go to x: (scrollx) y: (scrolly)\nend\n\n@Sprite2\n\nwhen flag clicked\nhide variable [a v]\nset [a v] to [0]\nhide\nforever\n    change [color v] effect by (2)\nend\n\nwhen I receive [message1 v]\nshow\nset [a v] to [1]\n\n
****************My first scrolling platformer*********************\n___________________________________________________\nGo as quick as possible to the green flag!\n(Arrows to move)\n\nAnd try to beat the high score!