Airport Madness Version 1.2 Changes
First, thanks to everyone who informed me of the issues they were having with my ATC game Airport Madness v1.1. These issues are mostly fixed, but some are still reporting difficulties. I have had a moral hesitation to move forward with Airport Madness 2 before fixing the first one. And so, I have invested much time in attempting to eliminate these bugs, but it is time to move on. The next version will be code-written from scratch with better, more efficient code. The latest build, Airport Madness Version 1.2, has the following changes:
- Aircraft control panels now close automatically after another aircraft is clicked;
- Aircraft should not veer off of the runways anymore;
- Aircraft hold short of runway 07 when they are told to.
Please keep the feedback coming. I am trying to make this air traffic control simulation as fully functional as possible. So here's what was wrong (what is still wrong?) for all you code freaks out there:
<nerdy actionscript stuff>
Aircraft that are told to hold short (or need to hold short because of other aircraft holding) are pushed into arrays. (e.g. holdShort07array, holdShort30array ...). An aircraft can figure out exactly where it is supposed to stop by observing the length of that particular array. If two aircraft are holding short of runway 07 and then a third aircraft comes along, the third aircraft observes that the hold array has a length of two, so it stops at "holdSpot3". Later, when the first aircraft in line gets moved, its' instance gets shifted out of the array and the array length gets reduced by one.
Up until last night I was convinced that a stubborn array was the cause of aircraft not stopping like they were supposed to. Then it occurred to me that there is no such thing as a "stubborn array" that refuses to push, just as there could be no such thing as a "stubborn variable" that doesn't work. The problem was not in the code. The problem was my definition of "holdSpot3". Since all aircraft taxi tracks vary slightly, some of these were managing to miss holdSpot3 by a couple of pixels. The solution was to move holdSpot 3 just a smidgen. (A smidgen is defined as 2 pixels in my dictionary) .
I've written this simulation with realism in mind. Each instance of an aircraft has a heading, a speed and a height. Unfortunately at 20 frames-per-second, the door is wide open to behavioral variations and errors. Rather than take a stick of dynamite to the whole thing and rebuild it from scratch, I'll leave well-enough alone and save my energy for the all-new Airport Madness 2, coming next month. So stay tuned.
<end nerdy actionscript stuff>