Let's get even more physical

In the previous chapter, we talked about how to integrate the physics engine into your code. We also started implementing physical bodies to the brick objects, and now, we'll need to do the same with other active game objects, such as the paddle and ball. Let's continue with this last half of the tutorial. We will continue using our main.lua file from the Breakout project folder.

Corona display objects can be turned into simulated physical objects using one line of code. The following information explains the different forms of physics bodies:

A body shape is a table of local (x,y) coordinates relative to the center of the display object.

The syntaxes for the body shapes are as follows:

The following are the examples of the body shapes:

Now, we will discuss the parameters of the preceding methods: