This is NOT what I was planning on writing. I was going to load the tile map created last time, so that Scarfy had a world to run around in. I'd chosen a third-party library to do the heavy lifting, and things were going smoothly. Then it crashed...

Click here to watch the video on Odysee.

The Missing Feature

Why did it crash? Because the Tileson library currently can't handle tile-sets that are a collection of images. It failed with a divide by zero error. I just happened pick a tile-set that used individual images instead of a single tiled image. Lack of this feature is mentioned in the readme, but I didn't notice until now.

Third party libraries are great when they work. When they're buggy or have missing features, then small tasks quickly become big. These troubles are part and parcel of software development.

The bottom line is: there's no way I can get the tile-map loading code done today. Hence, I'm telling this story instead of showing Scarfy running around on-screen.

Click here for part 6 proper.

What to Do?

I have three options:

  1. Switch to the TMX library, and use the XML version of the tile-map. The downside: it has additional external dependencies, which is why I avoided it in the first place
  2. Rework the tile-set (and tile-map) to a single image. This would improve in-game performance, but would be time consuming
  3. Implement the missing feature in Tileson

I'm going to try option 3 first. All going well, Scarfy will be running around the tile-map soon, and Tileson users will benefit from the new feature.