# I converted morphic.js to ES5 classes!

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)

Your two pictures look the same to me.

They, for one, changed this.world() to a getter function, accessed now by this.world. (I don’t really see what the point of doing that was.)

besides you changing the way the code looks, what does it do actually (besides break the "set rotation" option)