Any game, especially RPG (or strategies, tower defenses and other types of games) use units player dial with – player unit, MOBs and NPCs. In most cases they differs by characteristics and behavior, but in general they are similar, especially from the rendering perspective. Lets introduce animated units to Tiled Game Engine.
Let’s start from the basis – Tiled Map Editor doesn’t support animated units. Actually it doesn’t support units in general. Pity but true. But it supports different objects and we’ll use them for our purposes. Let’s start:
Now we need to define some properties for newly created object, so that Tiled Game Engine can parse it correctly. Let’s start from object typing. In the object properties type an object name (I called newly created object “Wyvern” and set type “unit”)
Well, we’re very close to finish unit creation in the map editor, not it’s time to take a break and deep into animation atlases and meta information.
As all we know any animation has at least 2 frames. But we are talking about animated units, that means it can move in different direction. Tiled Game Engine supports 8 direction on movements. As soon as unit can move we need to define several animation sequences – one per each direction.
So, let’s take a loot on the sprite map at right (click to get in full size). It looks like each sprite placed in the cell of the grid, where each row corresponds to the face direction and column – to the animation frame. But there are several animation sequences in that sprite sheet and we need to determinate, which sequence we need to play and when it actually finished. For that purposes we use information file, which describes all animation sequences.
We're making our best to provide good and valuable content. Please help us by clicking on one of the social icons, thanks for everything.