Thank you for visiting Blazing Games

Building the Basics

Now that we have worked out what the game is suppose to do (you have read the first part of this article, haven’t you?) we can now start creating the game. The first thing that we are going to need is a door. One of the advantages of having built a large number of games for Blazing Games is that I have access to a large stockpile of assets. I have been told that it is always faster to use existing parts than to build the parts from scratch. This ideology is only partially correct. If you are aware of the part and hold all the rights to the part then you will probably be served by using the existing part. On the other hand, if you do not own the part, the time invested in finding the part and the costs of using the part must be taken into account. When, like me, you have no budget and your only resource is your time then the value of creating your own parts is heightened.

One of those Weeks happens to have doors in it, so taking a door image from that game is no problem. The door was stored in the library as “Door Image”. Doors, however, need walls. I happen to have a collection of public domain textures, which I have used before. Using public domain materials has no cost other than the time spent finding it (that is assuming you actively search for it. I tend to stumble upon things so most of the public domain stuff I have didn’t really take any of my time other than the few minutes to download and catalogue it) but as I already have the collection, I don’t have to search for it. The big problem with public domain material is making sure that the material you find is in fact in the public domain as you don’t want to infringe on other peoples copyrights. Just because something is in a public domain directory does not mean it is public domain. Still, if you find some public domain art or sounds while browsing, add them to your collection.

The brick texture is nice, but to use it, a shape has to be created, and the texture applied to the shape. The shape is a rectangle with a rectangle the size of the door cut out of it. The hole has to be there as the door needs to open, so there has to be an empty space behind the door. A movie clip is created from the “Door Frame” symbol called “Door Block”. The layer of this movie that contains the door frame is labelled “frame.” Above that layer is the door layer, which contains the closed door and an animated sequence of the door opening. The animated sequences is actually remarkably simple to do. All that is done here is the door is shrunk horizontally. When played quickly, it appears like the door is being opened.

To control the state of the door, a code layer is added. Functions for opening the door and closing the door are created. These functions just goto labels that are added to the appropriate locations of the movie. Later on in development, it was decided that doors should act like buttons, so they can be clicked. A door button symbol was created and used to handle this. Because there are multiple doors that need to be tracked, a setID function was added to the clip. Also added to the clip is function calls to the parent that tell the parent when the door is opened. The function is passed the id of the door. Calling parent functions is a very handy way of communicating with the rest of the program. Of course, at the moment there is no parent. Lets rectify that problem.

The parent is not the main movie clip. Instead, the parent for the Door Blocks is the “Door Group.” This consists of five door objects on a doors layer, a layer consisting of a roof over the block of doors, and a code layer. For those of you with Flash open to the source code may be a bit concerned, as there are many additional layers. Those will be discussed as we get to the reason they exist. For now, just pretend there are only three layers.

The actual code for the Door Group movie is on the second of two frames. I do this to make sure that all the objects in the movie are properly initialized. The frame’s code simply assigns an id to the five Door Block objects, then creates an array of these objects for convenience. The call-back function doorOpened(n) is added. It starts the door opening animation and calls the main game’s enterRoom function (which at this point in time doesn’t exist, but we know it will) to let the main movie know that it should start the door opening animation.

At this point, we have a pretty good start for the game. By adding a copy of the Door Block to the main movie, we are able to see the doors being opened. So with part of our goal for the game complete, let us now focus on the most interesting part of making the game.

Previous Making Deadly Doors Contents Page 2 of 10 Deadly Doors Next

About - Privacy Policy - Contact - Links - FAQ
Copyright © 2005-2006 Blazing Games Inc. All Rights Reserved.