I use VSCode for editing my code and I just cannot seem to get the correct name for functions using the original morphic.js (and I also hate this)
Morph.prototype.overlappedMorphs = function () {
//exclude the World
var world = this.world(),
fb = this.fullBounds(),
allParents = this.allParents(),
allChildren = this.allChildren(),
morphs;
morphs = world.allChildren();
return morphs.filter(m => {
return m.isVisible &&
m !== this &&
m !== world &&
!contains(allParents, m) &&
!contains(allChildren, m) &&
m.fullBounds().intersects(fb);
});
};
This is MUCH better (in my opinion):
overlappedMorphs () {
//exclude the World
var world = this.world,
fb = this.fullBounds(),
allParents = this.allParents,
allChildren = this.allChildren,
morphs;
morphs = world.allChildren;
return morphs.filter(m => {
return m.isVisible &&
m !== this &&
m !== world &&
!contains(allParents, m) &&
!contains(allChildren, m) &&
m.fullBounds.intersects(fb);
});
};
(sorry to those of you who clicked this and saw the orginal morphic, i put the wrong link in)
You can get the new morphic.js file here:
https://morphicplayground.studioreboot.repl.co/morphic2.js
took me 4 hours to convert (there's not a button to automatically do it so I had to do it by hand)