melonjs/melonJS — pull request #293 by Buffer-Overflow (2013-10-21 11:12:51+00:00)
Title: Modules

This pull request adds module functionality which covers #289. The DraggableEntity and DroptargetEntity are refactored to modules and so is the implementation code (D&D & multitouch examples and functional tests).

The modules use the module pattern. For connivence there is also a 'me.import' function, which replaces the functionality of the self executing function around modules, for easy and clear importing (used in the examples).

The 'mix' function can be used to be able to mix in needed abilities for a module (this can f.e. be seen in the D&D example). This functionality also paves the way for #211, where we can separate out the platform logic into a new module, which can be 'mixed in' the base entity.