Hot Air Balloon; pilot your Apple up, up, and away. Dan Westesen.
Hot Air Balloon
Pilot Your Apple Up, Up, and Away
Have you ever watched a beautiful balloon soaring over town on a cool Saturday morning in the fall and wished you could go for a ride? Well, it's not quite the next best thing but this program will allow you to soar with your Apple. You can float over craggy mountains, and if you aren't careful, you can crash on those mountains. But, it is easy to repair the balloon and fly once again: Just type yes and press RETURN and it is up, up, and away.
The balloon has several of the features of a real balloon, including slow reaction times. If you want to rise, it may take several seconds after you turn on the burner for the balloon to react. Similarly, it may take several seconds after the burner is turned off for the balloon to level off or begin descent.
The balloon also has only a limited amount of fuel. If you are in the wrong place when you run out, the result is a crash landing. Even if you do manage to land on a nice flat spot, you will crash if you descend too fast (-12 vertical velocity). The balloon also comes equipped with a fuel gauge, vertical speed indicator, altimeter, and burner monitor.
As in the real world, winds in this program blow in different directions at different velocities. There is an upper level wind, a lower level wind, and a tricky wind between the peaks. The last and most challenging similarity to reality is that everything in this program happens very slowly until you are in trouble; then it happens all too fast.
Entering the Program
The program is in two parts. The main part of the program is very simple to enter. Enter it as you would any basic program. The second part of the program is the shape table for the balloon and the crashed balloon (the mountains are drawn from the main program). To enter the shape table, first enter the monitor (CALL-151) and enter the shape table as shown, replacing the dashes with colons. When finished type BSAVE SHAPE:BALLOONS, A$4000, L$9D. The program has a provision for loading the shape table the first time (lines 310 through 340).
Explanations, Variables and Modifications
The remarks outline what the program does in each section. Here are some further explanations to help in modifying the program.
Lines 110 through 130 set up the rotation for aerial crashes. These crashes occur when the balloon hits the top or side boundaries.
Lines 470 through 990 take care of the launch, winds, flight, and checking for crashes. Lines 1000 through 3160 do the crashes, landings, scoring, and restarting the program.
If you want more or less fuel just change the variable FUEL in line 160. Also in line 160 you will find the variables X1 and Y1, the starting coordinates of the balloon.
LFT is the variable for the current rate of change of altitude of the balloon. How much this variable is incremented can be adjusted in lines 590 and 610 and 640.
The variable for wind is WND, and it is set in 690 through 710. These lines check the position of the balloon and then set the direction and speed of the wind.
Lines 765 through 790 update the instrument panel.
Lines 810 to 850 check to see if the balloon is on one of the flat landing zones. If it is, the program goes to line 1000 to check if the landing was too hard before continuing.
Mountain crashes are checked in lines 890 through 940. These lines contain the equations of the lines running along the mountain sides. If the point on the bottom of the balloon crosses one of these lines, a crash occurs.
Line 980 checks to see if the edge of the screen has been touched by the balloon. If it has, the program skips to line 3000 where a spinning crash occurs.
Lines 1040 through 1120 finish good landings and do the score keeping. The first good landing is worth 5 points, the second 10 points, the third 15 points, etc.
Lines 2000 through 2070 crash the balloon if it hits the side of the mountain.
Try the program as it is first, then try modifying the fuel, winds, and lift. Happy ballooning!
Table: Listing 1.
Table: Shape Table