.main12 LDA onGround \ If onGround is zero, we are in the air and can't BEQ main13 \ terminate the game with the right arrow key, so jump \ to main13 to skip the following LDX #&86 \ Scan the keyboard to see if the right arrow is being JSR ScanKeyboard \ pressed BNE main13 \ If the right arrow is not being pressed, jump to \ main13 JSR TerminateGame \ The right arrow is being pressed, which is the key to \ terminate the game, so call TerminateGame to do \ exactly that JMP NewGame \ Jump to NewGame to start a new gameName: MainLoop (Part 7 of 15) [Show more] Type: Subroutine Category: Main loop Summary: Process the terminate key Deep dive: Program flow of the main game loopContext: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
[X]
Subroutine NewGame (category: Setup)
Start a new game
[X]
Subroutine ScanKeyboard (category: Keyboard)
Scan the keyboard for a specific key
[X]
Subroutine TerminateGame (category: Setup)
Terminate the current game
[X]
Label main13 in subroutine MainLoop (Part 8 of 15)
[X]
Variable onGround in workspace Main variable workspace
"On the ground" status