You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Along the way I'm working around with javascript packages, I noticed that it looks like the best practice is using closures instead of Class when handling modularization.
So in our game framework, I also took this approach, in which case, most of the game components like canvasUtils, drag n drop, AI, should export something like createXX(). But for some of the base class like Sprite and Particle, the intuitive way is to use class. So I think I should just mix them up.
But like you can see, everything inside the src/component folder uses class, while other modules outside uses closure.
Just to clarify things up.
The text was updated successfully, but these errors were encountered:
Along the way I'm working around with javascript packages, I noticed that it looks like the best practice is using closures instead of
Class
when handling modularization.So in our game framework, I also took this approach, in which case, most of the game components like
canvasUtils
,drag n drop
,AI
, should export something likecreateXX()
. But for some of the base class likeSprite
andParticle
, the intuitive way is to use class. So I think I should just mix them up.But like you can see, everything inside the
src/component
folder usesclass
, while other modules outside uses closure.Just to clarify things up.
The text was updated successfully, but these errors were encountered: