Game Development Reference
In-Depth Information
Now, run the game, go to the Options dialog, and tick the checkbox to activate the
monochrome filter shader program. The game screen should show up in a beautiful
grayscale tone as soon as the game is started. A screenshot of the game with the
enabled monochrome filter shader program is as follows:
The blue background color, which is actually created using OpenGL's
clear color, is not affected by our shader program. The reason behind
this is that the shader's effect is only applied during the rendering
of the game world where it is temporarily set in the sprite batch.
Moreover, the game world is rendered on top of the (blue) clear color,
which back then appeared to be a good idea just because it was an easy
and cheap way of making the clear color a part of the scene and get a
sky for free.
Adding alternative input controls
The last and rather short topic in this chapter will show you how to use the
peripheral devices using the example of accelerometers, which are very common
types of sensors in today's smartphones and tablets. Accelerometers are subsystems
that reliably and accurately detect and measure acceleration, tilt, shock, and
vibration. Basically, we just need to read the sensor data that is being measured by
the accelerometer hardware and later translate the data into values and/or ranges
suitable for our game.
 
Search WWH ::




Custom Search