Roadworks [Platformer]


@Stage\n\n@Hulk\n\nwhen flag clicked\ngo to x: (-50) y: (18)\nforever\n    repeat (50)\n        change x by (2)\n        if <<(Level) = [5]> or <(Level) = [11]>> then\n            show\n        else\n            hide\n        end\n    end\n    repeat (50)\n        change x by (-2)\n        if <<(Level) = [5]> or <(Level) = [11]>> then\n            show\n        else\n            hide\n        end\n    end\nend\n\n@Player\n\nwhen flag clicked\nset [level v] to [1]\nerase all\npen up\nshow\ngo to x: (-214) y: (-44)\nset [deaths v] to [0]\nset [jump count v] to [0]\nforever\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\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching color (#666666)?> then\n        change y by (1)\n        if <touching color (#666666)?> then\n            change y by (1)\n            if <touching color (#666666)?> then\n                change y by (1)\n                if <touching color (#666666)?> then\n                    change y by (1)\n                    if <touching color (#666666)?> then\n                        change y by (1)\n                        if <touching color (#666666)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <key (space v) pressed?>> 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 (#666666)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#666666)?> then\n        if <<<key (space v) pressed?> or <key (up arrow v) pressed?>> or <key (w v) pressed?>> then\n            set [yv v] to [15]\n            change [jump count v] by (1)\n        end\n    end\n    change y by (1)\n    if <<(x position) = [230]> or <(x position) > [230]>> then\n        change [level v] by (1)\n        go to x: (-213) y: (8)\n        broadcast (message1 v)\n    end\n    if <(y position) < [-150]> then\n        go to x: (-213) y: (8)\n        change [deaths v] by (1)\n    end\n    if <touching color (#fbb03b)?> then\n        go to x: (-213) y: (8)\n        change [deaths v] by (1)\n    end\n    if <touching color (#cc0000)?> then\n        if <key (up arrow v) pressed?> then\n            change [yv v] by (0.7)\n        end\n    end\n    if <key (r v) pressed?> then\n        go to x: (-213) y: (8)\n    end\nend\n\nif <(Level) = [13]> then\n    show\nelse\n    hide\nend\n\n@Level\n\nwhen I receive [message1 v]\nnext costume\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (-50) y: (-40)\nforever\n    repeat (50)\n        change x by (2)\n        if <(Level) = [9]> then\n            show\n        else\n            hide\n        end\n    end\n    repeat (50)\n        change x by (-2)\n        if <(Level) = [9]> then\n            show\n        else\n            hide\n        end\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nshow\ngo to [front v] layer\n\n