Chapter 8. Box2D Meets RUBE

In this chapter, we will use Box2D to create yet another physics game. This time, we will make use of an amazing physics editor that goes by the name Really Useful Box2D Editor, more commonly referred to as RUBE. After you've read through this chapter, you will see why the creator of RUBE named it that way!

In this chapter, you'll learn:

  • How to create a complete physics world using RUBE
  • How to add level design parameters into a physics level using RUBE
  • How to use Box2D's PostSolve function
  • How to implement explosions in Box2D

An introduction to Angry Fish

I'm sure, just by reading that title, you know what to expect from this chapter and game. The player will have to use a catapult to hurl a series of extremely offended (haven't yet worked out why they're offended) fish towards an intricately constructed scaffolding, thereby bringing it down and destroying the cats that are housed within.

We shall go about this chapter in the following way:

  • Creating a scene with some bodies and fixtures with RUBE
  • Running the scene within RUBE
  • Creating the game's bodies with RUBE
  • Adding custom properties to a scene with RUBE
  • Exporting the scene and generating a level in Cocos2d-x using b2dJson
  • Defining the Fish class and its various subclasses
  • Defining the Cat class and finishing up the game

This is what we will achieve by the end of this chapter:

An introduction to Angry Fish
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.50.87