Repository navigation
Asset System
Asset handling in Korge-fleks is splitted in two parts:
- Asset pre-processing via Gradle-plugin
- Asset store for in game access
Here we discuss the Asset Store part.
The asset store is responsible to store all kind of game data like graphics, level maps, sounds, etc. and make it usable / consumable by entities of a Korge-fleks game.
Assets are separated by two types:
- CommonAssets
- WorldClusterAssets
CommonAssets are assets which are used throughout the whole game. They are not specific to a world or level. Examples for common assets are the player character's sprite frames, the player character's sound effects, the font for the UI, etc.
WorldClusterAssets are assets which are specific to a world and a cluster/section within a world. A world cluster can be seen as a section of a world which has its own specific assets. For example, a world cluster can be a part of the world map which has its own specific graphics (e.g. background, foreground, tilesets) and music. A world cluster can be used for example to separate the intro part of a world from the rest of the world. The intro part can have its own specific graphics and music which are not needed for the rest of the world. So it makes sense to load those assets only for the intro part and unload them after the intro part is finished. This can help to save memory and loading times for the rest of the world.
Good practices for world cluster assets are:
- Define a "common" cluster for each world which contains assets which are likely used in most clusters of the world. This can help to avoid loading and unloading of assets which are used in most clusters of the world and to keep the loading and unloading of assets for the specific clusters more efficient. For example, the common cluster can contain the tilesets for the level maps of the world and the parallax background images for the world. The specific clusters can then contain the specific assets for the different sections of the world (e.g. intro, boss fight section, etc.).
- Take care to use specific asset clusters in an area of chunks and mark this area by color in LDtk or the used level editor. This can help to keep an overview of which assets are used in which area of the world and to avoid loading and unloading of assets.
-
getGameObjectStateConfig(name): Get state config for a game object. -
getSound(name): -
getSpriteTexture(name: String): -
getBitmapTexture(name): -
getNinePatchSlice(name): -
getParallaxLayers(name): -
getFont(name): -
getTileSet(name): -
getTileMap(name):
to be continued...
Korge-fleks framework by jobe-m is based on Korge Game Engine and Fleks Entity Component System