Skip to content

Instantly share code, notes, and snippets.

@krisavi
krisavi / gist:3803050
Created September 29, 2012 03:20
some modifications from other branch...
@@ -1293,6 +1293,16 @@
return null;
};
+ api.getEntityByID = function(id)
+ {
+ for (var i = objCount, obj; i--, obj = gameObjects[i];) {
+ if(obj.isEntity && obj.settings.id == id) {
+ return obj;
+ }
@krisavi
krisavi / patch
Created September 29, 2012 03:14
Diff of melonJS changes
--- /0.9.3_clean.js Sat Sep 29 06:12:29 2012
+++ /melonJS-0.9.3-nonmin.js Sat Sep 29 06:12:29 2012
@@ -1028,6 +1028,13 @@
* @type me.Viewport
* @name me.game#viewport
*/
+ api.paused = false;
+ /**
+ * a reference to the game viewport.
+ * @public
@krisavi
krisavi / random.js
Created September 29, 2012 01:43
Our extenderEntity for convinience
me.ExtendEntity = me.ObjectEntity.extend({
init: function(x, y, settings) {
// melonJS / Tiled sprite width and height fallback
if(settings.spritewidth == undefined) settings.spritewidth = settings.width || 32;
if(settings.spriteheight == undefined) settings.spriteheight = settings.height || 32;
this.parent(x, y, settings);
// melonJS position fix.
this.pos.y = y;