For our fifth game, we will get down to the physics of things. Cocos2d-x comes bundled with two wonderful physics engines: Box2D and Chipmunk. In this chapter, we will make use of the versatile and robust Box2D physics engine to add some realism to our game.
In this chapter, you'll learn about the following:
Our first physics game stars a clown that has a dream to reach the sky. Naturally, gravity pulls him down each time he jumps and so he needs our help. We need to build trampolines for him as he begins to fall, enabling to him reach as high as possible. We can build him a trampoline simply by sliding our finger across the screen. Every now and then, our clown runs into a bottle rocket that shoots him further upwards and a balloon which takes him steadily higher.
This is what we will achieve by the end of this chapter:
3.137.183.10