patch a melonJS function
target object
target function
replacement function
patch
plugin
// redefine the me.game.update function with a new oneme.plugin.patch(me.game, "update", function () { // display something in the console console.log("duh"); // call the original me.game.update function this._patched();}); Copy
// redefine the me.game.update function with a new oneme.plugin.patch(me.game, "update", function () { // display something in the console console.log("duh"); // call the original me.game.update function this._patched();});
patch a melonJS function