melonjs/melonJS — pull request #288 by Buffer-Overflow (2013-10-15 05:40:12+00:00)
Title: Drag and drop

- Added Draggable and Droptarget entities (started putting entities in separate files, to make it more modular).
- Updated multitouch example to make use of the Draggable module.
- Added new example for drag and drop demonstrating the different check methods (overlap and contains)
- Added Jasmine for creating functional tests. To test game functions, the test runner will start a test game in the background which we can use to test against. Added plugin for Jasmine which adds support for afterAll and beforeAll functions and using the 'done' callback function for easy asych testing.
- Created first basic functional tests for Draggable and Droptarget

Notes:
To make it testable and flexible, the draggable entity transforms pointer events to minipubsub events, which it then responds to.
Because it makes modules portable, I've started to import (inject) needed dependencies into modules. This is also a first step to make better use of the module pattern, See also [this thread](https://groups.google.com/forum/#!topic/melonjs/-EJ0x0gRocY).
In the end it would imo be better to use composition (module based) for the entities instead of inheritance.