Chocobreak Tutorial - Step 9
Step 9: Adding the bricks
In a breakout game, one usually has bricks to that have be destroyed. We now have to add the bricks to our game, of course! We need a score getting goal for the game, and that is to destroy the bricks with the ball.
Lets go back to the frame editor : click on the "Frame editor" icon in the tool bar.
Once we are in the frame editor, have will want to refer to the library window : locate the object named "Milk" : this is a chocolate brick for our ChocoBreak game! Drag it with the mouse onto the playfield, and drop it somewhere in the top area of the frame. Drag and drop another "Milk" object from the library, and place it just under the last one you dropped.
Repeat the same procedure until you have created a column of seven objects. When you finally have seven of them stacked neatly, proceed to the next step.
Tip: Once you have selected an object, you can use the keyboard arrows to move, (nudge) the object pixel by pixel.
Now we want to duplicate the column to the right, in order to create a realistic looking chocolate bar. Click on the top-left of the bricks, and drag a selection frame around the bricks:
This action will select all the bricks within the area, as indicated below.
Now open the "Edit" menu in the main menu bar, and select the option "Copy". All the bricks are now copied into the clipboard. Open the "Edit" menu again and choose the option "Paste" : the mouse pointer will indicates that it is "carrying" something. Click in the playfield beside the selected bricks : a new set of bricks then appears, already selected. Now grab the selected bricks with your mouse pointer by clicking and holding. Then position them at the correct position, (see illustration below) so that the new set is nicely lined up with the previous ones. Remember that you can use the arrow keys for fine positioning, (nudging).
Once your new set of bricks is neatly positioned, you are then ready to paste, once again, and add another column to you growing set of chocolate bricks. At the end you should end up a complete group of bricks that looks just like this:
If the bricks on your screen look like that, it means that they are now setup properly for our game. As we said, the bricks are important to our game because the player's goal is to direct the ball skillfully enough to destroy them in order to earn points.
Note: As you can see, Clickteam Fusion 2.5 is similar to most editing tasks you will come across on your computer : you can cut. (or copy) and paste. Cutting, copying, and pasting, saves a lot of time and repetition, so use it whenever you can. What you have not learned yet is that you could have used a special function of the editor to create the entire group of remaining brick objects : by right clicking on the first brick and then selecting Duplicate, the entire grid of bricks could have been created instantly! Be sure to explore this time-saving capability after we finish the tutorial. I think you will find it indispensable in the long-run. Clickteam Fusion 2.5 provides many ways to save time and reduce your effort.
We now have to go on to define the events that take of or each brick as the ball collides with them. From you experience with this tutorial, you probably realise by now that we have to go to the Event editor. So, go ahead, click on the Event editor icon in the toolbar to begin this task.
You will now notice the new object in the object bar on the top of the event editor the "Milk" object. Now, we will create another condition. With your current skills, you should now know how to do this on your own. If you need some re-enforcement, then feel free to review the previous chapters before continuing.
Here is the condition we need to add:
First, we will want to make the ball bounce when it hits a brick. You probably already know how to accomplish this : locate your mouse under the ball on the condition line, and click with the right mouse button. Select the "Bounce" option in the popup menu. Or if you prefer you can drag & drop one of the bounce actions previously entered.
What should happen to the bricks when the ball hits them? When you create your own games, the entire process will often be about asking questions like that and finding the best solution. Clickteam Fusion 2.5 is full of perfect solutions for your games! As you learn more about how Clickteam Fusion 2.5 works with you and for you, you will quickly become more professional when it comes to solving every game's unique problems. Clickteam Fusion 2.5 was designed to help you in every way as you develop game ideas.
So, what we want to do next is to destroy the "Milk" object when the "BallGolden" object collides with it. When we destroy an object, it is gone for good for that part of the game, or at least, until the game starts again, or we create a new instance of that object. Locate the empty square on the same line of the new condition, under the "Milk" object. Right click to open the actions menu. Then select the "Destroy" option.
As with the rest of our game, we will want to make a sound when the "Milk" object is destroyed. Sound can be just as important as the visual aspects that the player sees. Clickteam Fusion 2.5 is a multimedia tool, so we can use sound to re-enforce the excitement of the game, and add more realism and emotion. Hold your mouse under the Sound object on the same line as before and click with the right mouse button. Choose "Play Sample" and locate the sound directory as before. Select the sound "IMPACT02.WAV".
Good job! Now you have a truly worthy set of bricks to challenge your player with. Along with previous chapters, you have accomplished much in a very short time. You have taught your ball to bounce off the bricks that it hits. You have assured that each brick that is hit by the ball will be destroyed on contact. You have also added some "special effects" by having the appropriate sound play when the ball hits a brick.
If you have followed the tutorial closely, and paid careful attention, you have already mastered many important aspects of game creation! You are well on your way to bigger and better things. With that in mind, let's add some more great features to our game. I think you are ready now to add some more common game features, and to learn about more of the great, Clickteam Fusion 2.5 tools at your disposal.
Spread the word!
You can share this document using the following buttons.