Game Development Reference
In-Depth Information
The
m_CharacterSet
variable holds the character set we will use for the HUD.
private BillBoardCharacterSet m_CharacterSet = null;
The
m_HUDTexture
holds a texture used for a HUD item.
private Texture m_HUDTexture = null;
The
m_HUDComposite
holds a reference to a BillBoard that will be used for a HUD item.
private BillBoard m_HUDComposite = null;
The HUD is
m_HUD
.
private HUD m_HUD = null;
The player's health is stored in
m_Health
.
private int m_Health = 100;
The player's score is stored in
m_Score
.
private int m_Score = 0;
The textures needed for
m_CharacterSet
are initialized in the
CreateCharacterSetTextures()
function
and placed in
m_CharacterSetTextures
. (See Listing 6-37.)
Listing 6-37. Creating the Textures for the Character Set
void CreateCharacterSetTextures(Context iContext)
{
// Numeric
m_CharacterSetTextures[0] = new Texture(iContext, R.drawable.charset1);
m_CharacterSetTextures[1] = new Texture(iContext, R.drawable.charset2);
m_CharacterSetTextures[2] = new Texture(iContext, R.drawable.charset3);
m_CharacterSetTextures[3] = new Texture(iContext, R.drawable.charset4);
m_CharacterSetTextures[4] = new Texture(iContext, R.drawable.charset5);
m_CharacterSetTextures[5] = new Texture(iContext, R.drawable.charset6);
m_CharacterSetTextures[6] = new Texture(iContext, R.drawable.charset7);
m_CharacterSetTextures[7] = new Texture(iContext, R.drawable.charset8);
m_CharacterSetTextures[8] = new Texture(iContext, R.drawable.charset9);
m_CharacterSetTextures[9] = new Texture(iContext, R.drawable.charset0);
// Alphabet
m_CharacterSetTextures[10] = new Texture(iContext, R.drawable.charseta);
m_CharacterSetTextures[11] = new Texture(iContext, R.drawable.charsetb);
m_CharacterSetTextures[12] = new Texture(iContext, R.drawable.charsetc);
m_CharacterSetTextures[13] = new Texture(iContext, R.drawable.charsetd);
m_CharacterSetTextures[14] = new Texture(iContext, R.drawable.charsete);
m_CharacterSetTextures[15] = new Texture(iContext, R.drawable.charsetf);
m_CharacterSetTextures[16] = new Texture(iContext, R.drawable.charsetg);