Thank you for visiting Blazing Games

Standard Logic

The first part of assembling the standard game mode is to set up the doors randomly. This is done through the restartGame function. At the heart of the function is a nestled loop that handles this task. It simply fills the array of rooms with a number indicating the type of trap and then selects one of the doors at random to be the correct door. For this door, the trap value is set to 0. You may wonder why I have wrong doors assigned a trap number instead of using a simpler array of boolean flags. This was done just in case I decided to have the traps assigned to a room randomly. I later decided that tying the traps to the room number was the better design as it was more consistent for the player.

Knowing which doors are trapped certainly helps. But at the moment, clicking a door only starts a sequence of trap animations. The enterRoom(n) call-back function needs to be adjusted. I decided that zooming towards the opening door was in order. There are two routes that I thought of for doing this effect. The first route would be to have the animation handled in action script. The second would be to have five separate animation sequences showing a zoom towards the desired door. The second method was easier to do, so I went that route. This turns the enterRoom function into a switch that selects which zoom segment to branch to. At the end of each door’s animation, I make a call to a processDoor(n) function, with n being the door number with doors being numbered from 0 for easier array indexing.

The process door function is very similar to the enterRoom function, except instead of determining which zoom animation to play, it determines which trap animation to play. The first step of this process is simply determining if the player has selected a trapped door or not. Remember that non-trapped doors have a trap value of 0. If the door is not trapped it must be correct, so the current room number is incremented by 1. As it is possible at this point that the player has just won the game, a separate check to see if the room is room 10 is done. If so, instead of going to the main game loop, we go to the ending animation. On the other hand, if the room is a trap, we go to a big switch statement that goes to the appropriate trap animation based on the ID of the trap.

The game is almost ready, with the only things missing are a way to close the doors between guesses and the room number. There already is a function within the door group that handles the closing of doors, so all that has to be done is a call to that function within the main game loop. The room number is a temporary problem, as the second and third releases of the game will have a LCD display that solves this problem. A temporary problem requires a temporary solution. Preferably one that can be implemented very quickly. Flash has the dynamic text object, so the solution for the initial release is to have some dynamic text that will display the room number. This code and object are not in the final versions of the game, so you will not be able to look at the source code to see how this was done. I am telling you about it so that you can better follow how the game was developed.

The game should now be playable at this point, so the game is ready for testing. Testing is one of the two times you should cheat when playing the game. The other time, at least in my opinion, is when you are stuck and can’t get further in a game. I know some people who never play a game without using cheat codes while I know others who would die before using a cheat code (and often repeatedly do). I am in-between those two extremes. I like finishing games, but I absolutely HATE BOSSES. This is because I usually get trounced by the boss. Again and again and again and again and again and again. This could be why I like RPGs. With a good role-playing game, you can build your character up to huge levels. If a boss is too difficult, build up your character some more and try again.

While Deadly Doors does not have any cheat codes, one can cheat by simply writing down the order of the doors. A better way of cheating is to take a single peace of scrap paper and draw a 5x10 grid on it. Each square on the grid should be big enough to hold a penny. Then one simply needs to put a penny on the appropriate door. The advantage of testing this way is that eventual shifting mode can be handled by sliding the penny.

Testing the game does reveal one flaw in the game. In order to find the correct door, the player needs to try out doors until they get the right door. Every time they get a wrong door, they have to start over. This gets really annoying as you get to later doors. Readers who have played the game know what my solution to this problem was. Targets.

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

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