O'Reilly logo

Cocos2d-x Game Development Essentials by Gareth Jones, Arutosh Gurung, Frahaan Hussain

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

Chapter 10. Implementing Accelerometer Support

This chapter will cover how to set up accelerometer support within a Cocos2d-x project using the built-in functions. This chapter can be thought of as a general purpose reference guide with no additional dependencies.

Note

The contents of this chapter will not be used for the game that is being developed through the course of this book, but it is still important to have an understanding of accelerometer support using Cocos2d-x, enabling you to implement it in future projects.

The topics covered in this chapter are as follows:

  • Setting up the accelerometer
  • Detecting motion
  • Getting the motion's direction

Many existing games make use of accelerometer support to enhance the gaming experience. Accelerometers allow ...

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