EUG PD


Space Shuttle

 
Published in EUG #72

Why wait for TV pictures of the next Space Shuttle mission? Kevin Boyd's program for the BBC Model B micro simulates it so realistically that you'll think it's the real thing

Sit back and watch as the U.S. Space Shuttle takes off in a cloud of smoke and launches a satellite into orbit. Then you have a pilot's eye view of the spacecraft coming in to land on a runway etched into salt flats.

My simulation uses 6.5K and runs in Mode 1 on the BBC Model B computer for 117 seconds.

The drawings of the shuttle and booster rockets are as accurate as I could make them. Ceratin things were deliberately left out for the sake of clarity.

The program is split into five sections and each uses three main graphics routines which draw triangles (PROCtri, 1090-1130), rectangles (PROCrect, 1140-1190) and circles (PROCcircle, 1200-1280).

These routines are used a lot, so here is a description of each of them:

PROCtri ... has seven parameters. The first six are three sets of two co-ordinates to define the three points of the triangle and the seventh parameter is a flag. If set to 1 the triangle is filled in, if zero it is not.

PROCrect ... works in the same way to draw a rectangle, starting bottom left.

PROCcircle ... begins with two parameters for the centre of the circle. The next two are the radius and a flag, used as above. The routine uses two arrays, set up in lines 130-140. They hold the SIN and COS values to calculate the circle - much faster than calculating the values each time you call the routine.

How It Works

110-140 produce title page while circle arrays are calculated
150 set graphics mode (resolution is 320 by 256 in hi-res with four colours, 40 by 32 text)
160-170 set up sound envelopes
180 change colour 2 (yellow) to colour 6 (cyan)
190 cursor off
200-240 call PROCedures
270-600 draw fuel tank, booster rockets
610-1080 draw shuttle
1090-1130 triangle
1140-1190 rectangle
1200-1280 circle
1290-1340 initial blast of smoke
1350-1430 ever-widening tower of smoke, move shuttle
1720-1730 over payload doors
1740-1820 draw satellite inside payload area, define text window from shuttle to top of screen then scroll satellite to top of screen then scroll satellite to top
1830-1970 launch satellite out of sight of shuttle, then out of your view
1990 invert: black to white, white to black
2000-2050 view of shuttle approaching runway
2060-2140 shuttle touches down

 
This demo was originally published in Home Computing Weekly #39.

Kevin Boyd