New Tiling System!


Please ignore the art!

(It's being taken care of, I promise)

The restructure

I've practically re-written the game from the ground up at this point. I'm now using an Entity Component System (ECS) that integrates with LibGDX called Ashley. It's probably the most elegant way I've seen so far to make a game. Every major part is compartmentalized into it's own class. If I want to work on something specific, I can without ever thinking of any other aspect of the game.

It took some getting used to though. The first iteration of Larry's Adventure had a flow that was much like a waterfall in that there was one big render method. That method would then call subsequent methods in other classes and it keeps trickling down like that. Now that is all abstracted away in the ECS. It reminds me of Unity3D where everything just has an update method and it always gets called, no need to worry about it.

The new tiling system

I've been working on getting a better tile map system in place after the last atrocious effort. The code is mostly (more on that in a bit) much cleaner and I've removed the need for walls the size of the main tiles, they are now placed over top of the main ground tiles.

It took a fair bit of work to accomplish this effect, the walls in particular were a major issue. Each tile contains half wall sides, and quarter corners. The type of wall sprite used is determined by the cell map generated by the maze generation algorithm I implemented prior to working on the tiles. Now, I'm sure everyone's seen the crazy 200 line if statements in newbie code, sadly as of yet, that's exactly how I'm having to calculate what walls go where. It's not quite 200 lines of if statements but it's still pretty ugly.

Plans for the next update

Next up is working with Box2D to achieve collision with the walls and since I'll be using Box2DLights as well, the lighting system will come shortly after. Look forward to collision in next weeks devlog (I'm making this a regular thing now). If we're lucky, lights will be the week after!

Until the next one!
Keval

I also post updates on twitter here

Get Larry's Adventure

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.