Skip to content
Michael Aquilina edited this page Jun 10, 2013 · 16 revisions

Game Engine Internal Properties

DrawOrigin - Specifies the draw origin of the specified tile. It is important to note, that if the DrawOrigin specified is different to the default tiled origin of (0,1), then entities/tiles drawn with this Tile image will be displaced due to having a different origin. If you wish to keep the same positioning on the map, then the entities x and y values should be updated accordingly in the following fashion:

entity.X += (SourceTile.Origin.X - 0.0f) * SourceTile.GetSourceRectangle(null).Width;
entity.Y += (SourceTile.Origin.Y - 1.0f) * SourceTile.GetSourceRectangle(null).Height;

A Note about the above code

Passing null to the SourceTiles GetSourceRectangle() method is fine because it is not a drawable class > > that changes with time such as the Animation class.

'Some2DRPG' Tile Properties (Custom)

Impassable - If a tile contains the property 'Impassable', then no ground Character should be able to walk over the specified tile whenever it is found on the map. Optionally, a rectangular region can be specified to state where in the tile is considered impassable. The values of the region should be specified using relative float values, separated by commas. Some examples can be seen below:

Impassable   |   0.5, 0, 1.0, 0.5          // Top Right Corner
Impassable   |   0, 0, 0.5, 1.0            // Left Half
Impassable   |   0, 0.5, 1.0, 1.0          // Bottom Half
Impassable   |   0, 0, 0.5, 0.5            // Top Left Half

Entry - If a tile contains the property 'Entry', then its value will specify from which directions a ground Character may enter from. The value should be a space separated list containing one or more of the following: Up, Down, Left, Right.

MoveSpeed - decimal value specifying how slow/fast a ground entity should walk on on the tile. The standard speed would be set as 1.0. Anything lower would specify a slower movement speed (e.g. 0.80 would cause the character to move at 80% of his normal movement speed) and anything higher would make the character move faster (e.g. 1.20 would make the character move 20% faster than normal).

Damage - Causes an entity to take HP damage when walking over the tile. (TODO)