Tiled Maps
Replay: https://www.livecoding.tv/video/libgdxjam-day-2/ - https://www.livecoding.tv/video/libgdxjam-day-2-4/
One of the things I worked today on was maps. I started with the spacecraft map, specifically the cabin, since what I wanted to accomplish today, more than an actual map, was a test on what I could do with what libGDX offers to me.
There is an interesting API in libGDX for handling tiled maps: TiledMap, TiledMapLayer, and that. There is even a loader for loading TMX files from Tiled. I made a map using Tiled and then I could load it using the loader and it worked. The camera acted funny when scaling the window but for most of it, it works.
So, for example, I can have a class generating a TiledMap and then make use of an OrthographicCamera and an OrthogonalTiledMapRender to render my map. Of course, the TiledMap must load the textures by itself (the TMX loader would read them from the file), but that is not hard to deal with.
I'm using that system because I prefer to use an already existing API (even if it's hard to use manually) rather than having to create my own tile rendering system on top of libGDX. I suspect my API would be less optimal than what TiledMap is already, and I would waste time doing something that already exists.
In my next blog post I'll talk about what I added next: the player movement, which makes use of Ashley, a library that I wanted to use for this game.