Bob's Adventure 2 - a platformer


@Stage\n\n@player\n\nwhen flag clicked\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    go to [front v] layer\n    set size to (35) %\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        switch costume to (looking v)\n        point in direction (135)\n        change [xv v] by (1)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        switch costume to (looking v)\n        point in direction (-141)\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching (level v)?> then\n        change y by (1)\n        if <touching (level v)?> then\n            change y by (1)\n            if <touching (level v)?> then\n                change y by (1)\n                if <touching (level v)?> then\n                    change y by (1)\n                    if <touching (level v)?> then\n                        change y by (1)\n                        if <touching (level v)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <<key (up arrow v) pressed?> or <key (w 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 (level v)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching (level v)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [yv v] to [15]\n        end\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nset [level v] to [1]\ngo to x: (-216) y: (-90)\n\nwhen flag clicked\nforever\n    if <(x position) = [243]> then\n        change [level v] by (1)\n        broadcast (new level v)\n    end\nend\n\nwhen I receive [new level v]\ngo to x: (-216) y: (-90)\n\nwhen I receive [die v]\ngo to x: (-216) y: (-90)\n\nwhen flag clicked\nforever\n    if <(y position) = [-182]> then\n        broadcast (die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (bad stuff v)?> then\n        broadcast (die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <<key (up arrow v) pressed?> or <<key (left arrow v) pressed?> or <key (right arrow v) pressed?>>>> then\n        switch costume to (standing v)\n    end\nend\n\nswitch costume to (standing v)\n\nwhen flag clicked\nforever\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        switch costume to (standing3 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (bad v)?> then\n        broadcast (die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (s v) pressed?> then\n        change [level v] by (1)\n        wait (1) seconds\n    end\nend\n\n@level\n\nwhen flag clicked\nforever\n    switch costume to (level)\nend\n\nset [level v] to [1]\n\n@instructions\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    switch costume to (level)\nend\n\nset [level v] to [14]\n\n@Sprite2\n\nwhen flag clicked\nwait (.5) seconds\nhide\n\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\n\n@bad\n\nwhen flag clicked\nforever\n    switch costume to (level)\nend\n\nset [level v] to [1]\n\n@old\n\nwhen flag clicked\nforever\n    hide\nend\n\n