.CheckFlyingSkills LDA xPlaneHi \ Set A = xPlaneHi - the x-coordinate of either the SEC \ bridge or town, which is the high byte of the distance SBC xObjectHi,Y \ along the x-axis between the plane and the object that \ we are checking BPL skil1 \ If A is negative, flip the bits, so A contains the EOR #&FF \ absolute value of the distance along the x-axis .skil1 CMP #5 \ If the high byte of the distance is less than 5, then BCC skil3 \ we are close enough to the bridge or town to warrant \ further checks, so jump to skil3 .skil2 RTS \ Otherwise we are too far away from the bridge and town \ to score any points, so return from the subroutine .skil3 LDA zPlaneHi \ Set A = zPlaneHi - the z-coordinate of either the SEC \ bridge or town, which is the high byte of the distance SBC zObjectHi,Y \ along the z-axis between the plane and the object that \ we are checking JMP skil4 \ Jump down to part 2 of the routine EQUB &4D, &50 \ These bytes appear to be unusedName: CheckFlyingSkills (Part 1 of 2) [Show more] Type: Subroutine Category: Scoring Summary: Check whether we are performing one of the tests of flying skill Deep dive: Flying skillsContext: See this subroutine in context in the source code References: This subroutine is called as follows: * MainLoop (Part 5 of 15) calls CheckFlyingSkills
This routine checks where we are, and awards the following points: * 50 points for flying under the bridge the right way up * 100 points for flying under the bridge upside down * 100 points for flying down the main street of Acornsville the right way up * 200 points for flying down the main street of Acornsville upside down There are multiple skill zones defined for each object (the bridge and the main street). To earn the points, we need to fly into the correct skill zones while avoiding others, and then back out again without hitting the ground.
Arguments: Y The skill to check: * 2 = Flying under the suspension bridge * 34 = Flying down the main street of Acornsville
[X]
Label skil1 is local to this routine
[X]
Label skil3 is local to this routine
[X]
Label skil4 in subroutine CheckFlyingSkills (Part 2 of 2)
[X]
Variable xObjectHi (category: 3D geometry)
High byte of the x-coordinate for an object
[X]
Variable xPlaneHi in workspace Main variable workspace
Plane longitude/x-coordinate (high byte)
[X]
Variable zObjectHi (category: 3D geometry)
High byte of the z-coordinate for an object
[X]
Variable zPlaneHi in workspace Main variable workspace
Plane latitude/z-coordinate (high byte)