Since it's been a few months since I've presented an animation program, I hereby offer October's program of the month Space Dock. Written when the space shuttle program was in full swing, Space Dock depicts a shuttle launch for its scheduled docking to repair a satellite. Though time has purged my memories of writing the program, I do remember sketching out the shuttle design on graph paper. I often spent a lot of my free time drafting out screen designs which became the basis for many of my programs. Although many of those ideas ultimately became programs, many on this site, many more languish in my note-book. Some of those programs were plain silly and rightly abandoned.††Others were too difficult or ambitious for my skills and perhaps the ZX81 itself. Fortunately, for me anyways, Space Dock passed muster and became reality.
As a program, like many of my early designs, it is straightforward. You won't find any ground breaking algorithms here. However, in this case, the simplicity of the design works. I start the program with a PRINT command a couple of loops to build the shuttle and launch pad. A fueling truck sits next to it, finishing it's job. The truck then rolls away using some simple math checks to print alternating wheel images on the even and odd numbers of the movement loop. Of course, the truck can't stay on the pad. To end the sequence, Space Dock lowers the truck into the ground using some simple print and pause routines.††Up to this point, nothing earth shattering.
To create the launch sequence, I employed the ZX81's SCROLL command. Although I could just have easily used print statements to lift off, scrolling the screen does two things for me. One, it reduces the need to create a series of print routines, or even a large print line, to move the shuttle. Second, it alleviates me from having to break the shuttle up so I can move it off the screen. As one of the longer sequences, it requires only a five lines of codes to complete the launch.
The ending sequence is somewhat disappointing. Space Dock prints the satellite using loops, much like I animated the shuttle at the start. It then uses a giant print routine for the shuttle in space. Although it makes sense why I did it, it prints quickly and a loop would have required multiple PRINT AT commands to display the multiple layers on the screen. In the end it lacks the charm that started the program. This doesn't make the ending bad. It just isn't as consistent as it could be. The blinking signature was also a horrible design and the program originally ended here. To make Space Dock ready for the web, I wrapped the signature in a short loop and restart the animation. I also added some auto-run code so you don't have to start it after loading. These last two changes only change the flow.
If I had it to do over, I'd probably spend a bit more time on the end. First off, I'd remove that blinking text, maybe adding some other text or such. It also wouldn't have taken much to scroll that shuttle across the screen. A slowing floating across the sky shuttle would have been a more fitting ending. And, since I never docked the shuttle, I could have put an arm in there as well. Of course, I have to remember how long it took to enter in even a small program like this one. Between RAM pack wobbles cutting power, a mushy keyboard, and minimal amounts of memory, I should be glad I finished it.
Well, enough of me rambling. Enjoy the watching and I'll see you next month!
If you want to run this program on your Android phone or tablet you can download a compressed copy of the program to your device. You'll need to save the .p version of the program to your device to allow Zed Ex (Beta) to run it.