| Falling Bricks Game - Part 1 |
|
|
|
| Written by Administrator | ||||
| Friday, 14 September 2007 20:42 | ||||
|
Learn how to create a "Falling bricks" game in Flash. This is the first part. Almost everyone that has played a flash game has played a "Falling Bricks" Game. It is a classic. In this small tutorials I will teach you how to make one yourself. Hi! Almost everyone that has played a flash game has played a "Falling Bricks" Game. It is a classic. In this small tutorials I will teach you how to make one yourself. Let's begin as we always do. Create a new flash document. Modify the width and height to get the desired dimensions. My document is 500x450. The first part is also the easy one. Let's create a menu. We need to first create a background image for the menu. We create a nice graphic in any image editor that is the same width and height as our document. In order to do this you need to main things: graphics talent and a theme for the game. I chose to make a space game. So my background for the main menu will be space ship, some stars and a sun. Click on the below link in order to view the image. REMEMBER to use you imagination. I know my image is not that good. It is only used for this tutorial. And here we are focusing on flash, not image creation software. Main Menu Background Now we need to create the buttons for the menu. This will be a simple menu with only two buttons a "Play" button and a "Credits" button. When we press the "Credits" button the game will show the creators of the game. This is up to you how to make it. You can create another key frame where the credits will be placed or you can make a pop-up window in flash that will hold the credits. The customization of the game is up to you. Make it how ever you want. Now I hope that you already know how to create button (using th button element from flash or my creating simple MovieClips and animating them with AS). I won't stay to explain this part. If you won't know how to do this read the Dynamic Menu tutorial that is also here on the site. That will teach you everything you need to know. Now comes the part where you will have to decide how you want your levels to be. If you level will have the same background, same elements on the stage and only the number of bricks you need to avoid in order to finish the level, the speed and frequency of the bricks, than you just need one keyframe and modify all of this with the action script. But if you will have different backgrounds, different types of bricks and each level will be unique than I suggest you make a keyframe for every level. Some functions will remain the same for every level and some will need some modifications but in this case you don't have so much coding to make. In my game I chose to make each level unique, so there will be a keyframe for every level. Before we continue you need to create three more things: 1. The player - this is the object that needs to avoid the bricks. In my case it will be space shuttle or a space ship. Depending on the theme you have chosen earlier you must make something appropriate. 2. At least one type of brick. By brick I mean anything that will fall from the top of the screen. In my case the brick will actually be missiles. The player will have to avoid these in order to finish the level. 3. The background for the level. Make it look nice and interesting. Now import all the graphics. Put the player on the stage and convert it into a movie clip. Ad an Instance name to it. Call him "player". Now also ad an empty movie clip on the stage. Ad the instance name to it "items". This will be the holder for all the bricks that will fall. Also convert your brick images to movie clips and export them for ActioScript. to do this in the library right click on the movie clip, click on Linkage, and mark "Export for ActionScript". Notice that "Export in FirstFrame" will also be marked. Leave it that way. Now ad an Identifier to it. Click OK). I strongly recommend to make the Identifier name as: brick1, brick2, brick3...brick44 (or how many bricks you have...you get the idea). This will make your job a lot easier when you will have to place the bricks on the stage using AS. As you noticed we did not write a lot of action script yet. Don't be afraied, we will in part2. Now we just set up the stage and our working ground. We made all the graphics that we need and I expect to see you back for the second part of our tutorial.
|
||||
| Last Updated ( Friday, 14 September 2007 20:43 ) | ||||


