This code appears in the following versions (click to see it in the source code):
Code variations between these versions are shown below.
.ISDKName: Main flight loop (Part 9 of 16) Type: Subroutine Category: Main loop Summary: For each nearby ship: If it is a space station, check whether we are successfully docking with it Deep dive: Program flow of the main game loop Docking checks
The main flight loop covers most of the flight-specific aspects of Elite. This section covers the following: * Process docking with a space station
Other entry points: GOIN We jump here from part 3 of the main flight loop if the docking computer is activated by pressing "C"
LDA INWK+14 \ 2. If nosev_z_hi < 214, jump down to MA62 to fail CMP #214 \ docking, as the angle of approach is greater than 26 BCC MA62 \ degrees
The cassette and Electron versions contain an extra docking check that makes sure we are facing towards the station when trying to dock.
Tap on a block to expand it, and tap it again to revert.
When docking, the cassette version checks that the angle between the vector to the space station and the nominal approach is less than 22.0 degrees; in the disc version, it checks that the angle between the vector to the planet and the nominal approach is less than 26.3 degrees; and in the advanced versions, it checks that the angle between the vector to the planet and the nominal approach is less than 22.0 degrees.
Tap on a block to expand it, and tap it again to revert.
LDA INWK+16 \ 5. If |roofv_x_hi| < 80, jump to MA62 to fail docking, AND #%01111111 \ as the slot is more than 36.6 degrees from horizontal CMP #80 BCC MA62 .GOIN
.MA62 \ If we arrive here, docking has just failed LDA DELTA \ If the ship's speed is < 5, jump to MA67 to register CMP #5 \ some damage, but not a huge amount BCC MA67 JMP DEATH \ Otherwise we have just crashed into the station, so \ process our death