Game Development Reference
In-Depth Information
Getting ready
The complete ready-to-build source code is located in the 1_Game folder of the
supplementary materials.
This game was released in 2011 by the topic's authors on Google Play in a somewhat
extended form. You can ind this game on the following websites, if you want to try it
on your Android device immediately: http://play.google.com/store/apps/
details?id=com.linderdaum.engine.multibricks and http://play.google.
com/store/apps/details?id=com.linderdaum.engine.multibricks_free .
Authors don't mind if you use the graphical artwork from this game in your own projects. It is
a learning tool and not a commodity.
Those interested in the general match-3 game mechanics can refer to the following Wikipedia
article: http://en.wikipedia.org/wiki/Match_3 .
How to do it…
The entire game screen is re-rendered every frame in several steps in the OnDrawFrame()
callback. Let's walk over its source code to see how to do it:
1.
The fullscreen background image is rendered clearing the graphics from the previous
frame. The image is stored as a square 512 x 512 .png ile and is rescaled to the full
screen restoring its proportions, as shown in the following screenshot:
Power-of-two image was used to make the game compatible with old
Android hardware. If you target OpenGL ES 3 as your minimal requirement,
you can use textures of arbitrary sizes.
 
Search WWH ::




Custom Search