Platform game tools are provided by the lionengine-game-platform
module, giving an oriented platform game
type development with specific classes and architecture.
In this section we will see how to use these main tools, and the way of we should use them.
The aim of an entity is to represent the player and the opponents, and also general objects which may interact which each of them. An entity can handle a gameplay, by using different states.
This is were are defined the different states of the entity (describing its actions)
The EntityPlatform
already includes a standard architecture, including the action definition, movement,
collision, and the animation. It can also be configured from an external file.
You can now see the projectile system in action. It is possible to create a more complex system by allowing a weapon switching system, and creating more complex launcher with different projectiles.
The background is a very important part of any game, as it represents the overall game atmosphere. A good background is not necessary complex, but being able of making complex background improves the chance of making a great game atmosphere.
This class allows to create a simple parallax scrolling, by controlling each line speed and location easily.
By using this class base you will be able to add a raster bar effet to the used sprite. This allow to render more colors than the base one.
Read carefully how this class is working. We are using BackgroundComponent
to add complex element to
our background, which will be rendered in the foreground (explained later).
This is the main background container, creating each part of our background. The complex middle parallax is simply
done by using the Parallax
class. Our implementation add a simple backdrop (gradient color).
You can now see the background system in action. You can see that we are using different class for the background, which are used in a single main one. This way it is easy to choose what we want to use and how.
Collisions are not the easiest part in a game, as they me be tricky to define, even for a simple game. Hopefully, the integrated architecture already does a lot of for us.
It is highly recommended to understand first how is working the map system !
This is were are defined the different collision types (such as ground, slope, spike...)
final TileCollisionEditor<TileCollision, Tile> editor = new TileCollisionEditor<>(new Map(), TileCollision.class); editor.start();
The map is responsible in tile creation. This is from this object that we will be able to access to the tiles.
You can now see the projectile system in action. It is possible to create a more complex system by allowing a weapon switching system, and creating more complex launcher with different projectiles.
This example will show how to completely use the collision from an entity to a map and its tiles. It will also show how group collision by category for a better accuracy.
It is highly recommended to understand first how is working the map system !
This is were are defined the different entity collision types (such as ground, slope...)
This is were are defined the different collision types (such as ground, slope, spike...)
This is were are defined the different entity collision category (such as center, knees, hands...)
Collision groups will be used here.
final TileCollisionEditor<TileCollision, Tile> editor = new TileCollisionEditor<>(new Map(), TileCollision.class); editor.start();
The map is responsible in tile creation. This is from this object that we will be able to access to the tiles.
You can now see the projectile system in action. It is possible to create a more complex system by allowing a weapon switching system, and creating more complex launcher with different projectiles.
This full tutorial will show how to create a simple prototype of mario, with a scrolling map and its collision, plus some additional entities and their interactions.
Tutorials are splited and sorted by letters, starting at "a" package.
Read next page: Strategy games