Got sidetracked (so I published a new library)
Got sidetracked from working on Fidough, so I published a library instead.
Fidough has Dogs and Treadmills and Walls and Dough and... and the more I worked on it, the more concerned I became that I was going to get eaten by complexity. Let's say this is popular, beyond my dreams of avarice; then expanding it will be pretty important. Adding new art assets is annoying but doable, but I was faced with a problem. Let's say for sake of argument that we have
class Mob extends Phaser.Physics.Arcade.Sprite {...} class Dog extends Mob {...} class CustomDog extends Dog {...} class PieRat extends Mob {...}
If CustomDog has more animations than Dog, I'm going to get into deep doo-doo and fast, because PieRat and Dog can both run, but their animations are different... I foresaw pain.
What I wanted to be able to do was have something like
class Running extends Mystery { } class Dog extends Mystery { } class CustomDog extends Mystery { } class PieRat extends Mystery { }
so that the logic for run existed in one place... and Dog (, CustomDog, PieRat, etc) merely implemented the animations for run (and dig etc).
Well! Wait no more, I've published phaser3 aspects on github & npm to fill that need.
You can now write code almost literally like the "good" example, and it will self-assemble and execute, just like you might want.
Now, back to what I was doing.





