Brief talk about how I'm using TileD


One of the nice thing about TileD is it's versatility through simplicity. It doesn't try and tell you how to build your levels or designs, it doesn't give you a premade system to use and then try and work around to get the job done. It just gives you the tools you need, and then lets you do the rest. I decided to take a purely object oriented approach to creating my objects in TileD and how they hook into the Lua scripts for the game.

Basically, every object in the game inherits from a basic game object base class that I built in Lua. The sub classes then change what's needed for control (AI or player input), display (usually a sprite animation, but not always), and update (check messages from other objects and player input, act accordingly by changing the state for this object's FSM). This hook into TileD in a very simple fashion- every object in TileD has a type parameter. This Type is actually the object type. So when the map is loaded, this type is then instantiated dynamically from this field.

This can also allow further customization- each object has a series of custom properties, so when the map is loaded and this object is created, it will then pass the custom properties to the object's constructor. There will of course be base object properties that are pretty much the same across the board (and you can specify, or leave these as default), but for each subclass there could be an infinite number of other custom properties, allowing for unique abilities and powers that I can simply add into the code.

I found this process to be really quick and nimble when designing items and enemies and player code. Since every object acts pretty much in the same way, with small changes here and there, it gives me a lot of power. If I need to create a slime with, let's say, a different AI and pattern of movement and a slightly (bluer) image, I can just inherit the slime object, and change only the draw and AI functions. The draw would be super simple, just tinting it a different color in code. Or scaling it larger, whatever.

And then in TileD I just set the type to this new slime class, and there you go. It's quick, it's simple, and I can do pretty much anything with little overhead and planning.  

Get Emberglass

Buy Now$5.99 USD or more

Leave a comment

Log in with itch.io to leave a comment.