Loading the character objects (player and enemy)
Character objects must be first loaded within the Tiled program by creating an object layer. You can do this by performing the following steps:
Click on Layer and select Add Object Layer.
On the right-hand side pane, rename the layer as
Characters
.Then import the tile sets/sprites of our characters by clicking on Map, then selecting New Tileset, and then importing the tile set as shown in the following screenshot:
Be sure of the size of each cell in the sprite, as shown in the preceding screenshot. The sprite cell size is 32 x 32. We can now place the objects in the preferred position. After you place the object, right-click on it and set the object property (the type is either enemy or player) for our player, as shown in the following screenshot:
We can follow the same set of instructions for the enemy:
Set the type as enemy
, create a value of -1
, and give it a name dir
on the table, as seen in the preceding screenshot. This is because we'll be...