An InfiniTile biome is an scriptable object that holds all the information the manager uses to create infinite moving backgrounds. The manager can have multiple biomes and change them any given time.
To create an InfiniTile biome go to Assets/Create/InfiniTile Level
This will create an Scriptable object in the folder you are currently in.
When you click on it the next window will appear on your inspector.
Here you can create al the backgrounds you want. You can have multiple InfiniTile Levels in your project and change them easily thanks to the scriptable objects. The parameters of the scriptable object are listed below.
- Layers is the first available parameter. It refers on how many layers of sprites you want your level to have. You can add as many as you want but take in account that more processing power will be needed. The top layer will have the priority to render. So the last layer will appear as the farthest.
- Available Sprites This array contains the sprites that every tile will be using. Every sprite that you add to the array will appear in the final terrain and only in the layer it is child of.
- Movement speed is the velocity the Tiles move, keep in mind that if it is a negative number the tiles will change direction. This parameter can change during play mode.
- Tile Direction refers to the direction the tiles will move ****
- Tile Density is the chance a tile has to respawn after going outside the range. If the number is 1, all the tiles will always reappear. If the value is 0.5 the tiles have a 50% chance to reappear.
- Stepped Movement is the flag that tells if the movement will be continuous or step by step.
- Step Distance refers to the distance each tile will move every step.
- Time to Move is the time the it takes for the tiles to take a step.
- N Columns and N Rows are the parameters that control the amount of tiles the grid will have. Change these parameters in order to add or decrease their amount.
- Tile size represents the size of each individual tile. When the value is 1, each tile has the size of an Unity unit.
- Biome duration is how many seconds this layer will be used in the Tile Manager.
In order to make the manager charge the level. Drag and drop the scriptable object to the Level Data parameter of the Endless 2D script in the InfiniTile Manager prefab.
For more insight, contact us at: [email protected]