-
Notifications
You must be signed in to change notification settings - Fork 219
How to add an item
This page is meant to guide you through the creation of a basic item.
Every sprite in the game is present in three sizes conveniently put into the following folders:
- client/img/1: smallest sprites, meant for a map with 16x16 pixels tiles;
- client/img/2: medium sprites, meant for a map with 32x32 pixels tiles;
- client/img/3: bigest sprites, meant for a map with 48x48 pixels tiles; To keep inline with the visual style of the game, instead of drawing big sprites and then reducing them, one should create the sprites for the smallest map and enlarge them (with no extrapolation whatsoever).
This should be a png file with transparent background containing all the "states" for your object's animations in a line. Each animation (action) is a line. The name of the png file should be explicit. e.g.: item-rosettastone.png
This should be done by creating a .json file to the name of your item in the folder client/sprites. In our example, we will call it « item-rosettastone.json ». The content of this file is as follows… The content of the file is pretty straightforward, except the offset. The image produced will be put on a tile on the map. The "row" will indicate the row (0: first, 1: second) whose top left corner will be put on the top left corner of the tile it is associated with. For sprites bigger than a tile, it is therefore necessary to specify an offset to know where is situated the tile supporting the item. The offset will tell how many pixels and in which direction the whole row should be moved. This tile will be the one the user will have to loot in order to collect the object (active tile in the above figure).
To add the item to the map it should be added under the form of a 16x16 tile to the mobset.png used to edit the map and a type property should be added to this tile, containing the name of the item (without item). e.g.: type → rosettastone in our example. You then can add it like any other item.