O'Reilly logo

Learning AndEngine by Martin Varga

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 6. Physics

In the last chapter, we introduced one of the ways to move a character in AndEngine using the entity modifiers. However, for our game, we are going to use a physics engine. In this chapter, we will first introduce the physics engine used in AndEngine. We are also going to explain basic physics terms, such as force and velocity, and how they are used in AndEngine. We will cover the limitations of the physics engine too.

In the second part of this chapter, we will implement some of the actions of our character using the physics engine and accelerometer readings. We will also add platforms and the enemy to the game and define them as physics bodies.

The physics engine

AndEngine uses the Android port of the Box2D physics engine. Box2D ...

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