Game Development Reference
In-Depth Information
winOptions.setPosition(Constants.VIEWPORT_GUI_WIDTH
- winOptions.getWidth() - 50, 50);
return winOptions;
}
private void onOptionsClicked () {
loadSettings();
showMenuButtons(false);
showOptionsWindow(true, true);
}
private void onCancelClicked () {
showMenuButtons(true);
showOptionsWindow(false, true);
AudioManager.instance.onSettingsUpdated();
}
These changes simply put our animation methods in place where needed. The
buildOptionsWindowLayer() method calls showOptionsWindow() with both
parameters for visible and animated set to false . The reason for this is that we want
the Options window to be hidden at the start like before and we also want this to
happen in an instant. The onOptionsClicked() and onCancelClicked() methods
call both show methods to either show or hide the menu buttons or the Options
window, respectively.
Using sequences of images for
animations
Up until now, all the animations we have created are based on changing attributes,
such as the position, color value, and size, of still images. Therefore, our next
enhancement is targeted toward the game objects that inhabit the game world of
Canyon Bunny. We want to breathe life into the gold coin and bunny head game
objects by creating several animations that are built from sequences of individual
images. The resulting effect is very similar in comparison to an ordinary lip topic
where multiple images are perceived as a continuous animation when shown in
rapid succession.
 
Search WWH ::




Custom Search