Game Development Reference
In-Depth Information
The value in scoreVisual is cast to an integer value to cut off the fraction. The
resulting intermediate value will be the score that is shown in the GUI for the
counting-up animation. To let the coin icon shake, we use a sine function with
different factors as input angles to find the offset for the temporary displacement of
the icon.
Summary
In this chapter, we used a variety of approaches to add our special effects, which
let the game become more and more alive. You learned about particle systems and
how they work in LibGDX. Particle effects can be easily designed using the powerful
particle editor, and it is recommended to use this instead of working them out in
code. You learned how a finished particle effect can be incorporated and controlled
in our existing game. You also learned how to achieve a wind effect using our simple
physics simulation to animate the clouds in the game world with just a few changes.
An introduction to Lerp was provided and how it can be applied to create smooth
movements for the game's camera and rocks that now appear to float on the water.
Also, parallax scrolling was added to the mountains in the background to increase
the game immersion even further. As a final touch, the game screen's GUI was
enhanced with subtle effects.
In the next chapter, we will enhance the multiple screens management that was
introduced in Chapter 7 , Menus and Options . Therefore, we will implement a flexible
system to easily create smoothly animated screen transitions that will upgrade the
screen switching.
 
Search WWH ::




Custom Search