Skip to navigation

Main loop: MainLoop (Part 10 of 15)

Name: MainLoop (Part 10 of 15) [Show more] Type: Subroutine Category: Main loop Summary: Award points for a successful landing Deep dive: Program flow of the main game loop Take-offs and landings
Context: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
.main16 LDA reached512ft \ If we have not yet reached an altitude of 512 feet BEQ main17 \ since taking off, reached512ft will be zero, so jump \ to main17 to skip the following, as we are not \ eligible for the landing points LDX #0 \ Set reached512ft = 0 to reset the 512 feet counter, STX reached512ft \ ready for the next landing attempt LDA #&15 \ We have successfully landed the plane without JSR ScorePoints \ crashing, so add 150 points to the score and make a \ beep by calling ScorePoints with (X A) = &0015