Roadworks 2 [Platformer]


@Stage\n\nwhen flag clicked\nswitch backdrop to (cityscape v)\nforever\n    if <(Level) = [18]> then\n        switch backdrop to (cityscape2 v) and wait\n    end\nend\n\nset [level v] to [18]\n\n@Player\n\nwhen flag clicked\nset size to (100) %\nset [level v] to [1]\npoint in direction (90)\nerase all\npen up\nshow\nset [yv v] to [0]\ngo to x: (-214) y: (-44)\nset [deaths v] to [0]\nset [jump count v] to [0]\nset [grav v] to [1]\nforever\n    if <(Level) = [17]> then\n        turn right (30) degrees\n    else\n        point in direction (90)\n    end\n    if <(Level) = [18]> then\n        set size to (100) %\n    else\n        point in direction (90)\n    end\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 (Grav)\n        if <touching color (#666666)?> then\n            change y by (Grav)\n            if <touching color (#666666)?> then\n                change y by (Grav)\n                if <touching color (#666666)?> then\n                    change y by (Grav)\n                    if <touching color (#666666)?> then\n                        change y by (Grav)\n                        if <touching color (#666666)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (((0) - (Grav)) * (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 ((Grav) * (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 ((0) - (Grav))\n    change y by (Yv)\n    if <touching color (#666666)?> then\n        change y by ((Yv) * ((0) - (Grav)))\n        set [yv v] to [-0]\n    else\n    end\n    change y by ((0) - (Grav))\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 (Grav)\n    if <<(x position) = [235]> or <(x position) > [235]>> then\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 <touching color (#00ffff)?> then\n        set size to (40) %\n    end\n    if <key (r v) pressed?> then\n        go to x: (-213) y: (8)\n    end\nend\n\nif <touching color (#666666)?> then\nend\n\nset [level v] to [17]\n\nset [yv v] to [-1]\n\n@Sprite1\n\nwhen flag clicked\nstart sound [recording1 v]\ngo to x: (0) y: (0)\nset [grav v] to [1]\nset [level v] to [1]\ngo [backward v] (1) layers\nswitch costume to (costume1 v)\n\nwhen I receive [message1 v]\nnext costume\nchange [level v] by (1)\nif <(Level) = [17]> then\n    repeat until <not <(Level) = [17]>>\n        set [grav v] to (pick random (-2) to (0.5))\n    end\n    set [grav v] to [1]\nelse\n    set [grav v] to [1]\nend\n\nset [level v] to [10]\nbroadcast (message1 v)\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) = [6]> 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) = [6]> or <(Level) = [11]>> 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)\nshow\ngo to [front v] layer\nhide\n\nshow\n\n