Game Development Reference
In-Depth Information
Listing 10-52. Modifying the onDrawFrame() Function
public void onDrawFrame(GL10 unused)
{
GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
GLES20.glClear( GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
// UPDATE SFX
if (m_SFXOn)
{
TurnSFXOnOff(true);
}
else
{
TurnSFXOnOff(false);
}
// Did user touch screen
if (m_ScreenTouched)
{
// Process Screen Touch
CheckTouch();
m_ScreenTouched = false;
}
CalculateFrameUpdateElapsedTime();
FrameMove();
RenderScene();
}
Now, run and play the game, and you should see something as in the following Figures 10-1
through 10-4 .
Figure 10-1. Heart arena object
Search WWH ::




Custom Search