Skip to navigation

Sights: MoveSights

Name: MoveSights [Show more] Type: Subroutine Category: Sights Summary: Check for up/down/left/right key presses and move the sights accordingly, panning the screen if they go past the screen edges
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * CheckForKeyPresses calls MoveSights
.MoveSights JSR MoveSightsSideways \ Check for the left/right keys and move the sights \ accordingly, panning to the left or right if they go \ past the screen edges LDA panKeyBeingPressed \ If panKeyBeingPressed contains a key press then one BPL sigh1 \ of the left and right keys is being pressed, so jump \ to sigh1 to skip scanning the up and down keys as we \ can only move the sights in one direction at a time JSR MoveSightsUpDown \ Check for the up/down keys and move the sights \ accordingly, panning up or down if they go past the \ screen edges .sigh1 JMP DrawSights \ Jump to DrawSights to draw the sights in their new \ position, returning from the subroutine using a tail \ call