I actually enjoy the codebase refactoring process. Being able to take an unruly piece of code that you knew was completely inelegant when you wrote it, and to beat it into a clean efficient solution is part of one of the reasons why I absolutely love coding.

Recently I realized when I would get to the AI heavy part of the Active Pain puzzle game that I would need to pass around several representations of the puzzle board around to all of the different doctors (Controlled by AI), and then also pass around theoretical boards around to other methods for heuristics.

However I then realized that Flash is how it encourages you to put your model together with your view and controller. So I spent the past week or so trying to seperate that kind of logic from my code. Thus I'm left with a visual representation of the board, and a model (data) representation.

So when the AI is analyzing the board to find out what group of blocks to remove I'm not passing around N movieclips to various analytical methods (and not making sure they're also hidden too). I'm hoping this adds a bit of a speed boost when things get crazy later.

To do all of this refactoring felt  like wrestling a bear. At first you don't want to do it because you may die [break everything in your program], but if you manage to live through you'll be a better person in the end [cleaner code].

That and wouldn't you want to be known for wrestling bears AND WINNING - that's so badass :)



In the last two weeks or so, I've added the following to the puzzle game:

  • A new super virus called ACHES (Red Spiky Things). For each ACHE on the screen it increases the rate that the patient loses health.
  • Another new super virus called SCABS (Dark Blocks). SCABS are randomly made whenever the player clears blocks. If the player clears blocks adjacent to this virus, the SCAB will crack. After 3 cracks the SCAB disappears. SCABS do not roll off the bottom of the screen so it's important that the player deals with them before the bottom fills up with them.
  • Added a little bit of design to the regular blocks. Of course this isn't a full graphics pass yet - I just wanted something else to look at for a change.

About the Author

Jelani Harris is a man that enjoys playing games almost as much as he does making them. When he's not eliminating his digital opponents he spends his spare time writing short stories, creating websites, watching dirty old-school kung-fu movies, and working on his time machine.


Visit their Website


There are no replies to this post.

Post your comment