We have come to the final part of our lesson. Here I will briefly explain how to display the dialed gaming score hit the ball in the hole, as well as the play of the game sounds in wav and mp3 music format.
If you get the ball in the hole runs the following code -
if ( m_bContactWithHoleDetected )
{
if ( o_so != NULL )
{
o_so->Show = true; //we note that it is necessary to display the plate holes
}
PlayGameSound(hole_hit_snd); //we play the sound of falling into the hole
m_bInHole = true; //note the condition that the ball fell into the hole - it is necessary to
//secure re falling into the same hole
//new hits are recorded in only a few seconds
m_iHoleHits++; //add the counter hits the holes
m_iScore = m_iHoleHits; //skid hits counter variable to display the game score
}
When the ball spontaneously changes its direction a sound is played -
CD3DGameApp::change_moved_ball_TimePause
//...
PlayGameSound(change_direction_snd);
Here we have turned the game -
Display of score points implemented in the method -
CD3DGameApp::RenderTextIndicators
Music playback is implemented in the method -
CD3DGameApp::FrameMove
in the form of code line -
g_MusicThemes.PlayNextTrack();
For the load of sounds, music, adjust the volume and other necessary actions are carried out special methods. Details here they will not consider all of them you can see for yourself in the source code of the game simple game.
In conclusion, it is possible to set the value in the parameter file to change the music volume
simple_game\Media\base\params.txt
With regard to the volume of sounds, and other possible questions that you may have - look for the answer in the source code.
Of course there are still many questions that you can consider. I will try to discover them in later lessons on how to create simple game, and other examples of games (which will soon be made).
Questions that were not considered:
The mechanism of the balance of the complexity of the game - for example, you can make to the ball gradually began jumping faster and faster (with growth of the gaming score) to the game gradually became more complicated.
You can realize that the ball hitting the hole briefly stuck in it.
There were ideas alternately control the movement of the ball, the landscape scenes or mixed control, when for example, the scene we can move left and right and up and down, it moves itself, and the ball can only move up and down and side to side, he moved himself. And to these control options are changed spontaneously in the game (depending on the complexity with its gradual increase, or just randomly).
You can also add more variety to the game - any variety of gaming units, objects and some additional mini-tasks, and so on.
There would be a fantasy.
I think that from the submitted soon to write something in the next lessons, but something maybe you implement and independently !
By studying the source code of the project simple_game, and experimenting with it, you can extend or modify the game and create on its basis some own.
It was the first lesson on creating games simple game on the engine fle game engine.
The new tutorials on creating other examples of games soon the topic will be continued and will be available soon
different genre focus and implement these or other interesting features of the game - - 2d and 3d graphics, platformers, shooters (shooting), action, strategy, logic, jigsaw puzzles, quests, hidden object, and many many more.
All of them will not be a full-fledged complete games, as they are realized only the basics, but will serve as a good basis for their own games in a particular genre. Allow to gain the necessary knowledge and experience.
If you have any interesting ideas, suggestions, personal development or you have already made your game on the basis of this example, and want to share - write to us !
Download the game finished simple game version 1.0.0 4.01.2017 (without sourse code).
Source code and other useful materials and tools you get with a paid subscription order !
Size: 51,8 Mb
To have the opportunity to create their own game on the basis of an example simple_game with unlimited possibilities of further expansion! - Subscribe to fle game engine -
Price:
13,333333333333
usd.
Subscribing to fle game engine You get an example of the game simple game with source code, and you can not just read everything that will be described below, but do yourself in your own application with the possibility of unlimited expansion. Also, you get
for the latest version Scene Editor fge 1.0.2 (on current moment) with support for more features: grid settings, scrolling, and more. In the free version, these features are not supported. more details about the distibutive of a paid subscription.