Designing our level
Let's add some level design. Go to the right area of the layout and add some blocks. As you can see in the following screenshot, we've placed them with a gap between each other. They will fall down; but sometimes if you start a game with an object too close to another, the collision detection can malfunction.
Changing block density
Try out the game. You will notice that the cannonball does not really have a big impact on the blocks. Select them all and change Density to 0.2
, or you can change it to whatever value you want. This is shown in the following screenshot:
Adding the goal balls
Now, we need to add the goalBall
sprites. First, add a Physics behavior to the goalBall
sprite, as shown in the following screenshot:
Destroying the goalBall sprite
Next, add more balls to the level and then add an event to the goalBall
sprite:
When the
goalBall
sprite touches the ground, we will destroy it, as well as set up some extra functionality.
Add an On collision with another object action...