Thank you for visiting Blazing Games

Tuning with Targets

One common problem with software projects is the hazzard of feature creep. This is when new features are continually added to a project. As a result, the project continues to grow in scope and never gets completed. This is a very easy trap to fall into, with some of the companies I have worked for having fallen into this trap. Having a tight release schedule helps prevent such problems. Still, there are times, such as this one, where adding a new feature can really help out the project. While the game is playable, there is clearly an enjoyment problem with the game. By adding a feature that helps aid the game flow, we are creating a better product and a much better game. For that reason, I felt that a new feature would be would be worth adding.

The target system was designed to speed up the game play making the player only have to repeat the correct door order sequence once per room (players with poor memories, of course, may have to repeat the sequence more than once per room). This is done by revealing the correct door once the player has selected a door. Twenty percent of the time, the player should guess correctly in which case they will proceed to the next room. The other eighty percent of the time, the player will be wrong, in which case a target symbol will appear over the correct door as the player zooms towards the trapped door. The obvious purpose of this is showing the player which door is the correct door. The side effect of letting the player know in advance that they have screwed up and are about to hit a trap is a pleasant bonus.

While this feature sounds simple enough, there is actually a fair bit of work required to add it. First of all, we need a target symbol. This symbol is simply a target movie. I have the first few frames of the target movie blank for the invisible state and the remaining portion of the movie with a target symbol drawn in it. I add a couple of functions to hide and show the symbol. This could have been done through action script by using the _visibility flag, but I figured that I might want to animate the target at a later time (though I never did) and wanted to keep my options open.

With a target symbol ready, we next had to modify the Door Group symbol. Over each of the doors in the group a target needs to be placed. To make accessing the targets easier, in the initialization action script for the Door Group we create an array that holds references to the five targets. We take advantage of this array in the closeDoors function by hiding all the targets when the doors are closed. And finally, we add a showTarget(n) function which shows the target.

Having a function that shows the target is not very much use if it is never called. This leads to the question of where to place the code to call it, and how to use it. As the enterRoom() function in the main time-line is called when a door is clicked, that would be the obvious place to add this code. But which target needs to be shown? The id of the proper door is not stored anywhere, so we have a couple of options. We can add this information to the initialization or we can search out this information when a room is entered. Searching for this information is very easy and won’t cost us too much in speed, so I opted for the second approach and did so by adding the following code to the top of the enter room function.

As you can see, this is really basic coding here. This could be sped up a bit by using a while loop or a break clause, but for our purposes it is good enough. We have no need to worry about hiding the target, as that is handled when we close the doors. This means we are done. Wow. The feature didn’t take very much time to add at all. Another quick play through the game clearly shows the little bit of time it did take to add the feature was more than worth it. It also means that the first release is almost finished.

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

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