Game Development Reference
In-Depth Information
testCollisions();
cameraHelper.update(deltaTime);
if (!isGameOver() &&isPlayerInWater()) {
lives--;
if (isGameOver())
timeLeftGameOverDelay = Constants.TIME_DELAY_GAME_OVER;
else
initLevel();
}
level.mountains.updateScrollPosition
(cameraHelper.getPosition());
}
All three mountain layers will now scroll at different speeds: 30 percent, 50 percent,
and 80 percent.
Enhancing the game screen's GUI
The last part of this chapter is dedicated to two enhancements of the game screen's
GUI. Firstly, we will add a small animation that gives visual feedback to the
player when a life is lost. Secondly, a counting-up animation for the player's score
will be implemented.
Event - player lost a life
We want to play a small animation in the event when the player has just lost a life.
The extra lives are shown as bunny heads in the top-right corner of the game screen.
These icons become dark one after another as soon as another life has been lost.
The animation we are aiming for is a temporary bunny head icon on top of the just
lost extra life. The temporary icon is going to be scaled up, rotated, and will have a
slightly red tint.
 
Search WWH ::




Custom Search