In this task, we define multiple levels that contain different combinations of obstacles.
We have successfully put bodies in the physics world in the previous tasks. In this task, we would like to extract the body placement into an easier definition, so that we can massively define a series of levels.
In these levels, we define the position of the hoop and ball. We also define how obstacles are placed in each level.
We define the levels in a new file called
level.js. Let's include it in HTML:
We will now work on the newly created
level.jsfile, we define the balls and levels data. Most of the data defines the physics properties: