-
Notifications
You must be signed in to change notification settings - Fork 21
Layer name conventions
Simon edited this page Mar 29, 2020
·
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. The Name of the object 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 Name represents the
Item
enum value of theItem.kt
file. - Within the portal Object Layer you can place rectangle objects with five 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
- Active defines if the portal is active or not. This can be useful to e.g. deactivate portals until a certain enemy is killed.
- FlipParticleFX defines if the particles of the portal should be rotated 180° to make the effect go the right instead of left
-
TargetMap represents the
- The playerSpawnLocation Object Layer where you can place a single Point object. This is the location where the player will spawn.
- npc Object Layer works the same as enemy or item layer
- savePoint Object Layer is used to place point objects that represent a checkpoint in the game where the player can save his progress
- trigger Object Layer is used to place triggers in the map that either react on player collision or immediatly when the map is entered. The Name must be equal to the filename and function name of the Kotlin file in the project. These files must be placed within the com.github.quillraven.quillysadventure.trigger package. The TriggerReactOnCollision custom property defines if the trigger reacts on player collision or not.