Creating a level with RUBE
Our template level needs a catapult to hurl the fish across the screen, a few bodies that will form the scaffolding, and the cats. For the catapult, we will create a simple rectangular body joined to the ground by a revolute joint. We will also customize the properties of the revolute joint to make the catapult as realistic as we can.
Since you already know how to create the bodies of various fixtures, I'm sure you can whip up the world within the following screenshot in no time. However, you can find the basic template file named Level00.rube
in the Resources
folder of the source bundle for this chapter. This is what the bodies within the template look like in the editor:
Open the Level00.rube
file, run the simulation, drag the catapult on the left side of the screen, and release it. Rest assured, we will create the catapult in the next section and you will see how we achieved the behavior that you will see in the simulation. For now, add a circle fixture body near...