O'Reilly logo

Mastering LibGDX Game Development by Patrick Hoey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Camera shake

The next effect deals with making the blows dealt and received in the game more impactful. Sound effects definitely help, but some visual cues also can really add to this effect. The ShakeCamera class will generate random coordinates based on a starting position. At the beginning of a shake cycle, these positional changes will be significant, but over time, these positional changes will get smaller until we reach some defined threshold. These positional changes give the illusion that the target is shaking on the screen.

The following class diagram (Figure 2) shows where the ShakeCamera class is primarily used:

Camera shake

Figure 2

In BludBourne, the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required