-
Notifications
You must be signed in to change notification settings - Fork 21
Layer name conventions
Simon edited this page Sep 29, 2019
·
5 revisions
There are certain conventions to consider when creating new layers in the map. For examples refer to the assets/map folder located at the root of the project:
- Tile Layers that start with bgd are treated as background layers. They are rendered in the back of entities like characters or items. All other Tile Layers are treated as foreground layers and are rendered in front of entities.
- The framework supports an Object Layer called collision. In this layer you can draw any type of shape. Those shapes end up as box2d static bodies in the game and are used for collision objects.
- Another supported Object Layer is enemy. In this layer you can place Point objects with a single custom property called Character which represents the
Character
enum value of theCharacter.kt
file. The framework will then spawn enemy entities of the specified type at the location of the point - Similar to the enemy Object Layer you can also create an item layer. The custom property is called Item which represents the
Item
enum value of theItem.kt
file. - Within the portal Object Layer you can place rectangle objects with three custom properties. TargetMap represents the
MapType
enum value of theMap.kt
file. TargetOffsetX specifies the position where the player will end up. Per default it is the position of the TargetPortalID property which represents the ID of the portal object where you want to end up. The TargetOffsetX allows you to spawn a certain range to the left or right of the portal. This is needed because otherwise you will spawn directly in the portal and trigger it. - Finally, there is a playerSpawnLocation Object Layer where you can place a single Point object. This is the location where the player will spawn.