Skip to navigation

Landscape: PreviewLandscape

Name: PreviewLandscape [Show more] Type: Subroutine Category: Landscape Summary: Draw an aerial preview of the landscape
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * JumpToPreview calls PreviewLandscape
.PreviewLandscape JSR SpawnEnemies \ Calculate the number of enemies for this landscape, \ add them to the landscape and set the palette \ accordingly LDX #3 \ Set X = 3 to pass to DrawTitleView so the background \ of the landscape preview is black with stars LDY #0 \ Set Y = 0 to pass to DrawTitleView so it draws the \ screen with the correct perspective for the landscape \ preview LDA #&80 \ Set A = &80 so the call to DrawTitleView draws the \ landscape preview JSR DrawTitleView \ Draw the landscape preview LDX #4 \ Print text token 4: Background colour black, print JSR PrintTextToken \ "PRESS ANY KEY" at (192, 64), print "LANDSCAPE" two \ characters right of (64, 768), move cursor right JSR PrintLandscapeNum \ Print the four-digit landscape number (0000 to 9999) JSR SpawnPlayer \ Add the player and trees to the landscape \ \ If the entered secret entry code in the keyboard input \ buffer does not match the generated secret code for \ this landscape then the call will return here so we \ can display an error \ \ If the codes match then the CheckSecretCode will jump \ to the PlayGame routine instead to play the game JMP SecretCodeError \ The entered secret entry in the keyboard input buffer \ does not match the generated secret code for this \ landscape, so jump to SecretCodeError to display the \ "WRONG SECRET CODE" error, wait for a key press and \ rejoin the main title loop