After setting up the base framework. I decided how to make ScaledJS Modular.

While coding I wouldn’t want JS to be clobbered in one single file. That’s actually the job of my grunt tasks.

So, I decided that there will be a couple of modules with some strict abstractions

  • ScaledGen – Main Generator Instance – Exposed to Devs
  • ScaledTmxGen – Generator for TMX Tiled Maps
  • ScaledMap – Containing 2D Map Related Content
  • ScaledTerrain – Terrain Related Information Only
  • ScaledEdgeDetector – Contains only a Cell & it’s Surrounding info

Modular code will help me make sure that my abstraction and encapsulation is perfect. Like for eg: Why would the edge detector need all the map values? – I believe it should only need the values of a cell & its surroundings so that it can decide what edge/texture to put in it.