Adventures of Crystal: A Platformer


@Stage\n\nwhen I receive [test account v]\nswitch backdrop to (screen shot 2016-03-31 at 3.55.10 pm v)\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [back2normal v]\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [finished! v]\nswitch backdrop to (screen shot 2016-03-31 at 4.21.00 pm v)\nwait (1) seconds\nbroadcast (finishedb v)\n\nwhen flag clicked\nbroadcast (message1 v)\n\nwhen flag clicked\nforever\n    play sound [Vexento -  Into The Unknown v] until done\nend\n\n@player\n\nwhen flag clicked\nset [lives v] to [30]\nhide variable [lives v]\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <key (right arrow v) pressed?> then\n        change [xv v] by (1)\n    end\n    if <key (left arrow 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 (#ffff99)?> then\n        change y by (1)\n        if <touching color (#ffff99)?> then\n            change y by (1)\n            if <touching color (#ffff99)?> then\n                change y by (1)\n                if <touching color (#ffff99)?> then\n                    change y by (1)\n                    if <touching color (#ffff99)?> then\n                        change y by (1)\n                        if <touching color (#ffff99)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <key (up arrow 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 (#ffff99)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#ffff99)?> then\n        if <key (up arrow v) pressed?> then\n            set [yv v] to [15]\n        end\n    end\n    change y by (1)\n    if <touching (end v)?> then\n        broadcast (nextbackdrop v)\n        go to x: (-197) y: (-79)\n    end\n    if <touching color (#ff0000)?> then\n        go to x: (-197) y: (-79)\n        change [lives v] by (-1)\n    end\n    if <touching color (#00ffff)?> then\n        go to (random position v)\n    end\nend\n\nwhen flag clicked\ngo to x: (-197) y: (-79)\n\nwhen [r v] key pressed\ngo to x: (-197) y: (-79)\n\n@text\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (-7) y: (135)\n\nwhen I receive [nextbackdrop v]\nnext costume\n\nwhen flag clicked\nset [show v] to [0]\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [6]> then\n        show variable [lives v]\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(lives) = [0]> then\n        broadcast (dead v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [15]> then\n        broadcast (test account v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [16]> then\n        broadcast (back2normal v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [17]> then\n        broadcast (finished! v)\n        stop [this script v]\n    end\nend\n\n@level\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\n\nwhen I receive [nextbackdrop v]\nnext costume\n\n@end\n\nwhen flag clicked\nshow\ngo to x: (9) y: (0)\n\n@dead\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [dead v]\nshow\nstop [all v]\n\n@done\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [finishedb v]\nhide variable [lives v]\nshow\n\nwhen flag clicked\n\n@thumbnail\n\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\n\nwhen I receive [message1 v]\nhide\n\n