Create game objects based on existing images and incorporate to them physic behaviours, movements, statistics, action commands, artificial intelligence, etc.
Each game object will be composed by several components that will be developed independently and will determine the object behaviour in the game environment: the movement, gravity effect, collisions with other game objects..
The graphics component of a game object defines the game object images that will be shown during the game, defining the visual aspect of a character, background, a platform, a projectile, etc.
The first thing to do is to load the existent image that contains all the posible movement positions ("sprites"). Each frame will represent a game object state. The frames could be created manually, using the mouse to cut them or the automatically grid provided when choosing the rows and columns number that the sprite will be divided into.
Each frame will be defined by a state, an orientation, the appereance order and its duration, in milliseconds.
When all the frames are defined, they will be saved.
The physics component defines the game object position and the collisions response. Each game object must have a physics component to be represented at the level, because it is in charge of setting up its position.
In the central region the rectangle that will be considered for determining the collision with other game objects will be defined. When the game object won't collide with any other object, the transparent collisions checkbox will be selected. It will be generally indicated for bakgrounds or supports, for example. If we want that the game obejct will be affected by the collision with other game objects, the correspondent checkbox will be marked, for instance for characters or game objects that will be over a platform.
The collision mass will be considered for calculating the collision result. Objects with bigger masses will shift objects with smaller ones when they collide. Finally, the gravity effect parameter will indicate how the gravity specified at the level will affect each game object.
There are several physics components types with different characteristics: Supports, carriers, attack physics components and one specific for the level, the Gravity physics component, that defines the gravity that will affect the game objects.
Defines the way an object could change it's state from one to another, for example changing from the idle state to the walking state, to the jumping state, etc. using some commands. Some objects will go only require the use of one state, such as a box or a scenary element. Others require several states, such us the main character in a videograme. The commands will be assigned to the input device controls or the own game object artificial intelligence.
During the state component design the posible states will be specified, and the transitions between them will be added in a simple way with the mouse. After that, the command that will change from one transition to another must be specified.
This component defines the speed of a moving game object, the range of allowed speeds and the jump parameters when the jumping will be required, such as in platforms games.
This component defines the possible game object orientations and the initial orientation. For that the available frames for each state and orientation must be previously defined during the graphics component design. Para ello en el componente gráfico se deben haber definido los frames disponibles para cada orientación y cada estado.
This component will reflect the statistics that will be assigned to a game object. These will be shown in the game's HUD and could be modifying during the game.
You could also add global statistics related to a team or the whole game.
Once all the game object components are created they could be combined into the whole game object, then this will be available at the levels editor for being added to a level. Besides the previously explained components more specific components can be added to a game object, and they will be explained in next tutorials related to combat systems, inventory, cast, etc.
This tutorial will be created soon, when the project enters the next developing phase.