Together with Pawel Brod we made this small JavaScript game from screatch for the js13kgames.com contest (2013 edition). We've got the 10th place in the mobile category!
You can check it out here: http://kdzwinel.github.io/TheBadLuckGame/
Code is modular and you can easily make similar games based on our work.