O'Reilly logo

jMonkeyEngine 3.0 Cookbook by Rickard Edén

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

Creating a reusable character control

To start off the chapter, we will create a class that we can use for various character-controlled purposes. The example describes an FPS character, but the method is the same for any player-controlled character.

The Control class we'll build will be based on BetterCharacterControl. It might be a good idea to have a look at the class or the TestBetterCharacter example from the jMonkeyEngine test package if you want to find out how this works. Another good starting point would be the input examples from the same package.

Getting ready

The BetterCharacterControl class is based on physics and requires a BulletAppState class to be set up in the application. The steps required to do this are described in the The ImageGenerator ...

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