CHAPTER 4

image

Adding Polish to Your Game

This chapter builds on the Starfish Collector game introduced in the previous chapter. The core game play remains the same; the additions include background music and sound effects, as well as a user interface with customized bitmap fonts, image-based buttons, and other UI controls.

Audio

Incorporating audio into your game is a straightforward process, thanks to the built-in functionality of the LibGDX libraries. Supported file types include MP3, OGG, and WAV. LibGDX provides two interfaces for this purpose, Sound and Music, each of which can be created from the audio object of the Gdx class. (The classes ...

Get Beginning Java Game Development with LibGDX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.